Closed vladdeSV closed 3 years ago
As of right now, I have only specified identifier
, which mean the postfix does not appear on the built-in types. My attempt to remedy this was to remove any criteria ("when": [],
), but that caused other unexpected behavior when applying to return types
- public ping = async (): boolean.promisify=> {
+ public ping = Promise<async (): boolean> => {
// ...
}
Hi. Thanks for reporting. There is no way to make it work in current version. The underlying engine is slightly broken in that matter. Luckily It's not that hard to fix it so I'm gonna fix it in next release. I already have a semi-working version - still trying few edge cases.
I like the idea of this snippet so much that I'd like to include it as built-in snippet if you don't mind - what do you say?
As a side effect of that change I will be finally able to fine tune some of the snippets so that they don't show in type context.
const x : boolean.log
didn't make much sense. Many other snippets suffer the same but so far I though it will be more effort to fix that. Thanks for inspiration.
what do you say?
That will be a great addition! Looking forward to the next release 😋
Ok, the release is out! Enjoy :)
Added additional when
option: type
which can be used for other custom templates like this but you should not need this for promisify
as this is also a new built-in template :)
I have a snippet for TypeScript which "promisifies" values, and it works great for custom types
However, I cannot target built-in types such as
boolean
,void
, etc. in"when": [...]
.