Releases: zardoy/vscode-better-snippets
v0.1.25
New Features
- typing-snippets: enable support for multicursor by default
you can disable ittypingSnippetsEnableMulticursor
setting f71db34 - Trigger Characters! (#16)
presenting you absolutely new feature! Now you can target some snippets to only show after typing specific character!
It wasn't possible before to split snippets into groups, but now you can do this with newwhen.triggerCharacters
optional array.
The Problem
Even if you have quick suggestions enabled, it doesn't mean it would show snippets after typing every character (even space).
What if we wanted to quickly specify true/false after property name or expand it as a method?
const config = {
enableFeature
customMethod
}
Here, we have two properties, we want to quickly specify true
on first and epxand method on second.
Firstly, let's assume that we don't want complicated checks and hacks. No typing snippets.
We could add a snippet to expand it to true
/method after a single word on the line so we could type space and... the snippet won't appear, yes, because you firstly need to trigger completions and only then you can select it, this can be super annoying
enableFeature t -> true
The Solution
{
"name": "t",
"body": ": true,",
"when": {
"lineHasRegex": "^\\s*\\w+ $",
"triggerCharacters": [
" "
]
},
"replaceTriggerCharacter": true
},
// to expand it as method
{
"name": "fun",
"body": "($1) {\n\t$0\n},",
"when": {
"lineHasRegex": "^\\s*\\w+ $",
"triggerCharacters": [
" "
]
},
"replaceTriggerCharacter": true
},
Also, as you can see, we also now have optional replaceTriggerCharacter
setting, because we want to remove the trigger character (space in our case):
enableFeature t 61b7ffdb5c2fce855817754ed288fe6218de13d2
### Bug Fixes
- **perf**: doesn't check changed contents for non-writable FS (e.g. for outputs) 072c330b5d485b91f598d2927d6308a4a180ac06
v0.1.24
v0.1.23
New Features
- other lines (#9)
-
Introduce new snippet constrain! Meet otherLines!
Until now, we had only lineRegex
and lineHasRegex
snippet constrain. Both received regex and can be used to filter out snippets by matching regex against current line.
Now you have the same thing to for any other line as well! The most powerful thing is that you can also match regex against line with one indentation up (you can set any number). More docs and examples are coming soon, however active usage of that feature theoretically can slowdown weak computors. Also basic example was updated to use this new feature. 5485d6d
- Builtin
useParam
snippet now useotherLines
constrain withfunction|=>|React.FC
regex on indentation above. If you feel some slowdown for you or just want to make your configured version, you can disable this snippet (see below). Also we removed sortText. This all can be breaking behavior for some use cases, however, the main intention was to just make it less annoying on every single line.5485d6d
- Add experimental way to completely disable some builtin snippets via specifying
experimental.disableBuiltinSnippets
array as names.
MARK AS BETA/UNSTABLE!5485d6d
v0.1.22
New Features
- patch ordering of suggestions when editing settings.json.
ced7cc8
Bug Fixes
- fix default value of
snippetCreator.showSnippetAfterCreation
. The behaviour of setting (even default one) isn't changed. You need to explicitly disable setting if you want to disable opening settings.json after snippet creationced7cc8
v0.1.21
New Features
- merge workspace-level snippets with global instead of replacing them
⚠️ It changes the way extension worked before! Previously, defining customSnippets and typingSnippets at workspace level (in.vscode/settings.json
) led to replacing snippets from global settings.json. Now they are merged instead.1d44c42
v0.1.20
New Features
- allow to configure (add/change existent) language supersets
Example of adding vue to js superset:
{
"betterSnippets.languageSupersets": {
"js": ["typescript", "javascript", "typescriptreact", "javascriptreact", "vue"]
...
}
}
Bug Fixes
- improve titles for prompts in snippet creator
5046b25
v0.1.19
v0.1.18
v0.1.17
Bug Fixes
- REVAMPED
resolveImports
(#2)
Now we import missing things from just inserted snippets even better, you just need to defineresolveImports
to be explicit (asuseState
for example can also be in another package).
Now we delay displaying error about failed identifiers to import and now you can also control that delay via setting. This was done because TypeScript Language Features extensions is slow AF. If you have really fast machine, try to lower that setting to get failing notifications faster!
Also it is now finally possible to install missing packages with npm Rapid Ready. After installing packages, imports will be resolved. You don't need to reapply the snippet!902f627