From e8f22c076525c2fa55115349157f67085df287bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 13 Mar 2023 13:50:23 -0400 Subject: refactor(core): pass cwd explicitly to resolve_path (#18092) Towards landing #15454 --- cli/lsp/completions.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli/lsp') diff --git a/cli/lsp/completions.rs b/cli/lsp/completions.rs index 0c27500e2..3651fbeec 100644 --- a/cli/lsp/completions.rs +++ b/cli/lsp/completions.rs @@ -368,6 +368,7 @@ fn get_local_completions( } else { false }; + let cwd = std::env::current_dir().ok()?; if current_path.is_dir() { let items = std::fs::read_dir(current_path).ok()?; Some( @@ -375,7 +376,7 @@ fn get_local_completions( .filter_map(|de| { let de = de.ok()?; let label = de.path().file_name()?.to_string_lossy().to_string(); - let entry_specifier = resolve_path(de.path().to_str()?).ok()?; + let entry_specifier = resolve_path(de.path().to_str()?, &cwd).ok()?; if &entry_specifier == base { return None; } -- cgit v1.2.3