weakish/vscode-complete-statement

trailing comma idea

Closed this issue · 3 comments

firstly, thank you so much.
i'm the on who recently moved from atom to vscode as atom is way too slow.
and there was some feature in some atom package that adds comma at the end of code line.

it is very useful when writing objects in javascript or typescript.

i'll try my best to implement this feature on my own, but i hope not you get angry after my fuzzy code. (since i'm not that familiar with typescript)
anyway, thank you again!

adds comma at the end of code line.
it is very useful when writing objects in javascript or typescript.

i'll try my best to implement this feature on my own

As mentioned in the README,
"This extension does not understand semantics of programming languages",
so it will not understand arrays or objects and complete the line with , instead of ;.

However, you can bind an extra shortcut to completing the line with comma.

Close for now. Pull requests are welcome.

so it will not understand arrays or objects and complete the line with , instead of ;

I was wrong. For JavaScript objects, I implemented a naive parser.

Thanks for suggesting this idea.

I was wrong. For JavaScript objects, I implemented a naive parser.

It turns out this naive parser is buggy.
I removed this function before v0.2.0 release.