Sublime Forum

ST4: How to find clashing sublime completions

#1

I’ve done lots of digging in the help files and these forums, but I’m baffled. I upgraded from Sublime Text 3 where my completions were in Packages→Lua→my_comp.sublime-completions and worked fine.

Now, with Sublime Text 4, some other package must be taking priority.

My primary coding is PHP, js and css. So, for example, I type “cl” in my *.js file and expect “console.log”, but I get just “console”.

This is the completion that worked before:
{ “trigger”: “cl”, “contents”: “console.log($1);\n” },

And, in preferences, my settings are:
“tab_completion”: true,
“auto_complete”: true,
“auto_complete_use_history”: true,
“auto_complete_commit_on_tab”: true,

I’ve even tried grepping all my packages for “cl” wholeword only but that leads to insanity. Any help?

Thanks!

0 Likes

#2

Not sure why it works in ST 3. Anyway, in ST 4, a typical .sublime-completions should be like

{
    // "scope": "source.js", // if you want this working in any lang, comment this out
    "completions": [
        { "trigger": "cl", "contents": "console.log($1);\n" },
    ],
}
0 Likes

#3

Oh, sorry, I only showed the one line from the completions, thought the rest would be noise. My entire completions is:

{
   "completions":
   [
      { "trigger": "vv", "contents": "var_dump_pre($1);\n" },
      { "trigger": "vt", "contents": "var_dump_title('$1');\n" },
      { "trigger": "vh", "contents": "var_dump_html($1);\n" },
      { "trigger": "vx", "contents": "dump_hex($1);\n" },
      { "trigger": "ex", "contents": "exit();\n" },
      { "trigger": "exx", "contents": "exit();\n" },
      { "trigger": "cl", "contents": "console.log($1);\n" },
      { "trigger": "rw", "contents": "Response.Write($1);\n" },
      { "trigger": "re", "contents": "Response.End();\n" },
      { "trigger": "vp", "contents": "view_paths();\n" }
   ]
}

Could it be missing commas on the last 2 of 3 lines? It more appears to be something taking priority because the really unique ones like “vv” and “vt” complete properly.

0 Likes

#4

You file work fine on my side. So what happens in the autocompletion popup when you type cl?

0 Likes

#5

Hopefully this isn’t cut too tight to see. Here’s the dropdown. And thanks so much for your help, I really appreciate it.

image

0 Likes

#6

From my personal experience, the first item in the autocompleiton popup is always the selected one unless you manually move to another. :thinking: So I have no idea why console is selected.

Maybe because your

	// If previously-selected completions should be automatically selected
	"auto_complete_use_history": true, // false by default, by the way
0 Likes

#7

I think that was it. Thanks so much!

0 Likes