CodeEditApp / CodeEditApp/CodeEdit

✨ Display Issues as Line Annotations In Source Editor

Offen
#2,015 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement extensions source editor
Vorherrschende Sprache
Swift
Sterne
23k
Forks
1.2k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Description

Use the [newly created](https://github.com/CodeEditApp/CodeEdit/issues/2014) `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:
```swift
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:
```swift
func annotations(for file: URL) -> Set
```
- In views where `CodeEditSourceEditor` is used:
- Access the current file’s annotations using the manager
- Pass them into the editor view via:
```swift
annotations: Set
```
- 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](https://github.com/CodeEditApp/CodeEditSourceEditor/issues/297). 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

- #2014 (pre-requisite)
- https://github.com/CodeEditApp/CodeEditSourceEditor/issues/297 (pre-requisite)
- #354

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, DiagnosticManager, DiagnosticIssue und die Ansichten zu finden, die CodeEditSourceEditor verwenden. Verfolge, wie die aktuelle Datei identifiziert wird, und binde ihre Diagnosen in die an den Editor übergebenen LineAnnotation-Werte ein; fertig ist die Aufgabe, wenn dateispezifische Annotationen unterhalb der betroffenen Zeilen mit der vorhandenen Editor-Darstellung erscheinen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
swift
Bereich
developer-experience
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.