Skip to content

lsproto: separate VS diagnostic tag constant from CodeActionKind block#3990

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/move-to-proper-category
Draft

lsproto: separate VS diagnostic tag constant from CodeActionKind block#3990
Copilot wants to merge 3 commits into
mainfrom
copilot/move-to-proper-category

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

This addresses review feedback on PR #3989 to keep protocol constants categorized by domain. VSDiagnosticTagHiddenInEditor was previously grouped with CodeActionKind constants and is now moved to a dedicated const block.

  • What changed

    • Split the mixed const block in internal/lsp/lsproto/lsp.go.
    • Kept CodeActionKindSourceRemoveUnusedImports and CodeActionKindSourceSortImports in the CodeActionKind block.
    • Moved VSDiagnosticTagHiddenInEditor into its own DiagnosticTag-focused const block (no value or behavior change).
  • Why this matters

    • Keeps protocol definitions organized by type/category, improving discoverability and maintenance.
  • Illustrative diff

    const (
        CodeActionKindSourceRemoveUnusedImports CodeActionKind = "source.removeUnusedImports"
        CodeActionKindSourceSortImports         CodeActionKind = "source.sortImports"
    )
    
    const (
        VSDiagnosticTagHiddenInEditor DiagnosticTag = 2147483641 // int32.MaxValue - 6
    )

joj and others added 2 commits May 19, 2026 18:52
The LSP spec says clients are "allowed to render diagnostics [tagged
Unnecessary] faded out instead of having an error squiggle." Visual
Studio's LSP client, however, only renders the faded "unused" appearance
when a diagnostic carries both DiagnosticTag.Unnecessary AND the
VS-internal VSDiagnosticTags.HiddenInEditor tag; with just Unnecessary
the diagnostic shows as a normal squiggle.

When the client advertises _vs_supportsVisualStudioExtensions, also emit
HiddenInEditor (int32.MaxValue - 6 = 2147483641) so unused variables and
similar diagnostics render faded in Visual Studio. Non-VS clients
continue to receive only the standard LSP tags.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: joj <2939999+joj@users.noreply.github.com>
Co-authored-by: joj <2939999+joj@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code as per review comment for proper category lsproto: separate VS diagnostic tag constant from CodeActionKind block May 19, 2026
Copilot finished work on behalf of joj May 19, 2026 18:53
Copilot AI requested a review from joj May 19, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants