✨ Line Annotations
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu từ điểm vào CodeEditSourceEditor và xem xét mô hình LineAnnotation được đề xuất cùng khái niệm AnnotationAggregatedDropdownView. So sánh các yêu cầu với issue liên quan #354, sau đó xác định tiêu chí hoàn thành xoay quanh các chú thích được nhóm và tạo kiểu theo mức độ nghiêm trọng, các cập nhật mô hình sạch sẽ, cùng hành vi mở rộng và cắt ngắn có xét đến việc cuộn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
Implement the visual display system for Line Annotations in the source editor. These annotations should appear directly beneath relevant lines of code and visually communicate messages such as errors, warnings, or informational notes.
Requirements
- Add support for displaying annotations below lines in the source editor
- An annotation should include:
- A severity icon (error, warning, info)
- A short descriptive message
- Multiple annotations should be stackable if they occur on the same line
- Styling should reflect severity (e.g., color, icon)
- Annotations should update cleanly when the underlying data model changes (insert, remove, update)
- Annotations should avoid disrupting layout:
- Automatically shrink if needed to preserve line spacing.
- If the message is truncated, allow users to click the annotation to reveal a popover with the full message.
- This popover should scroll with the editor and remain positioned relative to its line.
- If the line scrolls out of view and the annotation is expanded, the popover should remain visible—docked to the top or bottom edge of the editor—until dismissed.
Implementation Details
- The expanded popover view (when multiple annotations exist or a message is truncated) may be called AnnotationAggregatedDropdownView, similar to what is used in other macOS editors.
- The source editor (
CodeEditSourceEditor) will accept a new property:annotations: Set<LineAnnotation> - LineAnnotation is a lightweight data model that represents a message to display beneath a specific line:
struct LineAnnotation: Hashable, Identifiable { let id: UUID = UUID() let line: Int let column: Int let severity: Severity let text: String } enum Severity { case error, warning, info, live } - The editor should group annotations by line internally and render them accordingly.
Additional Context
This is the foundational work for visual feedback in the editor. Future issues will introduce the system for feeding issues into the annotations (e.g., from builds, linters, or language servers) via an issue manager.
This feature is a key part of improving the editing experience by surfacing issues contextually, and sets the stage for deeper diagnostic and development tooling integration.
Related Issues
Screenshots
Warning

Warning Expanded

Error

Multiple Errors

Multiple Errors Expanded

- Ngôn ngữ chính
- Swift
- Star
- 720
- Fork
- 162
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CodeEditApp/CodeEditSourceEditor
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
CodeEditApp/CodeEditSourceEditor#377 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CodeEditApp/CodeEditSourceEditor#376 · 1 bình luận ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
CodeEditApp/CodeEditSourceEditor#378 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
Tất cả issue của CodeEditApp/CodeEditSourceEditor
Issue tương tự
-
The correction-threshold rationale says 17 restraint cases collide; the current corpus has 16 Đang mởarea:dictation documentation P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
uttrflow/uttrflow-swift#1180 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
OneBusAway/onebusaway-ios#1451 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100