Sublime Forum

Override 1 standard completion

#1

I want to override 1 of PHP’s completions. I don’t want to override the entire PHP.sublime-completions file, because (I assume) that will be updated by ST occasionally, and I do want those updates.

If I add a completion in my custom completions (Packages/User/RudieCustom/php-custom.sublime-completions) with the exact same scope/trigger/kind etc, ST just shows both completions, with the exact same label.

My case is microtime(). ST’s microtime doesn’t include the as_float argument:

{
	"trigger": "microtime()",
	"contents": "microtime()",
	"kind": "function",
	"details": "Return current Unix timestamp with microseconds"
},

and I always want that argument: microtime(true), so I copied the whole block and added the true in contents. But now there are 2 microtime() triggers. I can rename my custom one (which I did for now), but I don’t want to keep the old one, I want to override it. Can I do that without editing/copying PHP.sublime-completions?

0 Likes

#2

Sublime Text doesn’t deduplicate completions from different sources, so no, overriding single items is not possible without overriding the whole file.

0 Likes

#3

For what it’s worth, OverrideAudit will not only help you create the override, it will also tell you if the package updates the file on you so that you can take appropriate action.

0 Likes