✨ Display Issues as Line Annotations In Source Editor

Aperta
#2,015 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
swift

Direzione di ricerca

Inizia individuando DiagnosticManager, DiagnosticIssue e le viste che usano CodeEditSourceEditor. Traccia il modo in cui viene identificato il file corrente e collega i relativi diagnostici ai valori LineAnnotation passati all'editor; il lavoro è completato quando le annotazioni specifiche del file compaiono sotto le righe interessate usando il rendering esistente dell'editor.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement extensions source editor
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
Lingua principale
Swift
Stelle
23k
Fork
1.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CodeEditApp/CodeEdit

Tutte le issue di CodeEditApp/CodeEdit

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.