diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-07-20 14:05:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-20 14:05:52 -0400 |
commit | 235fdc243faa6d0fc008dc7fa482c29e511c2fa0 (patch) | |
tree | c01444f783abe922b98da1b416e15fba8409732d /cli/lsp/config.rs | |
parent | bf775e3306faeb2a18525ba38f9c3e60e1e5ed16 (diff) |
fix(lsp): auto-discover deno.json in more cases (#19894)
We weren't auto-discovering the deno.json in two cases:
1. A project that didn't have a deno.json and just added one.
2. After a syntax error in the deno.json.
This now rediscovers it in both these cases.
Closes https://github.com/denoland/vscode_deno/issues/867
Diffstat (limited to 'cli/lsp/config.rs')
-rw-r--r-- | cli/lsp/config.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index 298c86a55..03464d1f8 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -773,7 +773,12 @@ fn resolve_lockfile_from_path( lockfile_path: PathBuf, ) -> Option<Arc<Mutex<Lockfile>>> { match Lockfile::new(lockfile_path, false) { - Ok(value) => Some(Arc::new(Mutex::new(value))), + Ok(value) => { + if let Ok(specifier) = ModuleSpecifier::from_file_path(&value.filename) { + lsp_log!(" Resolved lock file: \"{}\"", specifier); + } + Some(Arc::new(Mutex::new(value))) + } Err(err) => { lsp_warn!("Error loading lockfile: {:#}", err); None |