镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

✨ Diagnostic Manager #2014

Description

@austincondiff

Description

Introduce a DiagnosticManager responsible for managing and publishing diagnostics (e.g., build errors, linter warnings, language server issues) grouped by file. This manager will serve as the single source of truth for diagnostics across the editor, and its contents will drive visual components such as the Issue Navigator and Line Annotations.

Requirements

  • Create a DiagnosticManager class conforming to ObservableObject
  • Store diagnostics as a flat list or grouped by file:
    @Published var issues: [DiagnosticIssue]
  • Define a DiagnosticIssue model:
    struct DiagnosticIssue: Identifiable, Hashable {
        let id: UUID = UUID()
        let file: URL
        let line: Int
        let column: Int?
        let message: String
        let severity: Severity
        let source: String?
        let fixItSuggestion: String?
    
        enum Severity {
            case error, warning, info, live
        }
    }
  • Add convenience accessors:
    var issuesByFile: [URL: [DiagnosticIssue]]
    func issues(for file: URL) -> [DiagnosticIssue]
  • Add a way to update issues by file, e.g.:
    func setIssues(_ issues: [DiagnosticIssue], for file: URL)
    func clearIssues(for file: URL)

Additional Context

This manager will be used by multiple parts of the app, including the Issue Navigator and Line Annotations. It should be reactive and efficient, allowing UI components to automatically update when diagnostics change.

Future extensions may include filtering, debouncing updates, or supporting different diagnostics sources (build system, LSP, etc.).

Related Issues

Activity

  1. added
    bugSomething isn't working
    extensionsIssues related to the extension architecture in CodeEdit
    language serverIssues or Pull Requests related to language servers.
    UIThis is UI related
    on Apr 2, 2025
  2. beltradini commented on Jun 7, 2025

    @beltradini

    Hi!, could you assign me to work on this one, thank you!

  3. austincondiff commented on Jun 7, 2025

    @austincondiff
    CollaboratorAuthor

    I sure can! But we might need to clarify a few things first.

    @FastestMolasses has been working on #354 and may be a good resource, but it looks like he has done a few things already in the way of diagnostics in PR #2006. Any insight here?

    @Kihron is working on #2015 so he might be good to sync up with as well.

    All of you, please include any relevant details here so we can all be on the same page so we don't redo any work or step on each others toes. Thanks!

  4. beltradini commented on Jun 7, 2025

    @beltradini

    Thanks for assigning me this work. @austincondiff

    I’ll review @FastestMolasses’s work in #354 and PR #2006, plus @Kihron’s work in #2015 to understand what’s already implemented and avoid duplication.

    Once I’ve analyzed the existing diagnostic infrastructure, I’ll post my findings here and coordinate with both contributors before starting implementation.

    @FastestMolasses @Kihron - Let’s sync up to make sure our work aligns!

  5. moved this from 🆕 New to 🏃‍♂️ In Progress in CodeEdit Projecton Jun 7, 2025
  6. FastestMolasses commented on Jun 8, 2025

    @FastestMolasses
    Member

    Hi @beltradini, the #2006 PR will effectively complete all remaining items for this issue so no more work is going to be needed on this front. We appreciate your effort, there are a lot of other issues that need contributors if you are up for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    IssueUIThis is UI relatedbugSomething isn't workingenhancementNew feature or requestextensionsIssues related to the extension architecture in CodeEditlanguage serverIssues or Pull Requests related to language servers.navigator

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions