✨ Display Issues as Line Annotations In Source Editor

未关闭
#2,015 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
swift

调研方向

首先定位 DiagnosticManager、DiagnosticIssue 以及使用 CodeEditSourceEditor 的视图。跟踪当前文件的识别方式,并将其诊断信息接入传递给编辑器的 LineAnnotation 值;完成的标准是使用现有编辑器渲染,在受影响行下方显示特定于文件的注释。

由索引模型根据 Issue 内容生成。

描述

enhancement extensions source editor
Description

Use the newly created 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:
    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:
    func annotations(for file: URL) -> Set<LineAnnotation>
    
  • In views where CodeEditSourceEditor is used:
    • Access the current file’s annotations using the manager
    • Pass them into the editor view via:
    annotations: Set<LineAnnotation>
    
  • 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. 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
主要语言
Swift
星标
23k
派生
1.2k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CodeEditApp/CodeEdit 的其他 Issue

查看 CodeEditApp/CodeEdit 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。