Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Display Issues as Line Annotations In Source Editor #2015

Open
austincondiff opened this issue Apr 2, 2025 · 0 comments
Open

✨ Display Issues as Line Annotations In Source Editor #2015

austincondiff opened this issue Apr 2, 2025 · 0 comments
Labels
enhancement New feature or request extensions Issues related to the extension architecture in CodeEdit source editor triage needed

Comments

@austincondiff
Copy link
Collaborator

austincondiff commented Apr 2, 2025

Description

Use the newly created DiagnosticManager to provide file-specific diagnostics to the editor via LineAnnotations. This connection allows visual issues to appear directly in the source editor view below the affected lines.

Requirements

  • Convert DiagnosticIssue instances for the current file into LineAnnotation objects:
    struct LineAnnotation: Hashable, Identifiable {
        let id: UUID = UUID()
        let line: Int
        let column: Int
        let severity: DiagnosticIssue.Severity
        let text: String
    }
  • Extend DiagnosticManager with a helper:
    func annotations(for file: URL) -> Set<LineAnnotation>
  • In views where CodeEditSourceEditor is used:
    • Access the current file’s annotations using the manager
    • Pass them into the editor view via:
    annotations: Set<LineAnnotation>
  • The editor should already know how to render the annotations; this task is only concerned with wiring up the data source.

Additional Context

This connects the data produced by DiagnosticManager to line annotations introduced in CodeEditSourceEditor. This is a key step in surfacing diagnostics in a context-aware and developer-friendly way.

Later extensions might include showing annotations from multiple sources, updating annotations live from LSP, or supporting quick fixes from the underlying DiagnosticIssue.

Related Issues

@austincondiff austincondiff added the enhancement New feature or request label Apr 2, 2025
@github-actions github-actions bot added extensions Issues related to the extension architecture in CodeEdit source editor triage needed labels Apr 2, 2025
This was referenced Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request extensions Issues related to the extension architecture in CodeEdit source editor triage needed
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant