CodeEditApp / CodeEditApp/CodeEdit
✨ Display Issues as Line Annotations In Source Editor
- 主要語言
- Swift
- 星號
- 23k
- 分支
- 1.2k
- PR 合併指標
- 30 天內沒有已合併 PR
描述
### 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
貢獻指南
研究方向
首先定位 DiagnosticManager、DiagnosticIssue 以及使用 CodeEditSourceEditor 的檢視。追蹤目前檔案的識別方式,並將其診斷資訊接入傳遞給編輯器的 LineAnnotation 值;完成的標準是使用現有的編輯器呈現,在受影響的行下方顯示檔案專屬的註解。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- swift
- 領域
- developer-experience
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100