Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 Javascript Outlining way too much

Visual Studio 2015 seams to outline all the multiline javascript code. I have a simple code like this:

    $(document).ready(function ()
    {
        var x = {
            test1: 1,
            test2: 2
        };

        if (1 == 1)
        {
            // this is a test
        }

    });

Visual Studio 2015 outlines it like this when I press Ctrl+k, Ctrl+O: enter image description here Is it possible to turn off outlining inside the functions? I just want the outlining at the function level.

like image 313
Kathy Judd Avatar asked Jul 22 '15 14:07

Kathy Judd


People also ask

How do I stop outlining in Visual Studio?

Tools >> Options > Text Editor > Transact-SQL > IntelliSense > Uncheck Outline statements. For me, the vertical line isn't just visually distracting, it gets in the way anytime I want to select an entire line using my mouse.

What is Visual Studio outlining?

PHP Editor allows you to collapse the content of functions, classes, namespaces and PHPDoc to have a better overview of your code.

What is outline in Visual Studio code?

The Outline view is a separate section in the bottom of the File Explorer. When expanded, it will show the symbol tree of the currently active editor. The Outline view has different Sort By modes, optional cursor tracking, and supports the usual open gestures.


1 Answers

No you cant do it BUT there is the excellent Web Essentials which will outline regions in javascript!

You create a region after a comment like this //#region & end it //#endregion

So what I do is forget about using keyboard shortcuts and manage it manually with the mouse, bit more work but I can have 'working' regions of code open and huge chunks closed and this allows me to easily swap working and non working regions.

EDIT

Web essentials has changed a lot, I don't use it anymore. I now use a Advanced JavaScript outlining which does the job nicely.

EDIT VS2017 Ok so the above don't work with VS2017 so now I use Mads Kristensen's Javascript Regions

like image 173
tinmac Avatar answered Oct 18 '22 09:10

tinmac