Re:Ask HN: What extensions/packs of VS Code are must for web...
by rolisz on Friday November 19, 2021 @11:32AM
(#29278992)
I just tried enabling that this week, but I found that I often press Ctrl-S out of habit, even when I have syntactically invalid code and then the autoformatter messes things up royally and I get lost. For now, I just memorized the shortcut for autoformatting and I'm running it manually when I feel the need to "tidy up" the code.
[ Parent
| on HN ]
Re:Ask HN: What extensions/packs of VS Code are must for web...
by goodells on Friday November 19, 2021 @11:39AM
(#29279067)
Mine won't do any auto-formatting when the syntax is invalid, so when I hit CMD + S and it _doesn't_ format it's a cue to start looking for errors.
Re:Ask HN: What extensions/packs of VS Code are must for web...
by Waterluvian on Friday November 19, 2021 @11:43AM
(#29279128)
The only issue I have with this is that I wish it would chirp more loudly when there's a syntax error.
Every so often I don't notice red underline and I begin wondering why my autoformatter and autocomplete aren't working anymore.
Maybe a red border or something any time a file's syntax is invalid.
Re:Ask HN: What extensions/packs of VS Code are must for web...
by trevyn on Friday November 19, 2021 @11:02PM
(#29285458)
I’m a big fan of Error Lens.
Re:Ask HN: What extensions/packs of VS Code are must for web...
by Waterluvian on Friday November 19, 2021 @11:35AM
(#29279011)
I’m curious what language you’re working on and what formatter it uses? In my experience many formatters will not run if the AST is invalid.
Re:Ask HN: What extensions/packs of VS Code are must for web...
by rolisz on Friday November 19, 2021 @11:46AM
(#29279178)
I'm using Python and PyCharm. It happily underlines the invalid syntax and then reformats things more or less randomly.
Re:Ask HN: What extensions/packs of VS Code are must for web...
by randomluck040 on Friday November 19, 2021 @07:20PM
(#29284387)
There is a package called „black“ (pip install black) that formats code according to PEP8 (most of the time). You might take a look if you’re interested. I’m using it occasionally and it didn’t do anything royally stupid until now. If the code isn’t syntactically correct it won’t run.