Skip to content

Conversation

@jakebailey
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings November 21, 2025 22:00
Copilot finished reviewing on behalf of jakebailey November 21, 2025 22:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds String() methods to non-string LSP enumerations in the generated protocol code, making them compatible with Go's Stringer interface. The implementation uses a stringer-style approach with string concatenation and index arrays for memory efficiency.

Key changes:

  • Generator now creates String() methods for all non-string enums
  • Bitflag enums (currently only WatchKind) get special handling to display combined flags as "Flag1|Flag2"
  • Regular enums use an index-based lookup for efficient string conversion

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
internal/lsp/lsproto/_generate/generate.mts Added logic to generate String() methods for non-string enums, with separate handling for bitflag vs. regular enums
internal/lsp/lsproto/lsp_generated.go Generated String() methods for 24 different enum types using the stringer-style pattern

@jakebailey jakebailey marked this pull request as draft November 21, 2025 22:13
@jakebailey jakebailey marked this pull request as ready for review November 21, 2025 22:18
@jakebailey jakebailey requested a review from Copilot November 22, 2025 05:35
Copilot finished reviewing on behalf of jakebailey November 22, 2025 05:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@jakebailey jakebailey added this pull request to the merge queue Nov 22, 2025
Merged via the queue into main with commit 733dc6a Nov 22, 2025
28 checks passed
@jakebailey jakebailey deleted the jabaile/lsp-enum-stringer branch November 22, 2025 05:50
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.

3 participants