Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Visual Studio Code for the Web #223

Open
dnut opened this issue Jul 31, 2024 · 1 comment
Open

Support Visual Studio Code for the Web #223

dnut opened this issue Jul 31, 2024 · 1 comment

Comments

@dnut
Copy link

dnut commented Jul 31, 2024

VS code runs in the web browser at github.dev. To try this, go to a github repository and press the period key ., or replace ".com" in the repo url with ".dev". It is possible to install extensions in the web version. For example, GitLens is fully supported. The Python extension can also be used in the browser, but with limited functionality. On installation, you'll see this message:

'Python' has limited functionality in Visual Studio Code for the Web.
Only Partial IntelliSense supported.
Contains extensions which are not supported.

The Zig extension is not compatible. If you try to install it, you'll see "The 'Zig Language' extension is not available in Visual Studio Code for the Web. Learn Why"

I understand it might be very complex to get the full range of features supported in the browser. For example, maybe it's a huge amount of work to get ZLS running in the browser.

For this ticket, I'm only suggesting an mvp to get it installable in the browser with at least one useful feature working. For example, syntax highlighting would be great. Introducing that feature alone is enough to make github.dev superior to github.com for reviewing pull requests.

@Techatrix
Copy link
Collaborator

In theory is should be doable to make vscode-zig a web extension if you are only interested in syntax highlighting. The tricky part is getting Zig or ZLS in the browser. Without them, we would be missing diagnostics, formatting and any ZLS features.

The good news is that ZLS can be compiled to wasm for a long time now. There are wasm32-wasi binaries available since ZLS 0.11.0. VS Code has made a recent blog post about running an LSP using webassembly here. There has been an attempt to run the SuperHtml LSP using wasm according to the blog post but some issues have been encountered. So this currently blocking ZLS from running as a web extension.

The Zig compiler itself can't be compiled to wasm out of the box. It requires some small tweaking but otherwise works. This can be used to provide formatting and diagnostics.

You may be interested in checking out Zig Playground which showcases Zig and ZLS running inside the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants