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
{{ message }}
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
I am currently writing my own provider, which should provide snippets and autocomplete functionality for functions of the LÖVE framework. The problem is, that autocomplete-plus uses the snippet field for filtering when filterSuggestions is set to true (at least as far as I can tell).
For example it wouldn't work for a suggestion like this:
{
"displayText": "love.directorydropped",
"type": "function",
"description": "Callback function triggered when a directory is dragged and dropped onto the window.",
"descriptionMoreURL": "https://love2d.org/wiki/love.directorydropped",
"snippet": "function love.directorydropped(${1:path (string)})\n ${2:body (lua)}\nend\n"
}
I'd like to type ldir and have the suggestion for love.directorydropped at the top of the autocomplete list, but since autocomplete-plus tries to match ldir to the snippet (which starts with function ... nothing is suggested at all.
This also means you can't use snippets which start with a variable: ${0:Source}:isPaused()
Suggestion
Of course this might just be a special case which rarely comes up, but maybe it might make sense to allow creators of new providers to specify a filter field which is matched against the prefix.
{
"displayText": "love.directorydropped",
"type": "function",
"description": "Callback function triggered when a directory is dragged and dropped onto the window.",
"descriptionMoreURL": "https://love2d.org/wiki/love.directorydropped",
"filter": "love.directorydropped",
"snippet": "function love.directorydropped(${1:path (string)})\n ${2:body (lua)}\nend\n"
}
autocomplete-plus could still fall back to the default behaviour, if the filter field isn't provided.
The text was updated successfully, but these errors were encountered:
The issue
I am currently writing my own provider, which should provide snippets and autocomplete functionality for functions of the LÖVE framework. The problem is, that autocomplete-plus uses the
snippet
field for filtering whenfilterSuggestions
is set to true (at least as far as I can tell).For example it wouldn't work for a suggestion like this:
I'd like to type
ldir
and have the suggestion forlove.directorydropped
at the top of the autocomplete list, but since autocomplete-plus tries to matchldir
to the snippet (which starts withfunction ...
nothing is suggested at all.This also means you can't use snippets which start with a variable:
${0:Source}:isPaused()
Suggestion
Of course this might just be a special case which rarely comes up, but maybe it might make sense to allow creators of new providers to specify a
filter
field which is matched against the prefix.autocomplete-plus could still fall back to the default behaviour, if the
filter
field isn't provided.The text was updated successfully, but these errors were encountered: