You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
localt= {}
table.sort(t, |) -- trigger completion at `|` will show `fun(a: <T>, b: <T>):boolean`-- and choosing it should complete astable.sort(t, function (a, b)
end)
Actual Behaviour
but now it becomes something like this
localt= {}
table.sort(t, function (${1:a}, ${2:b})
$0end)
Reproduction steps
localt= {}
table.sort(t, |) -- trigger completion at `|` and choose the first provided function snippet
Additional Notes
I just checked out latest master (cb964c6 as of the time being) and found this issue.
After doing git bisect, it points to the following commit which is #3005 by @andrewbraxton
a3dd298664a55be46a2603642559eb91656ba18e is the first bad commit
commit a3dd298664a55be46a2603642559eb91656ba18e
Author: Andrew Braxton <andrewcbraxton@gmail.com>
Date: Tue Dec 24 22:21:01 2024 -0500
Send the correct `insertTextFormat`
Per LSP specification, `insertTextFormat` should be `2` for snippets and
`1` for plain text. Using `2` unconditionally can make clients behave in
unexpected ways.
The code calling into `provider.lua` sets `insertTextFormat` to 2 for
all snippets and leaves it nil for other types, so we can reuse that
information in `provider.lua` to make sure we send the correct value.
script/provider/provider.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Maybe the change works for neovim, but it's definitely broken for doc.type.function snippet in vscode 😕
(for others snippet like repeat .. until it works normally)
Log File
No response
The text was updated successfully, but these errors were encountered:
After some investigation, seems now a completion entry needs to specify insertTextFormat = 2 itself if it is snippet rather than plaintext.
Changing the following line resolves this issue 🤔
Hmm, my PR assumed that all snippets properly set insertTextFormat to 2 because the ones I happened to test did but that may not have been the case for all of them.
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
MacOS
What is the issue affecting?
Completion
Expected Behaviour
Actual Behaviour
but now it becomes something like this
Reproduction steps
Additional Notes
I just checked out latest master (
cb964c6
as of the time being) and found this issue.After doing git bisect, it points to the following commit which is #3005 by @andrewbraxton
Maybe the change works for neovim, but it's definitely broken for
doc.type.function
snippet in vscode 😕(for others snippet like
repeat .. until
it works normally)Log File
No response
The text was updated successfully, but these errors were encountered: