summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-03-13 13:50:23 -0400
committerGitHub <noreply@github.com>2023-03-13 18:50:23 +0100
commite8f22c076525c2fa55115349157f67085df287bf (patch)
treedf4105ee11bd69a4de1a138a26d6b44bca131ea1 /cli
parent4c2aeb250241fff5084cf31747ab53f4a0ecad79 (diff)
refactor(core): pass cwd explicitly to resolve_path (#18092)
Towards landing #15454
Diffstat (limited to 'cli')
-rw-r--r--cli/lsp/completions.rs3
-rw-r--r--cli/tests/integration/check_tests.rs3
2 files changed, 4 insertions, 2 deletions
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;
}
diff --git a/cli/tests/integration/check_tests.rs b/cli/tests/integration/check_tests.rs
index 7f9ff3ff5..7e6fbd836 100644
--- a/cli/tests/integration/check_tests.rs
+++ b/cli/tests/integration/check_tests.rs
@@ -196,7 +196,8 @@ fn typecheck_core() {
util::root_path()
.join("core/lib.deno_core.d.ts")
.to_str()
- .unwrap()
+ .unwrap(),
+ &std::env::current_dir().unwrap()
)
.unwrap()
),