CodeEditApp / CodeEditApp/CodeEdit

✨ Display Issues as Line Annotations In Source Editor

Abierto
#2,015 0 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement extensions source editor
Lenguaje dominante
Swift
Estrellas
23k
Forks
1.2k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.