Home Download Buy Blog Forum Support

[solved] autocomplete list problem

[solved] autocomplete list problem

Postby pier on Sun Nov 11, 2012 2:41 am

So I created this long autcomplete list with all import statements for AS3. I used an autocomplete list because I don't know of any other way to generate those import statements. If someone has a suggestion, please let me know of a better way to handle that!

Code: Select all
{
        "scope": "source.actionscript.3",

        "completions":
        [
         "import adobe.utils.*;",
         "import adobe.utils.CustomActions;",
         "import adobe.utils.XMLUI;",
         "import adobe.utils.MMEndCommand;",
         "import adobe.utils.MMExecute;",
         "import air.desktop.*;",
         "import air.desktop.URLFilePromise;",
         "import air.net.*;",
etc etc etc


The problem is that now it conflicts with autocomplete on the current document...

I see those solutions.. and I really don't know if any of those is possible:

1) disable fuzzy search for a particular autocomplete list
2) change order of preference for autocomplete (words in document vs autocomplete list)
3) limit scope of autocomplete list in class definition, so that ST doesn't look at this list when writing inside methods

So what do you think?
Last edited by pier on Sun Nov 11, 2012 2:57 am, edited 1 time in total.
pier
 
Posts: 92
Joined: Fri Jun 15, 2012 2:47 am

Re: autocomplete list problem

Postby pier on Sun Nov 11, 2012 2:57 am

So to answer my own question, in case any ST beginner like me stumbles upon this...

The solution was to change the scope of the autocomplete list.

Code: Select all
"scope": "source.actionscript.3 meta.package.actionscript.3 - meta.class.actionscript.3"


That basically says: use this list whenever you are in an AS3 document, inside package, but outside class.

Here's the documentation for this kind of selector.
http://manual.macromates.com/en/scope_s ... _selectors
pier
 
Posts: 92
Joined: Fri Jun 15, 2012 2:47 am


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], Nova and 38 guests