Sublime Forum

ST4 and snippets broken?

#1

After the upgrade to ST4, I can no longer use snippets by typing the snippet string and hitting tab.

I first thought this might be happening for the snippets I defined but even the built-in proto snippet for JavaScript is behaving the same way. The autocomplete suggestions do not offer a snippet choice. See below.

05%20AM

However, clicking the snippet from Tools -> Snippets works. Anyone else seeing this problem?

Regards,
Bijoy

1 Like

#2

The proto snippet works fine here for me; can you replicate this problem in Safe Mode?

0 Likes

#3

Looks like it works as expected in safe mode.

Any suggestions on how to go about identifying and fixing the issue in regular mode?

1 Like

#4

It looks like there are some snippet choices … but those aren’t the ones that have been defined. The snapshot below shows “props” as a snippet? I don’t have something like that defined as a snippet.

00%20AM

I do however have “props” as a custom autocompletion that’s been defined in a sublime-completions file. Removing the sublime-completions file results in “props” no longer appearing as a snippet choice but I still don’t see the expected snippet appearing in that menu.

0 Likes

#5

Generally speaking, if it works in Safe Mode then some package or customization in your User package is getting in the way. For things like AutoComplete this can take the form of having packages installed that are trying to provide some sort of code intelligence of some sort.

To narrow it down you can try disabling all third party packages and seeing if the problem is gone, and then slowly enable them until you find the culprit, if the names of any of them don’t jump out as something that might be causing a problem like this.

0 Likes

#6

Greetings!

I hope this finds you well. I’m having a similar problem with snippets, and it’s occurring before and after any third party packages are installed.

The issue is simply that, when there are several snippets with the same tab trigger, the snippet menu that popped up in ST3 (displaying the various snippet choices and their descriptions) isn’t popping up in ST4. It seems to simply be choosing the snippet furthest down the alphabet (according to their filenames).

For example, I have 5 snippets, all with the same tab trigger:

<tabTrigger<.align.</tabTrigger<

(had to use only < here or else they’re hidden in the post)

When I set this off in ST3, I’d get a menu listing the choices and descriptions, and then could mouse to the one that I want. ST4 is like “I’m not showing you the list and I’m just givin ya the last one, peace out.”

If you folks have time, I’d really appreciate ya takin a look. Thanks in advance, and take care.

Cheers!

0 Likes

#7

I can’t replicate that here; have you tried in Safe Mode just to verify that there’s not some package (or a plugin/key binding in your User folder) that’s getting in the way?

0 Likes

#8

Thanks for the quick response! I appreciate it. I tried it out, still doesn’t seem to change.

  • In safe mode: there’s no snippet response at all, simply tabs the cursor over

  • On a fresh clean install with no packages or settings: no difference.

  • On a a fresh install on an identical computer: no difference.

Runnin this on the latest Windows 10 vs. 21H1, 19043.1052 if that makes a difference. Thanks in advance!

0 Likes

#9

I had the same problem and the fix for me was to restore the Tab keybinding from the default into the User settings. For some reason, user keybindings changed after the update and Tab and Enter functionalities were altered (some functionalities were missing).

0 Likes

#10

@alipasha

Thanks Ali. Would you say a little more about what you did? I’ve tried different combinations of copying the [tab] keybindings from default to user (all of them, those from ST3 into ST4, those missing from ST4 into it from ST3). Can’t seem to get it right.

Cheers!

0 Likes

#11

I copied all the tab bindings I found (looked up “tab”) in the Default onto the User settings file (all in ST4). Some were missing so once the issue was resolved, I did not look further into what the cause was. However, I noticed that the order in which the bindings appear in the settings file seems to matter. Before the snippets, I had the issue that the Tab was not “tab-ing”.

0 Likes

#12

Note however that Sublime should work just find without any bindings whatsoever in the User key binding file (with the exception that on some foreign language keyboards, some keys may not trigger like you think and you may want to remap them).

If copying the bindings from the Default to your User package fixes the problem, then the issue is that you have a package installed that’s overriding the bindings.

Additionally, if you look in the Default bindings and don’t see the bindings that other people say are there, you’ve overridden the defaults and are blocking the new version of the file from ST4 from taking effect.

0 Likes

#13

Well gentlemen, nope. Not for me. Y’all tried though, and I appreciate that.

Definitely not a package interference problem. Just did clean install #5, and there is literally nothing in the packages or user folders except for 3 snippets I just put there.

I’m guessing it’s a Windows 10 21H1 thing. Bummer. ST4 looks so sweeeeeeeet. I am sure with time.

Cheers!

0 Likes