diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-08-24 01:21:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-24 01:21:21 +0100 |
commit | 2ab4afc6b8e90f1315e0727c9b9c714c3667dc45 (patch) | |
tree | 05f07ba22d5d4a5f5120ab988320ad88ea20d542 /cli/lsp/analysis.rs | |
parent | bbd3a7e637b0223647405adf76b23092ab957157 (diff) |
refactor(lsp): changes for lsp_types 0.97.0 (#25169)
Diffstat (limited to 'cli/lsp/analysis.rs')
-rw-r--r-- | cli/lsp/analysis.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs index 9f2c7ffc8..bea626841 100644 --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -6,6 +6,7 @@ use super::documents::Documents; use super::language_server; use super::resolver::LspResolver; use super::tsc; +use super::urls::url_to_uri; use crate::args::jsr_url; use crate::tools::lint::CliLinter; @@ -750,10 +751,11 @@ impl CodeActionCollection { .as_ref() .and_then(|d| serde_json::from_value::<Vec<DataQuickFix>>(d.clone()).ok()) { + let uri = url_to_uri(specifier); for quick_fix in data_quick_fixes { let mut changes = HashMap::new(); changes.insert( - specifier.clone(), + uri.clone(), quick_fix .changes .into_iter() @@ -795,6 +797,7 @@ impl CodeActionCollection { maybe_text_info: Option<&SourceTextInfo>, maybe_parsed_source: Option<&deno_ast::ParsedSource>, ) -> Result<(), AnyError> { + let uri = url_to_uri(specifier); let code = diagnostic .code .as_ref() @@ -811,7 +814,7 @@ impl CodeActionCollection { let mut changes = HashMap::new(); changes.insert( - specifier.clone(), + uri.clone(), vec![lsp::TextEdit { new_text: prepend_whitespace( format!("// deno-lint-ignore {code}\n"), @@ -892,7 +895,7 @@ impl CodeActionCollection { } let mut changes = HashMap::new(); - changes.insert(specifier.clone(), vec![lsp::TextEdit { new_text, range }]); + changes.insert(uri.clone(), vec![lsp::TextEdit { new_text, range }]); let ignore_file_action = lsp::CodeAction { title: format!("Disable {code} for the entire file"), kind: Some(lsp::CodeActionKind::QUICKFIX), @@ -913,7 +916,7 @@ impl CodeActionCollection { let mut changes = HashMap::new(); changes.insert( - specifier.clone(), + uri, vec![lsp::TextEdit { new_text: "// deno-lint-ignore-file\n".to_string(), range: lsp::Range { |