aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp/semantic_tokens_spec.lua
diff options
context:
space:
mode:
authortiagovla <30515389+tiagovla@users.noreply.github.com>2022-12-19 05:24:27 -0300
committerGitHub <noreply@github.com>2022-12-19 09:24:27 +0100
commitf4d8e992bfcd6e9d0097b9d7a022060bd32f2069 (patch)
tree4147ac1d360ce9e54359f0ee3780ff361e886b61 /test/functional/plugin/lsp/semantic_tokens_spec.lua
parenta7332ba9b429f9676723eb88cffb2068f5a95c9b (diff)
downloadrneovim-f4d8e992bfcd6e9d0097b9d7a022060bd32f2069.tar.gz
rneovim-f4d8e992bfcd6e9d0097b9d7a022060bd32f2069.tar.bz2
rneovim-f4d8e992bfcd6e9d0097b9d7a022060bd32f2069.zip
fix(lsp): token_edit.data might be null on deletion (#21462)
Diffstat (limited to 'test/functional/plugin/lsp/semantic_tokens_spec.lua')
-rw-r--r--test/functional/plugin/lsp/semantic_tokens_spec.lua31
1 files changed, 30 insertions, 1 deletions
diff --git a/test/functional/plugin/lsp/semantic_tokens_spec.lua b/test/functional/plugin/lsp/semantic_tokens_spec.lua
index e62a6f7086..547e34d12a 100644
--- a/test/functional/plugin/lsp/semantic_tokens_spec.lua
+++ b/test/functional/plugin/lsp/semantic_tokens_spec.lua
@@ -1109,7 +1109,36 @@ int main()
extmark_added = true,
}
},
- }
+ },
+ {
+ it = 'optional token_edit.data on deletion',
+ legend = [[{
+ "tokenTypes": [
+ "comment", "keyword", "operator", "string", "number", "regexp", "type", "class", "interface", "enum", "enumMember", "typeParameter", "function", "method", "property", "variable", "parameter", "module", "intrinsic", "selfParameter", "clsParameter", "magicFunction", "builtinConstant", "parenthesis", "curlybrace", "bracket", "colon", "semicolon", "arrow"
+ ],
+ "tokenModifiers": [
+ "declaration", "static", "abstract", "async", "documentation", "typeHint", "typeHintComment", "readonly", "decorator", "builtin"
+ ]
+ }]],
+ text1 = [[string = "test"]],
+ text2 = [[]],
+ response1 = [[{"data": [0, 0, 6, 15, 1], "resultId": "1"}]],
+ response2 = [[{"edits": [{ "start": 0, "deleteCount": 5 }], "resultId": "2"}]],
+ expected1 = {
+ {
+ line = 0,
+ modifiers = {
+ 'declaration',
+ },
+ start_col = 0,
+ end_col = 6,
+ type = 'variable',
+ extmark_added = true,
+ }
+ },
+ expected2 = {
+ },
+ },
}) do
it(test.it, function()
exec_lua(create_server_definition)