Sublime Forum

Syntax specific autocomplete suggestions

#1

Hi, it happens that i am working in a Web App Project, that contains several “syntax-scopes” - stuff like the usual *.php, *.phtml, *.js, *.css.

Now, when i am working in the *.php files, the auto-complete suggestions-list do contain hits for symbols in *.js, *.css, which is not helpful at all.

My Question is: is there a way to tell sublime text to limit the suggestion to a given “syntax-scope” X,Y when i am currently in “syntax-scope” Z? e.g. show me only suggestions in *.php files when i am currently in a *.php file.

0 Likes

#2

I’m not aware of a setting for that, no. If you’re using ST4, you could try adjusting this setting:

	// Auto complete will used indexed data to provide completions from other
	// files when this is enabled
	"auto_complete_use_index": true,

When it’s turned off, completions are only offered from files that are currently open, whereas when it’s turned on as above completions for every file in the project may be offered.

There’s no such setting for ST3 though, which always behaves as if this setting was turned off (i.e. it will only offer completions from files that are open). In that case a workaround solution would be to not have files of other types open.

1 Like