eslint: Allow configuring workingDirectory
(#22972)
This addresses this comment here: https://github.com/zed-industries/zed/issues/9648#issuecomment-2579246865 Release Notes: - Added ability to configure `workingDirectory` when using ESLint. Example: `{"lsp": {"eslint": {"settings": {"workingDirectory": {"mode": "auto" }}}}}`
This commit is contained in:
parent
05b48e8877
commit
3d80b21a91
2 changed files with 24 additions and 1 deletions
|
@ -379,6 +379,11 @@ impl LspAdapter for EsLintLspAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
let working_directory = eslint_user_settings
|
||||
.get("workingDirectory")
|
||||
.cloned()
|
||||
.unwrap_or_else(|| json!({"mode": "auto"}));
|
||||
|
||||
let problems = eslint_user_settings
|
||||
.get("problems")
|
||||
.cloned()
|
||||
|
@ -400,7 +405,7 @@ impl LspAdapter for EsLintLspAdapter {
|
|||
"rulesCustomizations": rules_customizations,
|
||||
"run": "onType",
|
||||
"nodePath": node_path,
|
||||
"workingDirectory": {"mode": "auto"},
|
||||
"workingDirectory": working_directory,
|
||||
"workspaceFolder": {
|
||||
"uri": workspace_root,
|
||||
"name": workspace_root.file_name()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue