diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-09-11 11:11:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-11 11:11:39 +0100 |
commit | ad30703e8e6bcf0fb87b5bc4ad1b49d040e54c77 (patch) | |
tree | d12ffffadb03aac3c93f0fd13499abccb5707160 /cli/lsp/diagnostics.rs | |
parent | 8bdd364dd568f93097ecee41e66c74d16d75c015 (diff) |
fix(lsp): encode url parts before parsing as uri (#25509)
Diffstat (limited to 'cli/lsp/diagnostics.rs')
-rw-r--r-- | cli/lsp/diagnostics.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index 9d9a0ae45..1aebaf56f 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -12,6 +12,7 @@ use super::language_server::StateSnapshot; use super::performance::Performance; use super::tsc; use super::tsc::TsServer; +use super::urls::uri_parse_unencoded; use super::urls::url_to_uri; use super::urls::LspUrlMap; @@ -53,11 +54,9 @@ use deno_semver::package::PackageReq; use import_map::ImportMap; use import_map::ImportMapError; use log::error; -use lsp_types::Uri; use std::collections::HashMap; use std::collections::HashSet; use std::path::PathBuf; -use std::str::FromStr; use std::sync::atomic::AtomicUsize; use std::sync::Arc; use std::thread; @@ -738,7 +737,7 @@ fn to_lsp_related_information( if let (Some(file_name), Some(start), Some(end)) = (&ri.file_name, &ri.start, &ri.end) { - let uri = Uri::from_str(file_name).unwrap(); + let uri = uri_parse_unencoded(file_name).unwrap(); Some(lsp::DiagnosticRelatedInformation { location: lsp::Location { uri, |