Closed zardoy closed 1 year ago
This should be fairly easy as all templates already have their name assigned. I'd start with something simple like:
"postfix.disabledTemplates": ["forof", "var", "etc."]
https://github.com/ipatalas/vscode-postfix-ts/commit/36650a2864737cb04502e6d59ee4369d31f417f5
That was easy :) I need to add some tests for that too before releasing.
@ipatalas WDYT of renaming it postfix.disabledBuiltinTemplates
since it actually disables builtin templates only
Also change setting schema so it can be configured via settings UI:
{
"type": "array",
"markdownDescription": "Name all built-in templates that you want to disable, eg. `forof`",
"items": {
"type": "string"
},
"uniqueItems": true,
"default": []
}
All right, new version released along with this feature.
TBH I used that too, for instance to disable rather useless var
template.
Out of curiosity - which templates did you disable any why? This might bring some more ideas to the table.
Out of curiosity - which templates did you disable any why
Legacy:
var
for
(we have forof
, if need index, using custom: for (const [i, val] of Object.entries(...)) ...
)Just not needed:
foreach
(using forof
)cast
(using castas
)await
to include function-call
onlyundefined
, null
to body: if ({{expr}} === undefined) ${1:return}
else
to body: if (!{{expr}}) ${1:return}
Also I think arg
with simple body $1({{expr}})$2
should be included out of the box and super useful and general purpose.
Hi! As I understand, with https://github.com/ipatalas/vscode-postfix-ts/issues/40 there is an option to override, but not disable postfix as having an empty
when
makes postfix show anywhere.I propose following:
false