Show diagnostic codes (#29296)

Closes #28135
Closes #4388
Closes #28136

Release Notes:

- diagnostics: Show the diagnostic code if available

---------

Co-authored-by: Neo Nie <nihgwu@live.com>
Co-authored-by: Zed AI <ai+claude-3.7@zed.dev>
This commit is contained in:
Conrad Irwin 2025-04-23 20:51:01 -06:00 committed by GitHub
parent 8836c6fb42
commit 9d10489607
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 517 additions and 327 deletions

View file

@ -208,6 +208,7 @@ pub struct Diagnostic {
pub source: Option<String>,
/// A machine-readable code that identifies this diagnostic.
pub code: Option<NumberOrString>,
pub code_description: Option<lsp::Url>,
/// Whether this diagnostic is a hint, warning, or error.
pub severity: DiagnosticSeverity,
/// The human-readable message associated with this diagnostic.
@ -4612,6 +4613,7 @@ impl Default for Diagnostic {
Self {
source: Default::default(),
code: None,
code_description: None,
severity: DiagnosticSeverity::ERROR,
message: Default::default(),
group_id: 0,