languages: Fix ESLint diagnostics not getting shown (#33814)

Closes #33442

Release Notes:

- Resolved an issue where the ESLint language server returned an empty
string for the CodeDescription.href field in diagnostics, leading to
missing diagnostics in editor.
This commit is contained in:
Umesh Yadav 2025-07-14 16:18:56 +05:30 committed by GitHub
parent e4effa5e01
commit cf1ce1beed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 9 deletions

View file

@ -3822,7 +3822,7 @@ impl GetDocumentDiagnostics {
code,
code_description: match diagnostic.code_description {
Some(code_description) => Some(CodeDescription {
href: lsp::Url::parse(&code_description).unwrap(),
href: Some(lsp::Url::parse(&code_description).unwrap()),
}),
None => None,
},
@ -3898,7 +3898,7 @@ impl GetDocumentDiagnostics {
tags,
code_description: diagnostic
.code_description
.map(|desc| desc.href.to_string()),
.and_then(|desc| desc.href.map(|url| url.to_string())),
message: diagnostic.message,
data: diagnostic.data.as_ref().map(|data| data.to_string()),
})

View file

@ -9130,7 +9130,13 @@ impl LspStore {
}
};
let lsp::ProgressParamsValue::WorkDone(progress) = progress.value;
let progress = match progress.value {
lsp::ProgressParamsValue::WorkDone(progress) => progress,
lsp::ProgressParamsValue::WorkspaceDiagnostic(_) => {
return;
}
};
let language_server_status =
if let Some(status) = self.language_server_statuses.get_mut(&language_server_id) {
status
@ -10512,7 +10518,7 @@ impl LspStore {
code_description: diagnostic
.code_description
.as_ref()
.map(|d| d.href.clone()),
.and_then(|d| d.href.clone()),
severity: diagnostic.severity.unwrap_or(DiagnosticSeverity::ERROR),
markdown: adapter.as_ref().and_then(|adapter| {
adapter.diagnostic_message_to_markdown(&diagnostic.message)
@ -10539,7 +10545,7 @@ impl LspStore {
code_description: diagnostic
.code_description
.as_ref()
.map(|c| c.href.clone()),
.and_then(|d| d.href.clone()),
severity: DiagnosticSeverity::INFORMATION,
markdown: adapter.as_ref().and_then(|adapter| {
adapter.diagnostic_message_to_markdown(&info.message)