I have a list of functions (min
, max
, …) that are displayed in the completion popup.
when the user select a function, I want to add ()
at the end of the function name. nothing fancy.
for now, all I found was to use a completion snippet, and add an apply function to all completion items.
something like this (functions
is a list of Completion
interface):
const functionsWithApply = functions.map(f => snippetCompletion(f.label + "(${})"), f)
Then I return that new list in the options from the complete function.
It seems to work, but it is not very efficient to add an apply function to all completion items, just to add the same generic code. Is there a better way to do it ?
also, if I want to use “(
” as a commitCharacters, it doesn’t work because then I have 2 “()
” inserted.
I can’t find a solution in the doc or the forum. Any help is welcome.