Sublime Forum

ST4 triggering completion

#1

Hi, I recently switched to ST4 and I noticed the completion triggers are different. In particular my plugin is no longer working, because it won’t trigger a completion after typing the word new. This is in a Javascript context.

For example, in ST3 when you type new C, the on_query_completions event will be triggered with the prefix C and this is where I insert my custom snippets starting that start with C. In ST4 nothing is triggered after typing new C, only after the first n and the space behind w.

I figured this could also be fixed with the settings auto_complete_selector or auto_complete_triggers, but the documentation is not enough for me to understand them. For example I tried adding {"selector": "meta.function-call.constructor.js", "characters": "C"}, guessing that could trigger the completion, but still nothing happens after typing new C.

Any help would be appreciated, how do I make it trigger the autocompletion like in ST3?

0 Likes

#2

Sorry to bump this, but surely somebody here can answer on how to change the auto completion triggers?

0 Likes

#3

I’m not a regular JavaScript user, but when I type new C with the JavaScript syntax, I do get the autocompletion popup with word completions from the view. The default value for auto_complete_selector doesn’t disable the completions, and neither should JavaScript’s Completion Rules.tmPreferences. You can easily assure that on_query_completions is triggered with a little plugin like this, and look at the console output:

import sublime_plugin

class CompletionListener(sublime_plugin.ViewEventListener):
    def on_query_completions(self, prefix, locations):
        print(prefix)

Maybe you should post your plugin code here, if you want help with debugging.

Perhaps you have another package installed that messes with completions?

0 Likes