Skip to content

Add CompletionItem.labelDetails (LSP 3.17)#38

Open
tothambrus11 wants to merge 2 commits into
ChimeHQ:mainfrom
tothambrus11:completion-item-label-details
Open

Add CompletionItem.labelDetails (LSP 3.17)#38
tothambrus11 wants to merge 2 commits into
ChimeHQ:mainfrom
tothambrus11:completion-item-label-details

Conversation

@tothambrus11

@tothambrus11 tothambrus11 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Adds CompletionItemLabelDetails and the corresponding labelDetails field on CompletionItem (LSP 3.17 spec).

The client capability (CompletionClientCapabilities.CompletionItem.labelDetailsSupport) and the server capability (CompletionOptions.CompletionItem.labelDetailsSupport) are already modeled, but the item field itself was missing, so a server had no way to actually return label details. The field is optional and defaulted, so existing call sites are source-compatible, and it is omitted from the encoded JSON when absent.

Includes a test decoding a spec-shaped completion item with labelDetails.

@mattmassicotte

Copy link
Copy Markdown
Contributor

Hello and thank you!

It seems like the tests are effectively just exercising Codable and Optional behaviors?

I also think it is probably best rebase this so that only you are the author. This way, it's possible to track the work/responsibility down to an individual.

Adds the CompletionItemLabelDetails structure and the corresponding
labelDetails field on CompletionItem, so servers can return the
signature/description next to the label when the client declares
completionItem.labelDetailsSupport (which is already modeled).
@tothambrus11 tothambrus11 force-pushed the completion-item-label-details branch from 8004abb to 24bd712 Compare July 4, 2026 15:45
Comment thread Tests/LanguageServerProtocolTests/CompletionItemTests.swift Outdated
@tothambrus11

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I improved the test suite so that now it exercises something according to the LSP spec.

I believe I was already the author, and Claude was tagged as a co-author because of part of the mention in the commit description. Now I removed the attribution too.

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