# Folding comments in VSCode

**URL:** <https://discourse.julialang.org/t/folding-comments-in-vscode/109896>\
**Category:** New to Julia\
**Tags:** vscode\
**Created:** [February 7, 2024, 8:33pm UTC](https://discourse.julialang.org/t/folding-comments-in-vscode/109896 "2024-02-07T20:33:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cby](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@cby](https://discourse.julialang.org/u/cby)\
**Post date:** [February 7, 2024, 8:33pm UTC](https://discourse.julialang.org/t/folding-comments-in-vscode/109896/1 "2024-02-07T20:33:46Z")

</div>

I moved over from Atom belatedly but find that the shortcuts for folding all or folding block comments are not working with Julia block comments. Atom also used to fold a series of single line comments, which I found helpful.

Is there a way to implement both of these in VScode?

---

<div class="post-metadata">

**Author:** ![\_bernhard](https://avatars.discourse-cdn.com/v4/letter/_/bc79bd/32.png) [@\_bernhard](https://discourse.julialang.org/u/_bernhard)\
**Post date:** [February 8, 2024, 7:54am UTC](https://discourse.julialang.org/t/folding-comments-in-vscode/109896/2 "2024-02-08T07:54:00Z")

</div>

Not exactly what you’re asking, but I found out recently, that you can put the following comments around an (almost) arbitrary part of code to make it a foldable region in VSCode:

```julia
#region >>ARBITRARY TEXT<<
...
code
...
#endregion

```

Almost arbitrary, because the defined region must not intersect another already foldable block (which of course makes sense).

---

<div class="post-metadata">

**Author:** ![Realife\_Brahmin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/realife_brahmin/32/50796_2.png) [@Realife\_Brahmin](https://discourse.julialang.org/u/Realife_Brahmin)\
**Post date:** [December 20, 2024, 11:15am UTC](https://discourse.julialang.org/t/folding-comments-in-vscode/109896/3 "2024-12-20T11:15:13Z")

</div>

Something which didn’t work for me: `# region >>ARBITRARY TEST<<` and `# endregion` (with the spaces after `#`).  
Just in case anyone has the same issues as me (@_bernhard 's answer without space works)
