Sublime Forum

Autocompletion too frequent and with fuzzy results

#1

Since updating to Sublime Text 4, autocompletion seems far “noisier” than my other text editors. I’d like the autocompletion dialog to show up less frequency, and to show less suggestions.

  • Is there a way to require a specific number of characters before showing suggestions?

  • Is there a way to turn off fuzzy search results? If I type in “te”, I
    get suggestions for true, testFoo, and fooTest. I’d like to only see testFoo.

  • Alternatively, is there a way for a plugin to filter/rewrite the list of autocompletion entries?
    I played with sublime_api.view_set_completions, but this seems to add additional
    completions rather than rewriting Sublime’s list.

I’m currently using the following as a workaround. It still shows fuzzy results, but at least it’s not popping up after typing whitespace or a single character.

Any suggestions would be appreciated! Thanks!

import sublime
import sublime_plugin

class CompletionListener(sublime_plugin.ViewEventListener):
    def on_query_completions(self, prefix, locations):
        print(prefix)
        if len(prefix) < 2:
            return ( " ", sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS )
        else:
            return
0 Likes