Web workers for the lsp servers (#2136)

* put the lsps into a web worker

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

* remove extraneous logs

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

* remove trash toml lib

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

* fixes

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

* less logs

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

* less logs

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

* fixups

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

* fixes for tests

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

* for playwright go back to the shitty lib

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

* fix

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-04-16 21:36:19 -07:00
committed by GitHub
parent 35c3103186
commit f0b9de2c1c
24 changed files with 412 additions and 167 deletions

View File

@ -27,7 +27,6 @@ import { posToOffset } from 'editor/plugins/lsp/util'
import { Program, ProgramMemory } from 'lang/wasm'
import { kclManager } from 'lib/singletons'
import type { UnitLength } from 'wasm-lib/kcl/bindings/UnitLength'
import { lspDiagnosticsToKclErrors } from 'lang/errors'
import { UpdateUnitsResponse } from 'wasm-lib/kcl/bindings/UpdateUnitsResponse'
import { UpdateCanExecuteResponse } from 'wasm-lib/kcl/bindings/UpdateCanExecuteResponse'
@ -403,7 +402,9 @@ export class LanguageServerPlugin implements PluginValue {
// The server has updated the AST, we should update elsewhere.
let updatedAst = notification.params as Program
console.log('[lsp]: Updated AST', updatedAst)
kclManager.ast = updatedAst
// Since we aren't using the lsp server for executing the program
// we don't update the ast here.
//kclManager.ast = updatedAst
// Update the folding ranges, since the AST has changed.
// This is a hack since codemirror does not support async foldService.