Expand description
DiagnosticManager: collects and publishes editor diagnostic markers.
§DiagnosticProvider (Environment)
Implements the DiagnosticManager trait, managing diagnostic information
from multiple sources (language servers, extensions, built-in providers). It
aggregates diagnostics by owner, file URI, and severity, and notifies the
UI when changes occur.
Diagnostics are stored in ApplicationState.Feature.Diagnostics as a
nested HashMap<owner, HashMap<uri, Vec<MarkerDataDTO>>>. Each owner (e.g.
"typescript", "rust-analyzer") manages its collection independently.
§Data model
Each MarkerDataDTO carries:
Severity- Error(8), Warning(4), Information(2), Hint(1)Message- human-readable descriptionStartLineNumber/StartColumn- 1-based (Cocoon’sNormaliseDiagnosticadds+1)EndLineNumber/EndColumn- 1-based, same conventionSource- diagnostic source string (e.g."tslint")Code- diagnostic code for quick-fix lookupModelVersionIdentifier- document version for change tracking
§Notification flow
- Language server or extension calls
SetDiagnostics(owner, entries). - Provider validates and stores in
ApplicationState.Feature.Diagnostics. - Provider identifies which URIs changed in this update.
- Provider emits
sky://diagnostics/changedwithowner,uris(string array for back-compat), andchangedURIs(per-URI marker payload for the SkyBridge marker bridge). - Sky receives the event and updates squiggles and the Problems panel.
§VS Code reference
vs/workbench/services/diagnostic/common/diagnosticCollection.tsvs/platform/diagnostics/common/diagnostics.tsvs/workbench/services/diagnostic/common/diagnosticService.ts