You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A user-defined language server without a working directory doesn't get the environment of the project's directory #1886
A user-defined language server has no working directory unless the user sets one. Its process then starts in the IDE's working directory, and with directory environments (#1660, #1693) it gets no directory's environment, and its command is looked up in the IDE's PATH. So a project whose mise.toml or .envrc selects the tools, such as its version of node, doesn't get them for its language servers unless each server's working directory is set.
How it happens
UserDefinedLanguageServerDefinition.workingDir is null unless it is configured, and createConnectionProvider passes it as it is. The platform customizes the environment of a process for its working directory; without one, a customizer such as mise's has no directory to take the environment from.
Possible direction
Default the working directory to the project's directory ($PROJECT_DIR$), for new definitions or whenever it is empty. A server whose command or arguments rely on the IDE's working directory today, such as a relative path, would then resolve it against the project's directory, so this needs a decision on compatibility, or a default only for new definitions. Until then, #1693 documents that the working directory has to be set.
$PROJECT_DIR$ for new definitions only, from the dialog and the templates. Existing definitions keep what they have.
The project's directory whenever none is set, for existing definitions too. A server whose command relies on the IDE's working directory, such as a relative path, would resolve it against the project's directory instead. The IDE's working directory is rarely meaningful (/ on macOS, the home or bin directory elsewhere), so I doubt anything relies on it, but it is a change for existing users.
With #1853, an instance without a working directory runs in its root, so with 3, the default would have to stay the instance root for an instance and be the project's directory otherwise.
I'd go with 3, with that exception for instances, or with 2 if you'd rather not change existing definitions.
@angelozerr, a ping on this before 0.30.0: most user-defined language servers have no working directory, so without a default they don't get the directory environment of #1693, which is new in this release. Which of the three would you like? Once you pick one, I can put up the PR the same day. #1885 asks the same question for a DAP configuration created from a file.
Going with option 3: a server without a working directory now starts in the project's directory (an instance in its root), and gets its environment. The empty field shows "Project directory". See #2233.
Activity
lagergren commentedon Nov 7, 2026
@angelozerr before I put up a PR for this, which default working directory do you want for a user-defined language server?
$PROJECT_DIR$for new definitions only, from the dialog and the templates. Existing definitions keep what they have./on macOS, the home orbindirectory elsewhere), so I doubt anything relies on it, but it is a change for existing users.With #1853, an instance without a working directory runs in its root, so with 3, the default would have to stay the instance root for an instance and be the project's directory otherwise.
I'd go with 3, with that exception for instances, or with 2 if you'd rather not change existing definitions.
lagergren commentedon Nov 9, 2026
@angelozerr, a ping on this before 0.30.0: most user-defined language servers have no working directory, so without a default they don't get the directory environment of #1693, which is new in this release. Which of the three would you like? Once you pick one, I can put up the PR the same day. #1885 asks the same question for a DAP configuration created from a file.
lagergren commentedon Nov 25, 2026
Going with option 3: a server without a working directory now starts in the project's directory (an instance in its root), and gets its environment. The empty field shows "Project directory". See #2233.
fix: a user-defined language server without a working directory start…