Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2008 is autoformatting my javascript in a .js file and I want it to stop

Duplicate: VS2008 Removes my Indentation in .js file (Turn off auto formatting in the formatting tab)

Hi I have VS2008 and ReSharper 4.0 and I'm having a problem. When I enter a new line of code in any .js file, it goes thru and reformats all of the JavaScript braces. I've found where in ReSharper where I can set brace behavior for C# (.cs) files. I've searched in VS2008 and couldn't find any settings for JavaScript code.

    function doSomething(withMe) 
    {
        for (idx in myArray) 
        {
            if (myArray[idx] != -1) 
            {
                return "yep";
            }
        }
        return "nope";
    }

Become this (which I like better, but my team likes the above instead)

    function doSomething(withMe) {
        for (idx in myArray) {
            if (myArray[idx] != -1) {
                return "yep";
            }
        }
        return "nope";      
    }

It's getting painful to go back and re-add the CRs everywhere. Where can I find the setting to make this madness stop.

like image 640
DMCS Avatar asked Dec 23 '22 12:12

DMCS


1 Answers

Go To Tools -> Options.

Expand Text Editor

Expand JScript

Uncheck all of the formatting options.

alt text

like image 193
cjibo Avatar answered Dec 29 '22 11:12

cjibo