DEV Community

Hannes Calitz
Hannes Calitz

Posted on

2

For anyone struggling with code folding on JS files in Visual Studio 2017

Since installing Visual Studio 2017 I have been struggling to get my code folding to work in Javascript. I can't begin to explain how many hours I have wasted trying to find a solution for a problem I was having, and trust me, I have Googled like mad. So in an attempt to help someone who might be struggling with the same issue and kind find the answer, here are the steps I took to fix it.

  1. Open a .JS file.
  2. In the editor window, right click and navigate to Outlining > Stop Outlining.
  3. Right click again and navigate to Outlining > Start Automatic Outlining.
  4. Close the file, and reopen it.

The issue should not be fixed. It's a simple trick, and I have no idea why outlining does this, but hey, this fixes the issue.

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (4)

Collapse
 
heyitshannes profile image
Hannes Calitz

UPDATE: Disabling the new Javascript Language Service did the trick to permanently fix this issue. This can be disabled by going to Tools > Options > Text Editor > Javascript/Typescript > Language Service.

Collapse
 
fabyyiola profile image
Fabiola Avila

Thank you SO MUCH this was driving me nuts and i never thought about doing these very simple steps, honestly i was thinking about downgrading i surfed online for more than 5 hours... thank you, thank you, thank you!

Collapse
 
bhardesushama profile image
bhardesushama

I tried this Not working for me

Collapse
 
ben profile image
Ben Halpern

Thanks for this!

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay