diff options
Diffstat (limited to 'cli/lsp/sources.rs')
-rw-r--r-- | cli/lsp/sources.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/cli/lsp/sources.rs b/cli/lsp/sources.rs index 0cd7b5876..445c49824 100644 --- a/cli/lsp/sources.rs +++ b/cli/lsp/sources.rs @@ -163,14 +163,6 @@ impl Sources { self.0.lock().unwrap().contains_key(specifier) } - /// Provides the length of the source content, calculated in a way that should - /// match the behavior of JavaScript, where strings are stored effectively as - /// `&[u16]` and when counting "chars" we need to represent the string as a - /// UTF-16 string in Rust. - pub fn get_length_utf16(&self, specifier: &ModuleSpecifier) -> Option<usize> { - self.0.lock().unwrap().get_length_utf16(specifier) - } - pub fn get_line_index( &self, specifier: &ModuleSpecifier, @@ -248,13 +240,6 @@ impl Inner { false } - fn get_length_utf16(&mut self, specifier: &ModuleSpecifier) -> Option<usize> { - let specifier = - resolve_specifier(specifier, &mut self.redirects, &self.http_cache)?; - let metadata = self.get_metadata(&specifier)?; - Some(metadata.length_utf16) - } - fn get_line_index( &mut self, specifier: &ModuleSpecifier, @@ -472,19 +457,6 @@ mod tests { } #[test] - fn test_sources_get_length_utf16() { - let (sources, _) = setup(); - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let tests = c.join("tests"); - let specifier = - resolve_path(&tests.join("001_hello.js").to_string_lossy()).unwrap(); - let actual = sources.get_length_utf16(&specifier); - assert!(actual.is_some()); - let actual = actual.unwrap(); - assert_eq!(actual, 28); - } - - #[test] fn test_resolve_dependency_types() { let (sources, location) = setup(); let cache = HttpCache::new(&location); |