ipatalas / vscode-postfix-ts

Postfix notation for TypeScript/Javascript - extension for VS Code
MIT License
159 stars 43 forks source link

Using .log for object #37

Closed Spodera closed 4 years ago

Spodera commented 4 years ago

Environment :
TS/JS postfix completion : 1.9.1

When I type <number | string | variable name | context>.log the snippet is shown and it works perfectly .

For example :

78.log
"foo".log
foo.log
this.log

But when I start to use this shortcut for an object <object>.log , the Postfix templates context menu item isn't shown, so I can't use the snippet .

For example :

{foo : "foo"}.log

By the way, your extension is really cool 👍 for this project !

ipatalas commented 4 years ago

Hi,

oh.. that was actually by design :) Then I forgot to extend that... it's a pretty simple change. I'll have a look at that when I only find spare hour or two :)

ipatalas commented 4 years ago

Oh.. didn't notice it's an object literal. Well... I've never been using that in such context and it seems it's little bit more complex than I initially thought. Actually no template will work in object literal context. I need to think about it.

ipatalas commented 4 years ago

Published new version, enjoy!