Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Visual Studio 2015 from Colorizing Background at Breakpoint in Lambda Expression

I'm trying to prevent Visual Studio 2015 from colorizing code blocks when at a breakpoint within a lambda expression.

(Screen shot below).

It's very distracting for me, and I would like to prevent this behavior, but can't figure out how to either A) prevent it altogether, or B) change the background color that it's using to black so that the effect is invisible.

I'd greatly appreciate any insight.

To reproduce it, just enter this code, set a breakpoint at the "for" loop, and run it. When the breakpoint is hit, the entire Lambda expression will colorize as shown below (exact colors dependent on your color scheme, presumably).

    public delegate void funcType();
    static void Main(string[] args)
    {
        ((funcType)(() => 
        {
            for (int i=0; i< 10; i++)  // <<== Set Breakpoint Here, and run to it
            {
                Console.WriteLine("Test line to show colorization.");

            }
        }))();
    }

Problematic Colorization

Per Hans Passant's question, here are all the Extensions that are installed in Studio 2015.

It's important to note that this is NOT an EDITOR issue. This happens at runtime only, when the DEBUGGER stops at a breakpoint inside a Lambda expression.

Page 1 of 3

Page 2 of 3

Page 3 of 3

like image 646
BRebey Avatar asked Mar 02 '18 21:03

BRebey


2 Answers

For those of you still searching in VS 2019 etc. it's the "Active statement" option in fonts and colors in the tools/Options menu.

like image 167
Neeraj Avatar answered Oct 26 '22 11:10

Neeraj


To change the background color of the current line, when a normal breakpoint is hit in debugging, you need to alter the value of Item Background under Current Statement.

To do this from the main menu go:

Tools -> Options -> Environment -> Fonts and Colors

and then set the value to black.

enter image description here

I confirmed this by setting a breakpoint in a lambda and setting the property to lime green. e.g.

enter image description here

like image 40
Fraser Avatar answered Oct 26 '22 12:10

Fraser