frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: Making #regions actually useful in VSCode

https://github.com/alythobani/vscode-region-helper
10•alyt•10h ago
Hey HN,

For anyone unfamiliar: you can use `#region My Region` and `#endregion` comments to organize your code into foldable "regions".

Before building this extension, I'd use regions as a last resort, e.g. for large test files or classes that aren't worth splitting up more, or code that can't be split at all. They'd help somewhat, but the lack of tooling made them pretty underwhelming to work with. So I built out Region Helper, which as of yesterday's release provides:

- Commands / hotkeys for jumping between / selecting regions

- Fuzzy search (like "Go to Symbol" but for regions)

- A "Regions" tree view (interactive: click to navigate, and auto-highlights cursor's active region)

- A "Full Outline" tree view: like the builtin Outline, but incorporates regions (also interactive)

- Diagnostics: blue squiggle warnings when you have unmatched #region / #endregion markers

- Builtin support for 49 languages, customizable via settings

- An API for accessing Region Helper's data, so devs can build their own region extensions without needing to re-parse regions

- (New) Expand/Collapse All tree actions and persisted tree item collapse state across sessions

It's also performant even on massive files, e.g. TypeScript's ~50K LOC `checker.ts`.

These days, I personally enjoy using regions way more, and also add them more often to my code, now that they also serve as quick-jump points while navigating a file. Still definitely important not to overuse them, but I don't find them to be nearly as much of a code smell as I might have before.

If you're extra curious, you can check out Region Helper's source code to see a few real examples of where I've used them while building out this extension.

P.S. if you didn't know, your VSCode settings files (e.g. `settings.json`) are JSONC and support `// #region` and `// #endregion` markers. Since they can't be split into multiple files, regions are a pretty convenient way to organize them.

Feel free to share your own thoughts on regions and whether or not you find them useful ever, always curious to hear others' opinions.

Comments

alyt•10h ago
Btw, another extension I'd personally recommend is Region Highlighter by 'Wiensss', which makes regions easier to see in the editor itself by coloring them, and also provides a command for making regions (although it is limited in language support). I don't currently use any other region extensions.

Region Highlighter: https://marketplace.visualstudio.com/items?itemName=Wiensss....

badmonster•3h ago
Is there any plan to support nested region collapsing/expanding directly from the editor, similar to how VSCode handles folding for functions or classes?
alyt•42m ago
I might be misunderstanding what you're asking, but VSCode already makes regions foldable by default.

That said, my extension does support regions in more languages than VSCode currently supports, so maybe you're thinking of a particular language in which VSCode doesn't make regions foldable, that my extension could fill the gap for?

Mnemonic Finder – Extension to find mnemonic meanings by right-clicking words

https://chromewebstore.google.com/detail/mnemonic-finder-–-right-c/dlfjdmnhefchjkndgpfjobabibdomifh
1•harivpanjwani•4m ago•1 comments

Show HN: VibePM, a Lightweight Task Manager for Cursor

https://getvibepm.com
1•baetylus•4m ago•1 comments

Grml 2025.05 – codename Nudlaug – Release Notes

https://grml.org/changelogs/README-grml-2025.05/
1•pabs3•5m ago•0 comments

OSSF Best Practices

https://github.com/ossf/wg-best-practices-os-developers
2•Brysonbw•8m ago•0 comments

I made a floor out of popsicle sticks

https://buttondown.com/redmonk/archive/redmonk-may-2025-update/
1•mooreds•8m ago•0 comments

Microsoft provided AI to Israeli military but denies use to harm people in Gaza

https://apnews.com/article/microsoft-israel-military-gaza-hamas-artificial-intelligence-20b2adb438b39ee9cb6eb2f52c1ae44a
1•c420•10m ago•0 comments

Regular Expression Denial of Service – ReDoS

https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
1•Brysonbw•11m ago•0 comments

New stem cell model sheds light on human amniotic sac development

https://www.crick.ac.uk/news/2025-05-15_new-stem-cell-model-sheds-light-on-human-amniotic-sac-development
1•gmays•12m ago•0 comments

The Arm Evolution: From IP to Platform for the AI Era

https://newsroom.arm.com/news/new-arm-product-naming-architecture
1•layer8•16m ago•0 comments

A rare snail is filmed laying an egg from its neck

https://apnews.com/article/zealand-snail-egg-neck-powelliphanta-augusta-3cb8082547a83b8c47848b6621c06cb0
3•gmays•21m ago•0 comments

Google Worried It Couldn't Control How Israel Uses Project Nimbus, Files Reveal

https://theintercept.com/2025/05/12/google-nimbus-israel-military-ai-human-rights/
3•zhengiszen•22m ago•0 comments

When was peak message in a bottle?

https://interconnected.org/home/2025/05/16/bottle
1•LorenDB•29m ago•0 comments

Soviet Refugee Igor Tulchinsky Became a Hedge Fund Billionaire

https://www.forbes.com/sites/johnhyatt/2025/05/16/this-billionaire-quant-is-turbocharging-his-trading-models-with-chatgpt-style-ai/
2•walterbell•37m ago•0 comments

Is there anything similar to xcancel or nitter but for Bluesky?

3•ranoutofnames•39m ago•0 comments

It's Not Just a Feeling: Data Shows Boys and Young Men Are Falling Behind

https://www.nytimes.com/2025/05/13/upshot/boys-falling-behind-data.html
3•jnord•40m ago•0 comments

Constrained Random Walks

https://github.com/ivanbelenky/pywalker
1•ivanbelenky•41m ago•0 comments

MIT Says It No Longer Stands Behind Student's AI Research Paper

https://www.msn.com/en-us/money/other/mit-says-it-no-longer-stands-behind-student-s-ai-research-paper/ar-AA1EUFwO
2•jnord•42m ago•0 comments

(How) I Use Amp

https://ampcode.com/how-i-use-amp
1•handfuloflight•42m ago•0 comments

Supplements

https://near.blog/supplements/
1•bilsbie•50m ago•0 comments

Phone scammers pretending to be 'from Amazon' trick woman out of $1M

https://www.seattletimes.com/nation-world/phone-scammers-pretending-to-be-from-amazon-trick-woman-out-of-1m/
1•rwc9•50m ago•1 comments

Nintendo's May 2025 Policy Updates

https://consumerrights.wiki/index.php?title=Nintendo%27s_May_2025_Policy_Updates
1•raybb•51m ago•0 comments

The Collapse of GPT

https://cacm.acm.org/news/the-collapse-of-gpt/
23•pseudolus•1h ago•16 comments

Pallene: A statically typed ahead-of-time compiled sister language to Lua, with

https://github.com/pallene-lang/pallene
3•todsacerdoti•1h ago•0 comments

The Connoisseur of Desire

https://www.nybooks.com/articles/2025/05/29/the-connoisseur-of-desire-the-annotated-great-gatsby/
5•samclemens•1h ago•0 comments

AI job alerts that match your skills

https://jobsphere.onboardai.net/
2•Gurnoorsb•1h ago•2 comments

They Were Identical 'Twinnies' Who Charmed Orwell, Camus and More

https://www.nytimes.com/2025/05/04/books/review/the-dazzling-paget-sisters-ariane-bankes.html
11•lermontov•1h ago•1 comments

AI Food Detection and Free Calorie Counter App by Recipe

https://whatthefood.io
2•OdehAhwal•1h ago•0 comments

Nord Stream 2 Enters Debt Restructuring Deal with Creditors

https://oilprice.com/Latest-Energy-News/World-News/Nord-Stream-2-Enters-Debt-Restructuring-Deal-with-Creditors.html
1•PaulHoule•1h ago•0 comments

Better air quality is the easiest way not to die

https://dynomight.net/air/
7•haltingproblem•1h ago•0 comments

Jane Street-Millennium Trade Secrets Fight Ends in Settlement (2024)

https://www.bnnbloomberg.ca/business/international/2024/12/05/jane-street-millennium-settle-india-options-trade-secrets-case/
1•walterbell•1h ago•0 comments