diff options
Diffstat (limited to 'cli/lsp/config.rs')
-rw-r--r-- | cli/lsp/config.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index b84f63edc..13bfdd75d 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -475,10 +475,8 @@ impl Config { .and_then(|p| p.maybe_node_modules_dir.as_ref()) } - pub fn maybe_deno_modules_dir_path(&self) -> Option<PathBuf> { - self - .maybe_config_file() - .and_then(|c| c.deno_modules_dir_path()) + pub fn maybe_vendor_dir_path(&self) -> Option<PathBuf> { + self.maybe_config_file().and_then(|c| c.vendor_dir_path()) } pub fn maybe_config_file(&self) -> Option<&ConfigFile> { @@ -816,7 +814,13 @@ fn resolve_node_modules_dir(config_file: &ConfigFile) -> Option<PathBuf> { // `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. - if config_file.node_modules_dir() != Some(true) { + let explicitly_disabled = config_file.node_modules_dir_flag() == Some(false); + if explicitly_disabled { + return None; + } + let enabled = config_file.node_modules_dir_flag() == Some(true) + || config_file.vendor_dir_flag() == Some(true); + if !enabled { return None; } if config_file.specifier.scheme() != "file" { |