Sublime Forum

[solved] autocomplete list problem

#1

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]{
“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
[/code]

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?

0 Likes

#2

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.

"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.
manual.macromates.com/en/scope_s … _selectors

0 Likes