side quests for lsp server (#2119)

* all

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* more

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* side quests only

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Jess Frazelle
2024-04-15 17:18:32 -07:00
committed by GitHub
parent 6d12aa48f8
commit 9a9c2223de
76 changed files with 3334 additions and 900 deletions

View File

@ -5,9 +5,20 @@ import {
} from '../lang/std/engineConnection'
import { Models } from '@kittycad/lib'
import { Themes } from './theme'
import { v4 as uuidv4 } from 'uuid'
import { DefaultPlanes } from 'wasm-lib/kcl/bindings/DefaultPlanes'
type WebSocketResponse = Models['WebSocketResponse_type']
const defaultPlanes: DefaultPlanes = {
xy: uuidv4(),
xz: uuidv4(),
yz: uuidv4(),
negXy: uuidv4(),
negXz: uuidv4(),
negYz: uuidv4(),
}
class MockEngineCommandManager {
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
constructor(mockParams: {
@ -37,6 +48,9 @@ class MockEngineCommandManager {
}
return Promise.resolve(JSON.stringify(response))
}
async wasmGetDefaultPlanes(): Promise<string> {
return JSON.stringify(defaultPlanes)
}
sendModelingCommandFromWasm(
id: string,
rangeStr: string,
@ -86,6 +100,9 @@ export async function executor(
height: 0,
executeCode: () => {},
theme: Themes.Dark,
makeDefaultPlanes: () => {
return new Promise((resolve) => resolve(defaultPlanes))
},
})
await engineCommandManager.waitForReady
engineCommandManager.startNewSession()