Sublime Forum

Auto complete triggered too early

#1

I work with SublimeClang and SublimeCodeIntel and they sometimes get their auto-complete wrong. For example, I will type:

g_PhysicsQ->Add

and auto-complete pops up “add_rigid_body” instead of “Add”. Now, I’m fine with the auto-complete sometimes being wrong, in fact, I’m used to it coming from a Visual Studio/VAX background. My response is to normally ignore the auto-complete and keep typing. In the above example, as soon as I type “(” the auto-complete kicks in and replaces my code with:

g_PhysicsQ->add_rigid_body

This is crazy annoying - I don’t want pressing “(” to auto-complete! I’ve tried commenting out the following key bindings as they appear to trigger it (“insert_snippet” ?):

	{ "keys": "("], "command": "insert_snippet", "args": {"contents": "($0)"}, "context":
		
			{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
			{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
			{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
		]
	},
	{ "keys": "("], "command": "insert_snippet", "args": {"contents": "(${0:$SELECTION})"}, "context":
		
			{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
			{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
		]
	},

This doesn’t work. Any ideas?

0 Likes

#2

In your File Settings - Default, or syntax specific, you may have a line like

// Additional situations to trigger auto complete "auto_complete_triggers": {"selector": "text.html", "characters": "<"} ],
but with the angle replaced with a left-brace ‘(’. This is more likely to be within a syntax specific file than the default one. If you find this line you could comment it out.

You could also increase the auto-complete delay in the same file:

// The delay, in ms, before the auto complete window is shown after typing "auto_complete_delay": 50,
In your project folder there is a workspace file which contains a list of auto_complete, selected items. That is, a history of the auto-completions you have used. You could try **carefully **deleting these - but don’t do so while you have the project open!! I believe this should reset your completions history, and change the defaults as they appear in the list - but this is my ***unofficial ***suggestion :smile:

0 Likes

#3

Unfortunately “auto_complete_triggers” has been untouched since I installed and there are no over-riding settings files changing its behaviour. But to be clear: I do want the auto-complete popup, I just don’t want it to insert any code when I press any key other than TAB.

Thanks.

0 Likes

#4

It could be that you’re using an old version of SublimeCodeIntel, current versions shouldn’t do this.

0 Likes

#5

Thanks for the response but I have the latest version of all plugins at the moment.

0 Likes