Skip to content

on_query_completions fails to return custom completions when some characters are used #819

@joshgoebel

Description

@joshgoebel

Mac build 3083 here.

First lets make a simple completion:

{
    "scope": "source.coffee",
    "completions":[
        { "trigger": "constructor:\twow",
        "contents": "constructor: (${1:@instance}) ->\n\t$0"}
    ]
}

So when I type "c" I see "constructor:" in the completion list. Now lets create a plugin:

class MagicCompletions(sublime_plugin.EventListener):
    def on_query_completions(self, view, prefix, locations):
        return [("colon","i'm another completion")]

No issues... now autocomplete includes both "colon" and "constructor:"... but lets add a few other characters to the trigger:

class MagicCompletions(sublime_plugin.EventListener):
    def on_query_completions(self, view, prefix, locations):
        return [("colon(a, b)","i'm another completion")]

Now auto-complete ONLY shows "colon(a, b)" [which seems to work just fine] but "constructor:" has completely disappeared...

Problem characters seem to be parens, commas, spaces, but it may actually be any non [a-z]... Not sure since I don't have the actual Sublime source to figure out why the heck this might be behaving this way.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions