Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lsp): token_edit.data might be null on deletion #21462

Merged
merged 2 commits into from
Dec 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test(lsp): optional token_edit.data on deletion
  • Loading branch information
tiagovla committed Dec 18, 2022
commit 73ccfd3681f2b7815591c8d2aa623ed8a033177a
31 changes: 30 additions & 1 deletion test/functional/plugin/lsp/semantic_tokens_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down