Skip to content

Length data underflow for multiline token in response for textDocument/semanticTokens/full #1407

@onion108

Description

@onion108

Version

0.78.5+6061841946fe2237452639750895878768f14e9f

Dotnet Info

.NET SDK:
Version: 9.0.109
Commit: a1e39f97e5
Workload version: 9.0.100-manifests.d3740a48
MSBuild version: 17.12.41+a1e39f97e

Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /usr/share/dotnet/sdk/9.0.109/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.8
Architecture: x64
Commit: a1e39f97e5

.NET SDKs installed:
6.0.136 [/usr/share/dotnet/sdk]
8.0.119 [/usr/share/dotnet/sdk]
9.0.109 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.19 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.19 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Steps to reproduce

  • Clone this repostiory: https://github.com/onion108/csharp-language-server/
  • Navigate to tests/CSharpLanguageServer.Tests/CompletionTests.fs, using neovim with semantic token enable and also enable trace log
  • neovim just freezes after seconds, and in the log the data returned for textDocument/semanticTokens/full has an abnormal data: 4294967290

Details

  • Expected behavior: neovim doesn't freeze and all token lengths' data in the response of textDocument/semanticTokens/full should not be greater than the file size
  • Actual behavior: the data underflows (4294967290, which is -6 in Int32)

Logs

[DEBUG][2025-09-12 17:12:18] /usr/share/nvim/runtime/lua/vim/lsp/log.lua:151 "rpc.receive" { id = 2, jsonr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 6, 2, 1, 0, 0, 2, 3, 10, 0, 0, 4, 2, 8, 0, 1, 8, 6, 1, 0, 0, 6, 9, 12, 0, 0, 13, 2, 8, 0, 0, 2, 1, 9, 0, 0, 1, 5, 9, 4, 0, 5, 7, 9, 0, 2, 12, 11, 8, 0, 0, 14, 2, 8, 0, 0, 2, 6, 9, 4, 0, 7, 2, 21, 0, 0, 3, 3, 25, 0, 0, 3, 8, 12, 0, 0, 14, 1, 8, 0, 0, 5, 1, 8, 0, 0, 1, 6, 9, 4, 0, 7, 1, 21, 0, 1, 14, 11, 8, 0, 1, 10, 4, 10, 0, 0, 8, 8, 12, 0, 1, 10, 4, 10, 0, 0, 5, 4, 8, 0, 1, 12, 6, 1, 0, 0, 6, 9, 12, 0, 0, 21, 4, 8, 0, 0, 4, 6, 9, 4, 1, 12, 6, 1, 0, 0, 6, 8, 12, 0, 0, 9, 4, 8, 0, 0, 4, 1, 9, 0, 0, 1, 6, 9, 4, 0, 6, 7, 9, 0, 1, 12, 6, 1, 0, 0, 6, 8, 12, 0, 0, 9, 4, 8, 0, 0, 4, 1, 9, 0, 0, 1, 13, 9, 4, 0, 13, 7, 9, 0, 1, 12, 6, 1, 0, 0, 6, 9, 12, 0, 0, 10, 4, 10, 0, 0, 5, 18, 3, 0, 0, 18, 7, 3, 0, 0, 9, 4, 8, 0, 0, 4, 5, 9, 4, 2, 16, 12, 8, 0, 0, 14, 14, 1, 0, 0, 17, 6, 8, 2048, 0, 6, 8, 12, 0, 0, 35, 4, 8, 0, 2, 12, 6, 1, 0, 0, 6, 9, 12, 0, 0, 10, 12, 8, 0, 0, 12, 7, 9, 4, 0, 9, 4, 10, 0, 1, 12, 6, 1, 0, 0, 6, 8, 12, 0, 0, 9, 12, 8, 0, 0, 12, 1, 9, 0, 0, 1, 13, 9, 4, 0, 13, 7, 9, 0, 2, 11, 8, 12, 0 } } }

Checklist

  • I have looked through existing issues to make sure that this bug has not been reported before
  • I have provided a descriptive title for this issue
  • I have made sure that that this bug is reproducible on the latest version of the package
  • I have provided all the information needed to reproduce this bug as efficiently as possible
  • I or my company would be willing to contribute this fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions