-
Notifications
You must be signed in to change notification settings - Fork 245
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
Need to be able to run the standalone typespec version from the IDE #5902
Comments
@RodgeFu FYI, need some cooradination on how to solve this for IDE |
May I have more background abuot the issue? Do you mean we will have standalone typespec which can work without node installed on the machine? thx |
Yes, except we already have it, it is just not documented and advertised yet as there is some uncertainty to resolve with the package manager first(tsp install). |
I see. In this case, I would prefer the option to add |
Thats a great point, I'll work on adding that to the CLI |
Can we also add |
IDE will need to as the tsp cli is not necessary installed globally in the node mode |
Do we have a way to check whether the standalone cli is installed on the machine or not so that IDE can check? |
As part of the |
I mean how IDE can know that a standalone CLI has been installed on the machine so that it will try to start server by |
It will be installed in the path so you can run which tsp and/or tsp --version |
I see. But starting a command to do the check will make it slower to start our extension which I feel is already a little slow now. Now the server resolving logic are using |
The standalone cli will not contain the compiler logic because running the global compiler makes 0 sense(same as running the global tsp-server, past just doing basic highlighting) The goal of the global cli is to provide access to the If you have a better idea to detect, open to new idea. |
Looked at the PR and it seems we are having different understanding in the
So in my option, the btw, is there any doc about how to use the standalone typespec? do i just need to run the install.ps1 and everything should work? |
thats not true, the standlaone cli would have installed it, it also comes with It's just javascript code how it was installed(which package manager) is irrevent to the typespec engine, it MUST just be installed locally to work correctly. Global install of the tsp server or the compiler is broken and should not be used(we have an issue to make it an error if you try to build from the global install without haveing it installed so it doesn't fail later with confusing errors)
yes(in pr #5907) and yes |
what do you mean by "Global install of the tsp server or the compiler is broken and should not be used"? When will it happen? it will break the "Create TypeSpec Project" scenario in vscode when user has nothing installed on the machine and depends on global compiler to do the init... , people dont have local tsp-server in that case |
Sorry I mean just the compile part the rest make sense to be able to run globally(and that what the standalone cli purpose is as well) i.e. running |
Thanks for the clarification. So try to summarize what I get:
So from IDE, when loading lsp, we will
For "Create TypeSpec Project": |
plan looks good, just another clarification on teh assumptions
where tsp is the standalone cli or the global install will keep working as long as you run this in a folder that does have the compiler installed(First thing it does when you start the cli is lookup for the local compiler/cli and run that one instead) |
using ```tsp --server``` to start local LSP if standalone tsp cli is found on the machine. fixes #5902
This is a bit of an issue with using the standalone exe right now, the language server still needs to run from node.
The simplest options is probably to try to use the node version provided by vscode as fallback. This used to not work as it was too old and didn't support ESM modules but it is probably updated now.
The alternative is to add a flag to the standalone cli like
--server
that load the local LSP code.The text was updated successfully, but these errors were encountered: