mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
fix(lsp): show related information for tsc diagnostics (#20654)
This commit is contained in:
parent
b5ba5f157e
commit
d955d66a3f
2 changed files with 21 additions and 4 deletions
|
@ -646,10 +646,10 @@ fn to_lsp_related_information(
|
|||
related
|
||||
.iter()
|
||||
.filter_map(|ri| {
|
||||
if let (Some(source), Some(start), Some(end)) =
|
||||
(&ri.source, &ri.start, &ri.end)
|
||||
if let (Some(file_name), Some(start), Some(end)) =
|
||||
(&ri.file_name, &ri.start, &ri.end)
|
||||
{
|
||||
let uri = lsp::Url::parse(source).unwrap();
|
||||
let uri = lsp::Url::parse(file_name).unwrap();
|
||||
Some(lsp::DiagnosticRelatedInformation {
|
||||
location: lsp::Location {
|
||||
uri,
|
||||
|
|
|
@ -7351,7 +7351,24 @@ fn lsp_diagnostics_deprecated() {
|
|||
"code": 6385,
|
||||
"source": "deno-ts",
|
||||
"message": "'a' is deprecated.",
|
||||
"relatedInformation": [],
|
||||
"relatedInformation": [
|
||||
{
|
||||
"location": {
|
||||
"uri": "file:///a/file.ts",
|
||||
"range": {
|
||||
"start": {
|
||||
"line": 0,
|
||||
"character": 4,
|
||||
},
|
||||
"end": {
|
||||
"line": 0,
|
||||
"character": 16,
|
||||
},
|
||||
},
|
||||
},
|
||||
"message": "The declaration was marked as deprecated here.",
|
||||
},
|
||||
],
|
||||
"tags": [2]
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Add table
Reference in a new issue