golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.89k stars 752 forks source link

Support VSCode Web with Webassembly #3467

Open Zxilly opened 3 months ago

Zxilly commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently, the Go plugin is not available in a VSCode web environment like github.dev. It would be great if this environment could be supported by running lsp through wasm.

Describe the solution you'd like

Add declaration of support for web mode, add pre-compiled lsp wasm binary and release corresponding plugin version.

Describe alternatives you've considered

There are a few services that are implemented by adapting VSCode's remote connections, but obviously they all rely on a backend. With wasm it is possible to run without a server.

hyangah commented 3 months ago

@Zxilly I wish we could too! But that requires to rewrite the go command (go build, go list, go env, ...) to work in web environment because gopls and the extension heavily depend on it. The current gopls and the extension also rely on file operations (persistent file caching, etc) in various places, which means this requires rearchitect/rewrite of the extension/gopls.

We currently do not have bandwidth for such heavy lifting.

Zxilly commented 3 months ago

We can use wasi target with some polyfill. The main change should be that we should modify the way we create process calls.