SemanticTokensBuilder.buildEdits() returning incorrect deleteCount
See original GitHub issueI’m working on an issue where the users of a language server that I’m the maintainer of see their semantic coloring go haywire when doing deletes. I’ve confirmed that if I modify my language server to provide full tokens for a document every time (it currently registers as a full and delta provider), the tokens are correct after a delete. However, when registering as a delta provider and using the SemanticTokensBuilder.buildEdits() function, I observe this behavior:
My document upon open contains this text:
Class User.short
{
/// desc
ClassMethod t()
{
q 1
}
}
And these tokens:
[ 0, 0, 5, 4, 0 ]
[ 0, 6, 4, 5, 0 ]
[ 0, 4, 1, 5, 0 ]
[ 0, 1, 5, 5, 0 ]
[ 1, 0, 1, 8, 0 ]
[ 2, 0, 3, 7, 0 ]
[ 0, 4, 4, 7, 0 ]
[ 1, 0, 11, 4, 0 ]
[ 0, 12, 1, 11, 0 ]
[ 0, 1, 2, 8, 0 ]
[ 1, 0, 1, 8, 0 ]
[ 1, 4, 1, 60, 0 ]
[ 0, 2, 1, 51, 0 ]
[ 1, 0, 1, 8, 0 ]
[ 2, 0, 1, 8, 0 ]
If I delete the line /// desc
(tokens 6 & 7), the result of textDocument/semanticTokens/full/delta
is:
{
"resultId": "1618608792098",
"edits": [
{
"start": 27,
"deleteCount": 9,
"data": []
}
]
}
and the expected result is:
{
"resultId": "1618608792098",
"edits": [
{
"start": 27,
"deleteCount": 10,
"data": []
}
]
}
I’m using VSCode 1.55.2 and vscode-languageclient/server 7.0.0
Original issue: https://github.com/intersystems/language-server/issues/29
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Release server@7.1.0-next.5 and client@7.1.0-next.5
Sorry for that. I can make a next version beginning on next week.