CodeEditApp / CodeEditApp/CodeEdit

✨ Display Issues as Line Annotations In Source Editor

Đang mở
#2,015 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement extensions source editor
Ngôn ngữ chính
Swift
Star
23k
Fork
1.2k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xác định DiagnosticManager, DiagnosticIssue và các view sử dụng CodeEditSourceEditor. Theo dõi cách tệp hiện tại được xác định và kết nối các chẩn đoán của tệp đó vào các giá trị LineAnnotation được truyền cho trình chỉnh sửa; hoàn tất khi các chú thích dành riêng cho tệp xuất hiện bên dưới các dòng bị ảnh hưởng bằng cách sử dụng cơ chế hiển thị hiện có của trình chỉnh sửa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
swift
Lĩnh vực
developer-experience
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.