roslyn-sdk icon indicating copy to clipboard operation
roslyn-sdk copied to clipboard

VS 16.9 Preview 3: Syntax Visualizer is highlighting the color of non selected text along with selected text

Open Raviuppa opened this issue 4 years ago • 6 comments

The newly introduced Syntax Visualizer in VS 2019 Update 9 Preview 3 is highlighting the color of non selected text along with the selected text. For eg. in this case, when I select "MyTestClass" to change the color of the text, the same color is also being applied to "Program" class name and as well to "Console".

Steps to Reproduce the Problem.

  1. Create a new .NET Core Console Application
  2. Create a class "MyTestClass" as below
class Program
{
    class MyTestClass
    {
        public MyTestClass()
        {

        }
    }
    static void Main(string[] args)
    {
        Console.WriteLine("Hello World!");
    }
  1. Now highlight the "MyTestClass" in "class MyTestClass" above.
  2. Change the color of the selected text through Syntax Visualizer to lets say Green and click OK.

Observed Behavior: Now observer, not only the color of "MyTestClass" is changed to Green but also the text of "Program" and "Console" also changed to Green.

Expected Behavior: Change of color should only applied to selected text.

Raviuppa avatar Jan 25 '21 01:01 Raviuppa

This is by design. Color is supposed to represent the "Enhanced Colors" that were introduced in VS 2019. The "classification" text is supposed to help identify that you're changing the color for those classifications. For class names, it would show "Class Name" and the color. Here's an example from my editor

image

ryzngard avatar Jan 25 '21 17:01 ryzngard

Thank you @ryzngard . Can we document this to avoid the confusion based on the description we have in the release notes?

Raviuppa avatar Jan 25 '21 19:01 Raviuppa

@Raviuppa can you explain why you want to only change the color of a single selection of text? What was your intention behind that?

jmarolf avatar Jan 25 '21 19:01 jmarolf

@jmarolf, For example, if I want to change the color of a specific Class, this feature is not working as expected.

Raviuppa avatar Jan 25 '21 19:01 Raviuppa

@Raviuppa I see, can you outline more about your scenario? If we were to build this featuere what problem would it be solving for you?

jmarolf avatar Jan 25 '21 19:01 jmarolf

@jmarolf, I am not specifically looking for any broader usage at this time but the text in the Preview Release notes and this by design behavior is causing little confusion so is the request to change the documentation.

As per Visual Studio 2019 Preview Release Notes, the highlighted text is what causing the confusion.

· The Syntax Visualizer (installed with the .NET Compiler Platform SDK) now shows the current foreground color for enhanced colors. Simply use the visualizer to navigate to the text you want to change colors for, or select in the editor, and then click on the classified color to change it.

Sincerely, Ravi ఉప్పలూరు.

Raviuppa avatar Jan 25 '21 20:01 Raviuppa