Autocomplete suggestions not matched correctly in 4134
Description of the bug
For example, typing "$v" doesn't automatically select the "$var" completion but prefers "var_dump".
Steps to reproduce
- Add a plugin:
import sublime import sublime_plugin from sublime import INHIBIT_WORD_COMPLETIONS, INHIBIT_EXPLICIT_COMPLETIONS class DollarCompletionListener(sublime_plugin.ViewEventListener): def on_query_completions(self, prefix, locations): print('on_query_completions, prefix: ', prefix) completions = [ CompletionItem(kind=(3, 'm', 'Method'), trigger='var_dump'), CompletionItem(kind=(3, 'm', 'Method'), trigger='$var'), ] completion_list = CompletionList() flags = INHIBIT_EXPLICIT_COMPLETIONS | INHIBIT_WORD_COMPLETIONS completion_list.set_completions(completions, flags) return completion_list - Open new view and set syntax to Javascript (for example)
- Type "$v"
Expected behavior
The "$var" completion is selected like in the build 4131:

Actual behavior
The "var_dump" completion is selected. Seems like "$" is not considered when matching completions (it's also not highlighted):

Sublime Text build number
4134
Operating system & version
macOS 12.4
(Linux) Desktop environment and/or window manager
No response
Additional information
Might be related to the fix made for #4855.
Note that in both 4131 and 4134 builds the prefix argument to on_query_completions is an empty string when typing the initial $. Feels a bit weird but regardless of that, it has worked before.
Also note that (even if it didn't happen before either) filtering out the var_dump completely would probably make more sense if $ is used for matching as "var_dump" doesn't contain the $ character.
OpenGL context information
No response
I can confirm this is happening for PHP as well.
~Caused by https://github.com/sublimehq/sublime_text/issues/5444 ?~
Shouln't have any impact on static completions from *.sublime-completions file.
Note: I was able to reproduce this behavior in SAFE MODE with plain PHP completions.
Typing $ followed by v already triggers var_dump, while hitting ctrl+space suggestions.
This is also happening with HTML class expansion.

Will the next stable build be released with this regression?
As mentioned in https://github.com/sublimehq/sublime_text/issues/5431, this appears to be fixed in 4138.
(have also verified that with my test code)
I can confirm that this has been fixed for HTML and seems to be working correctly for PHP too.
Fixed in Build 4138