ek9_query_diagnostics

Answers first: diagnosticCount, errorCount, warningCount, errorCodes[] and sites[] ('file.ek9:LINE CODE message'), then diagnostics[] in full, byCode and byFile - the Problems View of the last compile.

Category: Enquiry · Compare: Problems View (IntelliJ / VSCode)

When to use it

What is broken right now - every error and warning recorded by the last compile - one call, no arguments (fileFilter / severity / errorCode narrow it).

When not to use it

Details

Each diagnostic carries file (workspace-relative), line, column, severity, errorCode ('SYNTAX' for a parse error, which has no E-code), message (one line, no colour codes, no embedded explanation), typeOfError and classificationDescription, plus a richExplanation when the code has one; quickFixes and offendingSymbol are on by default while there are 20 diagnostics or fewer (pass the include* flag to force either way), fuzzySuggestions and tokenLength are opt-in, and codes with a mapped fix tool gain a remediation[] list. severity is all|errors|warnings, fileFilter is a path substring, and a filter matching nothing yields diagnostics:[] with zero counts — success, not an error. byCode and byFile count diagnostics (errors+warnings combined); no workspace returns {diagnostics:'unavailable', message:...}.

Arguments

ArgumentTypeRequiredWhat it is
errorCodestringOptional specific error code filter (e.g., 'E05030')
fileFilterstringOptional: keep only diagnostics whose file path contains this text
includeFuzzySuggestionsbooleanInclude 'Did you mean?' fuzzy match suggestions per diagnostic. Default false.
includeOffendingSymbolbooleanInclude the likely-offending symbol name per diagnostic. Default: on while there are 20 diagnostics or fewer.
includeQuickFixesbooleanInclude actionable replacement suggestions extracted from parse errors and fuzzy matches. Default: on while there are 20 diagnostics or fewer.
includeTokenSpanbooleanInclude tokenLength for highlight rendering. Default false.
severitystring: all | errors | warningsSeverity filter: 'all' (default), 'errors', or 'warnings'

Recorded calls

Real calls, recorded against small projects and checked on every build - a changed answer fails it.

Diagnostics shape

Request

{ }

Response

{
  "byCode" : { },
  "byFile" : [ ],
  "diagnosticCount" : 0,
  "diagnostics" : [ ],
  "errorCodes" : [ ],
  "errorCount" : 0,
  "meta" : {
    "serverMs" : "<timing>"
  },
  "sites" : [ ],
  "warningCount" : 0
}

See also