swiftlang / swiftlang/sourcekit-lsp
out-of-range Integer in response data to "textDocument/semanticTokens/full"
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 3.9k
- Forks
- 390
- Avg merge
- 9d 5h
- Merged PRs (30d)
- 3
Description
Swift version
Swift version 6.3.3 (swift-6.3.3-RELEASE)
Platform
Linux
Editor
Noctule (my own LSP client, uses LSP4J)
Description
- I used SourceKit LSP with Objective-C
- I opened
CocoaLumberjack/CLI/CLIColor.mof https://github.com/cocoalumberjack/cocoalumberjack - The LSP client requested semantic tokens
LSP4J failed to deserialize the reponse, because one of the numbers (which should be uint32 (2^31-1) according to the LSP spec) was out-of-range.
The out-of-range number is 4294967295, which is 2^32 − 1 and at the position of a delta line. Claude says it might be "-1" converted to an uint32.
Perhaps lines with a negative delta should be ignored from the response?
This was the log captured by SourceKit LSP.
I'm unable to reproduce this reliably, it only happens sometimes.
Steps to Reproduce
- I used SourceKit LSP with Objective-C
- I opened
CocoaLumberjack/CLI/CLIColor.mof https://github.com/cocoalumberjack/cocoalumberjack - The LSP client requested semantic tokens
I'm not able to reproduce this reliably, but have seen it a few times already.
Logging
--[org.swift.sourcekit-lsp:request-39] default 2026-07-27 10:54:56.9940 +0200
Received request "39": textDocument/semanticTokens/full
{
"textDocument" : {
"uri" : "file:///home/user/test-sources/test-sources/CocoaLumberjack/Sources/CocoaLu
mberjack/CLI/CLIColor.m"
}
}
---[org.swift.sourcekit-lsp:request-39] info 2026-07-27 10:54:56.9940 +0200
Sending request to clangd (id: "sk-35"):
textDocument/semanticTokens/full
{
"textDocument" : {
"uri" : "file:///home/user/test-sources/test-sources/CocoaLumberjack/Sources/CocoaLumberjack/CLI/CLIColor.m"
}
}
---[org.swift.sourcekit-lsp:clangd-stderr] info 2026-07-27 10:54:56.9940 +0200
I[10:54:56.994] <-- textDocument/semanticTokens/full("sk-35")
---[org.swift.sourcekit-lsp:clangd-stderr] info 2026-07-27 10:54:56.9940 +0200
I[10:54:56.994] --> reply:textDocument/semanticTokens/full("sk-35") 0 ms
---[org.swift.sourcekit-lsp:default] info 2026-07-27 10:54:56.9940 +0200
Received reply for request "sk-35" from clangd
textDocument/semanticTokens/full
Optional<DocumentSemanticTokensResponse>
{
"data" : [
18,
0,
0,
24,
0,
1,
0,
36,
24,
0,
4294967295,
0,
0,
24,
0,
1,
0,
36,
24,
0,
1,
0,
0,
// ... snipped
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the textDocument/semanticTokens/full response path in SourceKit-LSP, using the logged request for CLIColor.m and the clangd reply as the reproduction context. Check how the semantic-token data is validated or forwarded, then confirm that responses containing 4294967295 are handled correctly with a regression test or a reliable reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c, swift
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100