-
Notifications
You must be signed in to change notification settings - Fork 147
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
Allow a client to configure typescript.tsdk (similar to VS Code) #64
Comments
I don't think it is a good idea to rely on own tsserver, as you mentioned it won't be forward-compatible. |
Well, do you think tsserver tries to be backwards compatible? I don't see what guarantee you have that it will be. It seems dangerous to me to just pick a tsserver from the environment as you do here, since it might be a newer version than what you have tested against. It seems safer to me to bundle a tsserver installation, and if you're doing that, then you might as well use the code in-process, instead of starting up a separate tsserver. A related issue is that if you support LSP's workspaceFolders feature, then you won't be able to use the tsserver from the project's node_modules, as you do here, since there will be multiple projects. See this issue. Anyways if you strongly oppose this suggestion, then feel free to close this issue. |
We are trying to align behavior with the VS Code extension. If they can assume that tsserver is backward compatible, I think we can too.
In VS Code a user is responsible to decide which tsserver should be used via workspace configurations. We can rely on LSP configurations capabilities as well. In the case, if a configuration is not provided we can either prompt a user via the custom request or a fall-back to the first tsserver. |
It's already possible with |
Have you considered using the Session class inside the LSP server process, instead of starting a separate tsserver process?
Pros:
Cons:
Session
. This also means that you should always use theSession
class that is bundled with thetypescript-language-server
installation, so you know for sure that it works well. The downside here is that you won't get automatic TypeScript upgrades if the user installs a newer global version of TypeScript. However, I think that behavior was a bit risky to begin with, since the contract of tsserver can also change.The text was updated successfully, but these errors were encountered: