Open failable opened 1 year ago
Yes please!!
The thing I miss the most coming from VS Code is the ability to set up snippets.
In VS Code, I can type log[TAB]
and it turns that into console.log(CURSORHERE)
, for example.
Fantastic IDE!
same here. I use almost everyday cl
for console.log
{
// Place your snippets for typescriptreact here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"console.log('var', var)": {
"prefix": "clv",
"body": "console.log('$1', $1)$0"
}
}
Check for existing issues
Describe the feature
In some situations, LSP will not provide any completions (also there's no plain words completion in Zed currently). Thus one can not trigger snippets without the completion menu. Adding the ability to trigger snippets by TAB or other key without selecting from the completion menu can be helpful.
For example,
RA will provide no candidates here as it's expecting user input enum names. But one might have snippets like
As the completion menu is not popped up, the snippet can not be (selected and) triggered.
(Well, this might now be a good example, but LSP like RA usually provides no completions when expecting names.)
If the feature is added, it works like
then results in
If applicable, add mockups / screenshots to help present your vision of the feature
No response