dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.11k stars 4.04k forks source link

Text Editor Font Colors greying out when adding a project with source code. #54627

Open MarioMorazan opened 3 years ago

MarioMorazan commented 3 years ago

Version Used: SourceCode Project-Standard Framework 2.0 Core Project-WPF Class Library

Steps to Reproduce:

  1. Create both projects-use JetBrains Mono Medium Font
  2. Reference the SourceCode project to the WPF class library.
  3. In the class library add a "FeatherNavigatorContentControl" which inherits from content control.
  4. use the control as a parameter in a method

Same behavior with xml parts with the EggNavigationGroup(Abstract Class). doesnt work properly on certain object.

Expected Behavior: Class Syntax shown in the font and color

Actual Behavior: Class syntax font color greys out instead of of using the corresponding color. Mouse over does show that its being implmented the object. best guess something interfering with the analizer.

Texteditor

On removing the reference the text editor behaves as expected.

JoeRobich commented 3 years ago

Hi @MarioMorazan, Can you share the code that reproduces this issue? Also, in which version of VS did you start noticing this behavior?

MarioMorazan commented 3 years ago

https://paste.mod.gg/qudotohuca.csharp

MarioMorazan commented 3 years ago

@JoeRobich i tried on both and on both caused the issue, 2019 and 2022 preview 2.

MarioMorazan commented 3 years ago

it gotta be that source gen, thats the only thing i got on the project. When i add it to another as analyzer happens that issue.

<ProjectReference Include="..\Phoenix.Sevices.Attributes\Phoenix.Services.Attributes.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="true" /_>

MarioMorazan commented 3 years ago

I fixed the bug just by adding a return on the line 133 on the code i sent you. seems like goto and end bracket combination provoked the issue. I also tried with the if clause instead of goto and expected result, colors were working fine. so goto.

image