Ask HN: What extensions/packs of VS Code are must for web/developers to install?
They may increase productivity tremendously
They may only be common among experienced developers
They may be used at innovative startups
They may even be used at FAANGs
They need not cater to web developers only
They may help amazingly to learn coding
They may useful for a new programmer
The criteria is anything that has helped you from all diverse sectors of the industry.
117 comments
[ 1.8 ms ] story [ 183 ms ] threadhttps://marketplace.visualstudio.com/items?itemName=bobmagic...
Why would this matter?
Working for the MMAAAN...
...you gotta use these fancy VS Code extensions
TA MMAANN?
https://code.visualstudio.com/docs/remote/containers
2. If you CI you dev-container and publish to a private registry, only one computer is spending the time installing and setting up dependencies. Everyone else simply bases their local image off of that one (and saving productive working time).
3. If you mess up the dev environment with some failed experiment, simply recreate the container and carry on.
4. The dockerfile is a form of documentation: what is needed for this thing to run.
5. If you use Github, you can run your environment in a browser if you are in a pinch. I've only done this once, but it was hella useful.
https://code.visualstudio.com/docs/remote/ssh
For web dev I like: Error Lens, Version Lens, Tailwind CSS IntelliSense & Highlight Matching Tag
"ES7 React/Redux/GraphQL/React-Native snippets"
Vim
I will hit ctrl+s after every few lines of code or so, allowing my "coding wingman" to tidy things up as I go. It releases me from caring, in the slightest, about formatting, so I'm focused entirely on writing syntactically valid code, and letting the formatter worry about the deterministic minutiae that is formatting.
The reason I like doing this in real-time rather than some `run formatting before committing` workflow is that I benefit instantly from tidy code as I'm writing it.
If you are _ever_ thinking about formatting and you spend time manipulating proper spacing and layout, semicolons, or other language-specific quirks yourself, you may be wasting time that could be spent on the non-trivial parts of writing code. Consider trying it!
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.
https://prettier.io/docs/en/install.html
Install the plugin and add this config:
TypeScript, JavaScript, JSON: Prettier
HTML: Built-in
Rust: rust-analyzer + whatever the formatter is built in to Rust's toolchain.
XML: XML Tools
They all operate using the same API, I think, so setting up `formatOnSave: true` is all I have to do for most of them.
It still amazes me that C# doesn't have good opinionated formatter. It has lot of non-opinionated formatters, but I found one: Csharpier [1], check it out. It's slow, but at least the author is trying.
[1]: https://github.com/belav/csharpier
CSharpier started as a prettier plugin, and it was definitely slow then. ~30 minutes for a project with around 10k files if I remember correctly and the formatting was just barely implemented. At this point it is ~40s without --fast, or ~27s with it. CSharpier is stable enough that I should make --fast the default option.
Individual file formatting is a bit slow which is the overhead of starting up a new .Net console app every time. NativeAOT is a potential solution, but probably not until .net7. Building plugins that keep csharpier running in the background and piping files to it is the other option. That is one of the next things on my list.
Helps keep the entire code base formatted consistently.
Prettier - Code formatter https://marketplace.visualstudio.com/items?itemName=esbenp.p...
Not caring about this saves me so much mental capacity, I would recommend it
For JS formatting, I either use Rome or ESLint.
- The Prettier team has decided that they will not be adding new options. Since they explicitly bill themselves as an opinionated formatter, that seems reasonable to me.
- There is a fork of Prettier that supports breakBeforeElse, and this fork was suggested by a member of the Prettier team as a way for the requester to get this option
2. And occasionally skimming through https://marketplace.visualstudio.com/search?target=VSCode&ca...
https://marketplace.visualstudio.com/items?itemName=yandeu.f...
I find myself in a job with 30ish coupled microservices, because they are coupled flipping between them is not unusual... But trying to set up a project that has all of them as parallel sub-projects, (a) gives me no way to impose a folder hierarchy and (b) it seems like I have to set up Cloud Code and each individual subproject separately.
So I am using VS Code for java dev despite its shortcomings (in particular in the same setup it does not work well with a monorepo hosting those other repos as git submodules, so you want to just load up a plain folder with the microservices in subfolders, but then the Java plugins do not recognize that you have loaded a Java project...) and like it's ok but I did prefer the testing of IntelliJ and some other features... But is there anyway to take these things that take 5 minutes or less to configure on a single microservice/subproject, and apply them to everything with 10 minutes of effort, rather than hours of doing it by hand?
Look into
Alt+1 → Scratches and consoles → Extensions
And here's a random "blog post" with some additional examples:
https://gist.github.com/gregsh/b7ef2e4ebbc4c4c11ee9
There is in NetBeans so I guess there is one for IntelliJ as well.
https://marketplace.visualstudio.com/items?itemName=RomanPes...
https://marketplace.visualstudio.com/items?itemName=yzhang.m...
Other than that, the kubernetes extension is something that I use often enough although others say the Lens IDE is better for this purpose.
I think it's more about comfort levels. So if you're already comfortable doing this in IDEA, you don't stand to gain anything. Also, for Jvm languages, idea is still a better choice than vscode
[1]: https://marketplace.visualstudio.com/items?itemName=GrapeCit...
[2]: https://marketplace.visualstudio.com/items?itemName=mechatro...
2. Conventional Commits
3. Git Graph
4. IntelliJ IDEA Keybindings (as someone who uses both it's a blessing)
5. Path Intellisense
6. Peacock (changes color of vscode instance when it's in the background, usefull when multiple are open)
1. I already used VSCode as my daily driver. 2. Backend team all used IDEA for their Java codebase/had some workflows designed with it in mind. 3. I familiarized myself with IDEA for working on the backend, but used VSCode for the rest of the codebase.
An interesting case of the team watching the extensions ecosystem for ideas to make the core product better.
- "Bookmarks", to persistently mark some lines and easily find them later (there's even an explorer pane with the bookmarks by file). It's must have when navigating a big code base
- "Todo Tree", to list all the TODOs and FIXMEs from the codebase in a panel
I think "project specific" stuff is all I actually need and would recommend to someone else, including a language appropriate auto formatter. For me currently that‘s Prettier, ESLint and Apollo GraphQL.
Because I am the kind of nerd that has on old copy of the Apple Human Interface Guidelines on their bookshelf and VS Code is leagues above any well designed editor for TS.