-
Notifications
You must be signed in to change notification settings - Fork 497
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
vscode web extension #1300
vscode web extension #1300
Commits on May 31, 2022
-
WIP: make the vscode extension work as web extension
This refactor the LSP to be possible to compile for wasm. When using wasm we can't use the lsp-server crate because that one use the stdin/stdout to communicate. Instead, we need will do the communication in TypeScript using the vscode language server protocol library, and serialize the types to wasm. Fortunately that's easy because the lsp-types crate contains all the serialized types. This also "duplicate" the extension as a web extension that do not use process to start the LSP, but use a web worker. Some of the extension code could be refactored to avoid some duplication (like the status bar handling and such). And add a "browser" entry point in the package.json Finally, add a browserServerMain.ts entry point for our worker, it will try to load the wasm code. Currently this doesn't wirk: the browserServerMain.ts can't load the wasm. Also todo is to write the code so that the wasm code can send the response and notifications. To debug, I type these commands in editor/vscode directory npm run compile-web code --extensionDevelopmentKind=web --extensionDevelopmentPath=$PWD ../..
Configuration menu - View commit details
-
Copy full SHA for 3cfa22b - Browse repository at this point
Copy the full SHA 3cfa22bView commit details -
WIP: bundle the lsp wasm inside browserServerMain.js
* Use wasm-pack's web mode to create a .wasm file and an ESM module for the glue code * Import the .wasm file directly in browserServerMain.ts * And process it all with esbuild, which succeeds in seeing the .wasm import in browserServerMain.ts and then bundles it inline.
Configuration menu - View commit details
-
Copy full SHA for 2f7a583 - Browse repository at this point
Copy the full SHA 2f7a583View commit details -
LSP: Some progress on the vscode browser extension
we need to use commonjs for the extension If we start the client before the server has loaded the wasm, we don't listen yet to the init message, so make sure not to start the client before we sent the "OK" message back. But it's still not working, the wasm code is called, but the parameter are not properly passed
Configuration menu - View commit details
-
Copy full SHA for c42c9f3 - Browse repository at this point
Copy the full SHA c42c9f3View commit details -
vscode: Some progress on the web extension
Now it calls in the wasm properly. But i get borrowmut error because the wasm re-enter from send_notification into the request
Configuration menu - View commit details
-
Copy full SHA for ecddb52 - Browse repository at this point
Copy the full SHA ecddb52View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1832c5 - Browse repository at this point
Copy the full SHA e1832c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7cfc911 - Browse repository at this point
Copy the full SHA 7cfc911View commit details -
Configuration menu - View commit details
-
Copy full SHA for 47a1132 - Browse repository at this point
Copy the full SHA 47a1132View commit details -
Prospective fix for vsce package build
Build regular and web extension in one go
Configuration menu - View commit details
-
Copy full SHA for 7717d82 - Browse repository at this point
Copy the full SHA 7717d82View commit details -
Configuration menu - View commit details
-
Copy full SHA for c59d5fa - Browse repository at this point
Copy the full SHA c59d5faView commit details