Sublime Forum

ST4: auto-completion - limit to current file only

#1

Hey there,

how do I limit auto-completion to only use text from the current file, and not from my entire codebase. I’m using ST4, thanks!

0 Likes

#2

You could try toggling the state of this setting, which defaults to being turned on:

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

With it turned off, the index won’t be used for completions, which is where the symbols for the project as a whole are found. I believe that with it turned off you would still get completions from any files currently open in the window though, which may or may not be good enough for what you want.

0 Likes

#3

I am having the opposite problem. I have it set to true, the default, and auto complete is not offering up symbols from other files.

Yet I can use the goto symbol function and it finds that symbol.

I disabled LSP just in case that was interfering … any ideas?

0 Likes

#4

How common are the symbols you’re trying to look up?

I may be remembering incorrectly, but I believe there’s a minimal number of times that a symbol has to appear in other files before the heuristics will consider it a candidate to keep the noise in the list down.

If that’s the case, I don’t think there is a setting that controls it, though I would imagine there’s been an issue logged for it because you’re not the first one to encounter it.

0 Likes