-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snippets in VSCode #24
Comments
Hello, I understand your problem but it's not an issue of my extentension, isn't it? 🤓 My thoughts are that {
"loop_BC": {
"prefix": "loop_BC",
"body": [
"ld bc,$1",
"\rloop\tdec bc",
...
]
}
} BUT, if you want to have such variable indent snippets you could define it with tabulators and insert snippet on zero cursor position within the line: {
"loop_BC": {
"prefix": "loop_BC",
"body": [
"\tld bc,$1",
"loop\tdec bc",
"\tld a,b",
"\tor c",
"\tjr nz,loop",
"\t$0"
]
}
} However you still can define your code style in my extension and let the formatter do its business 😉 |
I'm not sure. I thought, your extension acts as default formatter, so this problem related to it. |
@michael3m You can disable built-in plugin formatter (if you're using FormatOnType or FormatOnPaste) OR as I suggesting you few lines above, setup your code-style in settings, enable FormatOnType/Paste and try your snippets. 👍 |
Hello.
VSCode has built-in support of snippets.
But the way they are handled by your great extension is not perfect.
Let me explain.
At this gif you can see, how snippets works in SublimeText - they are perfectly formatted and ready to use right after typing it.
![Sublime](https://user-images.githubusercontent.com/45968127/185743447-87ab6bed-ff9d-4d11-acbb-f94b2d61dd44.gif)
Now, let's add same snippet into VSC:
![snippetTXT](https://user-images.githubusercontent.com/45968127/185743466-fe2313ed-ee3d-4647-b479-380f198f18bc.png)
and then try to use it:
![VSC](https://user-images.githubusercontent.com/45968127/185743478-0a63dd71-e8a9-4102-96e7-4191540ecdc2.gif)
As you can see, snippet is not properly formatted (pay attention to the label) and demands some handwork to get it to the usable state.
![basic](https://user-images.githubusercontent.com/45968127/185743650-686a9489-bcf2-44cc-8c00-7a797082f6d1.gif)
And note, please - I've used a very simple example of snippet - look at this one:
In VSCode, we'll need much more formatting work in this case.
So, question is simple: is it possible to solve this problem and use snippets with more efficiency?
The text was updated successfully, but these errors were encountered: