Sublime Forum

Snippets have stopped working after upgrading to Sublime Text 4

#1

After upgrading to Sublime Text 4, the snippets that were previously working have stopped. Has anyone experienced the same and/or has a fix to get snippets working correctly again?

Here is an example snippet:

<snippet>
	<content><![CDATA[
foreach ( ${1:$key} as ${2:$value} ) : ?>
	${3}
<?php endforeach;
]]></content>
	<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
	<tabTrigger>fore</tabTrigger>
	<!-- Optional: Set a scope to limit where the snippet will trigger -->
	<scope>source.php</scope>
</snippet> 

This was outputting a “foreach” block in ST3 and I was able to tab through and replace the values:

foreach ( $key as $value ) : ?>
	...
<?php endforeach;

but now the same tabTrigger of “fore” outputs only “foreach” and that’s it.

foreach

If I trigger the snippet using command-shift-p and searching for it, the snippet outputs more of the snippet, but the variables are still missing:

					foreach (  as  ) : ?>
						
					<?php endforeach;

Any help or guidance would be appreciated.

Thanks

0 Likes

#2

Does that still appear that way if you switch your color scheme to one of the ones that ships with Sublime, such as the default?

0 Likes

#3

same! all of my snippets just stopped working after upgrading.

snippet:

<snippet>
	<content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
	<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
	<tabTrigger>swifthi</tabTrigger>
	<!-- Optional: Set a scope to limit where the snippet will trigger -->
	<!--<scope>source.js</scope>-->
</snippet>

i changed the color scheme, it flashed the correct snippet ONCE and then it went back to not coming up in search results… please fix!

0 Likes

#4

After a fresh install snippets are working as expected. Just make a copy of ~/Users/{user}/Library/Application Support/Sublime Text 3/…

And then remove that folder, do a fresh install and copy over your snippets to the new Sublime folder that the new install creates @themascott

0 Likes

#5

Same issue here, they don’t show up on the ad-hoc suggestions list so I can’t trigger them with tab, but I can find and trigger them through the command palette. Switching to the standard theme didn’t help either.

I did reset the config and they showed up for some time. I started installing my usual packages and they kept working. Today I noticed they the snippet suggestions where gone again. I have a suspicion about the Naomi package, which I install recently and lastly, but deleting it did not bring snippet suggestions back.

Any help/tips is/are greatly appreciated.

0 Likes

#6

Same problem here: Even setting

“auto_complete_include_snippets”: true,
“auto_complete_include_snippets_when_typing”: true,

in preferences doesn’t work! I’ve tried even everything suggested here, but without success! Hope somebody has a solution! Thanks!

0 Likes

#7

Did anyone figure this out?

For me, snippets only work when a dropdown of autocomplete suggestions doesn’t show up. Snippets don’t show up in autocomplete dropdown, despite not having futzed with the default settings. Build 4113.

0 Likes

#8

Does the same thing also happen in Safe Mode?

0 Likes