-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[typescript] re-use Theia launching program for TS LS #5324
Conversation
const command = 'node'; | ||
// Re-use the same tool used to launch Theia. e.g. for an Electron Theia packaging, | ||
// this will be "electron" executable that is bundled with the application. | ||
const command = process.argv[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.execPath
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Usually |
9d94972
to
de6a6c3
Compare
When we launch the TypeScript Language Server, we start it using the hardcoded executable "node". This works well in practice for most cases. However when we have a packaged Electron application, installed by a user, it could be that the environment does not have "node" immediately available in its path, or not a proper version, as needed by tsserver. So why not reuse the node executable that was used to launch the Theia application, to launch the LS? In the Electron case, it will be the Electron executable bundled with the packaging. Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
de6a6c3
to
e6d96c6
Compare
Can you elaborate on this? It looks like the spawning of the LS process is delegated to the BaseLanguageServerContribution, and there we use our internal RawProcess. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, as @marcdumais-work said, here we delegate the spawning to the base class.
@marcdumais-work I meant to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably execPath
will work for now too
As a JS/TS developer, I would feel extremely alien that Theia does not use the Node.js from the Can you please give some details about the use-case, @marcdumais-work? Thanks! So the correct logic should be the following:
Thoughts? Also, it was causing #5385. |
Hi @kittaakos ,
Agreed.
It's pretty simple: I thought that it would be better to have a working TypeScript LS vs not. I figured that Also, should In any case, your suggestion above sounds good and should work fine. |
Thanks for your detailed response, @marcdumais-work.
Pure kindness 👍, I like the idea.
Only this.
Follow up: #5408 |
When we launch the TypeScript Language Server, we start it using
the hardcoded executable "node". This works well in practice for
most cases. However when we have a packaged Electron application,
installed by a user, it could be that the environment does not have
"node" immediately available in its path, or not a proper version,
as needed by tsserver.
So why not reuse the node executable that was used to launch
the Theia application, to launch the LS? In the Electron case,
it will be the Electron executable bundled with the packaging.
Signed-off-by: Marc Dumais marc.dumais@ericsson.com