Let the server determine cwd on its own - #1977
Conversation
|
This is for security reasons not so easy. I need to think about the consequences of this and if trusted workspace allow this now. Using the extension host's CWD ensures that no unwanted binary code is loaded. |
|
What we can always do is to have a opt-in setting for this which we should consider anyways since the change might be a surprise for others. |
|
Dirk Bäumer (@dbaeumer) opt-in is ok for me. My goal is very much for the process to run in the context of my workspace. |
|
Dirk Bäumer (@dbaeumer) do you have any guidance on how to implement this? I'd still love to see this happen but my understanding of the codebase is pretty limited. |
|
Here are some pointers:
|
|
Peter Wagenet (@wagenet) this does not solve #1727. Can you unlink it? |
|
Peter Wagenet (@wagenet) are you still working on the PR? |
|
Dirk Bäumer (@dbaeumer) apologies for the silence here. I am not actively working on this. |
If
cwdis not specified in theServerOptionsthen the Language Server will use its own logic to determine the correct working directory, including the root of the workspace. This then allowseslint.runtimeto be set to"node"which will be run in the root of the workspace. For projects using tools like Volta, this leads to it using the Volta-specified node version as expected.