-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Enable vetur to work with VS Code on the Web #3248
Comments
Hi @octref! I was wondering if you might have any thoughts on this? We're happy to discuss if you have any questions or feedback. Thanks! |
Sorry to bother, I was hoping for some guidance, this question should be generic. Typescript's language service API with language service host is synchronous, so it is not possible to request vscode.workspace.fs from a language client asynchronously. Thanks in advance. 🙏 |
@johnsoncodehk good question. I do not know. |
This is being worked on. Today, the TypeScript web extension is more or less single file, e.g it doesn't support cross file features like find references. You correctly pointed out that tsserver is all sync and unfortunately that won't change. The current plan is to add logic to tsserver to add a virtual, synchronous file system which is updated and initialized by async messages. This is the corresponding issue: microsoft/TypeScript#47600. |
@jrieken If I understand correctly, I need to migrate from TS language service API to tsserver after tsserver supports virtual file system, or I have to implement virtual file system for TS language service host in LSP langauge server, and sync by language client's vscode.workspace.fs. Your comment is very helpful, thank you. 🙏 |
That's something I have a hard time answering. I don't know what approach you have taken right now |
@jrieken It's okay, I think I know how to do it now. :) But my concern is whether synchronizing workspace files to virtual file system of language server will cause performance issues, it seems not proven in tsserver yet and I have to try. |
I do something similar with vscode-anycode and it seems to work. What I do is this: build a glob pattern with all types of files that I support and search for them. I later open them one by one to digest them. There is some tricks and a tad of remote hub knowledge to not get blocked. We are thinking about better API for this but meanwhile that works |
@johnsoncodehk Does volar support it? |
@yoyo930021 yes it do, you can try by clone https://github.com/johnsoncodehk/volar and run But it was only working on the local dev browser, not working on github.dev, I have no idea how to debug this problem for github.dev. |
Debugger statements work on stackblitz cloudflow. Alternatively, eclipse-theia/theia#11797 (comment) or locally running a VSCode build in VSCode.dev mode could also help. |
vuejs/language-tools#2177 |
FYI, we've got TS + Vue (based on Volar) support for Web IDE by https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-web. And Astro support is coming soon. |
👋 I'm Isidor, a PM from the VS Code team, and we recently announced VS Code for the Web at https://vscode.dev/, which provides a free, zero-install Microsoft Visual Studio Code experience running entirely in your browser. You can learn more here.
We'd like to ensure vetur can run in the web, and we have a guide for enabling extensions for the web here. As a couple of highlights:
browser
propertyvscode.workspace.fs
I checked your extension and I see there are quite some node dependencies, so this transition to web might not be trivial. However it would be cool if you could at least contribute
grammars
for web, and usingwhen
clauses disable all other contributions which can not work on the web.We are also open to helping here. Let us know what you think. Thanks!
@aeschli @octref
The text was updated successfully, but these errors were encountered: