From 7070b8ed50f13d95d926b19ed7d7ce9fc0d6d4f3 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 15 Mar 2023 10:34:23 -0400 Subject: fix(lsp): avoid calling client while holding lock (#18197) --- cli/util/path.rs | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'cli/util/path.rs') diff --git a/cli/util/path.rs b/cli/util/path.rs index d073d80bd..69c52bf6e 100644 --- a/cli/util/path.rs +++ b/cli/util/path.rs @@ -69,18 +69,6 @@ pub fn specifier_to_file_path( } } -/// Ensures a specifier that will definitely be a directory has a trailing slash. -pub fn ensure_directory_specifier( - mut specifier: ModuleSpecifier, -) -> ModuleSpecifier { - let path = specifier.path(); - if !path.ends_with('/') { - let new_path = format!("{path}/"); - specifier.set_path(&new_path); - } - specifier -} - /// Gets the parent of this module specifier. pub fn specifier_parent(specifier: &ModuleSpecifier) -> ModuleSpecifier { let mut specifier = specifier.clone(); @@ -264,21 +252,6 @@ mod test { } } - #[test] - fn test_ensure_directory_specifier() { - run_test("file:///", "file:///"); - run_test("file:///test", "file:///test/"); - run_test("file:///test/", "file:///test/"); - run_test("file:///test/other", "file:///test/other/"); - run_test("file:///test/other/", "file:///test/other/"); - - fn run_test(specifier: &str, expected: &str) { - let result = - ensure_directory_specifier(ModuleSpecifier::parse(specifier).unwrap()); - assert_eq!(result.to_string(), expected); - } - } - #[test] fn test_specifier_parent() { run_test("file:///", "file:///"); -- cgit v1.2.3