diff options
Diffstat (limited to 'cli/lsp')
| -rw-r--r-- | cli/lsp/config.rs | 30 | ||||
| -rw-r--r-- | cli/lsp/language_server.rs | 5 |
2 files changed, 25 insertions, 10 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index ec2690506..4ac9b4d0a 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -1398,7 +1398,12 @@ impl ConfigData { || ( *DENO_FUTURE && member_dir.workspace.package_jsons().next().is_some() - && member_dir.workspace.node_modules_dir().is_none() + && member_dir + .workspace + .node_modules_mode() + .ok() + .flatten() + .is_none() // TODO(2.0): remove ); if byonm { @@ -1874,13 +1879,28 @@ fn resolve_node_modules_dir( // `nodeModulesDir: true` setting in the deno.json file. This is to // reduce the chance of modifying someone's node_modules directory // without them having asked us to do so. - let explicitly_disabled = workspace.node_modules_dir() == Some(false); + let node_modules_mode = workspace.node_modules_mode().ok().flatten(); + let node_modules_dir_option = workspace.node_modules_dir(); + let explicitly_disabled = if *DENO_FUTURE { + node_modules_mode == Some(NodeModulesMode::GlobalAuto) + } else { + node_modules_dir_option == Some(false) + }; if explicitly_disabled { return None; } - let enabled = byonm - || workspace.node_modules_dir() == Some(true) - || workspace.vendor_dir_path().is_some(); + let enabled = if *DENO_FUTURE { + byonm + || node_modules_mode + .map(|m| m.uses_node_modules_dir()) + .unwrap_or(false) + || workspace.vendor_dir_path().is_some() + } else { + byonm + || workspace.node_modules_dir() == Some(true) + || workspace.vendor_dir_path().is_some() + }; + if !enabled { return None; } diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 37e1aa0be..05c54dfc6 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -3611,11 +3611,6 @@ impl Inner { .as_ref() .map(|url| url.to_string()) }), - node_modules_dir: Some( - config_data - .and_then(|d| d.node_modules_dir.as_ref()) - .is_some(), - ), // bit of a hack to force the lsp to cache the @types/node package type_check_mode: crate::args::TypeCheckMode::Local, ..Default::default() |
