Sublime Forum

ST4 triggering completion


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?



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



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):

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

Perhaps you have another package installed that messes with completions?