Skip to content

Diagnostics #21

Description

@Logic-gate

Diagnostics should show problems that the editor can identify with reasonable confidence, without trying to imitate a full IDE.

  • Severity: Error, Warning, Information, or Hint
  • Clear description of the problem
  • File name and relative path
  • Line and column
  • Source: LSP, compiler, syntax rules, or Graptos
  • Diagnostic code, when provided (doubt)
  • Suggested fix, when available (doubt)

Example:

Error  src/editor.c:148:12
Expected ';' after statement
Source: clangd · Code: expected_semi

The diagnostics panel should support:

  • Grouping by file
  • Filtering by severity and source
  • Clicking an entry to jump to its location
  • Showing the affected line or a short code preview
  • Expanding related information
  • Applying a quick fix when one is safely available
  • Copying the message
  • Refreshing and clearing results
  • Displaying totals: 3 errors · 5 warnings · 2 hints

Inside the editor, diagnostics should appear as:

  • Error and warning underlines
  • Gutter indicators
  • A hover popover with the message and possible fix
  • File-level problem counts in the project tree
  • A status-bar summary for the current file or project

Diagnostic sources:

  • LSP diagnostics: Type errors, unresolved symbols, invalid arguments, unused variables, and similar language-aware issues.
  • Compiler or build diagnostics: Errors and warnings captured from make, compilers, linters, or project commands.
  • Syntax-definition diagnostics: Only simple, reliable checks declared by Graptos language definitions, such as unclosed brackets or quotes.
  • Editor diagnostics: Invalid encoding, inaccessible files, external file changes, conflicting edits, and failed saves.

Making it guess complex errors with regex rules is not something I want. If a diagnostic requires understanding types, scopes, or program structure, it should come from an LSP or a compiler.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions