0
0
Fork 0
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:
Nayeem Rahman 2023-09-24 08:18:51 +01:00 committed by GitHub
parent b5ba5f157e
commit d955d66a3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 4 deletions

View file

@ -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,

View file

@ -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]
}
],