Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

✨ Line Annotations

未關閉
#297 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
swift
領域
desktop, devtools

研究方向

從 CodeEditSourceEditor 進入點開始,檢視提議的 LineAnnotation 模型與 AnnotationAggregatedDropdownView 概念。將需求與相關 issue #354 進行比較,然後圍繞分組且依嚴重性設定樣式的註解、乾淨的模型更新,以及考量捲動的展開與截斷行為來定義完成標準。

由索引模型根據 Issue 內容生成。

描述

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
image

Warning Expanded
image

Error
image

Multiple Errors
image

Multiple Errors Expanded
image

主要語言
Swift
星號
720
分支
162
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

CodeEditApp/CodeEditSourceEditor 的其他 Issue

查看 CodeEditApp/CodeEditSourceEditor 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。