razor icon indicating copy to clipboard operation
razor copied to clipboard

Git diff utilizes older Razor editor resulting in C# background color showing through

Open NTaylorMullen opened this issue 3 years ago • 5 comments

Ultimately this issue embodies a bigger ask to allow "misc" Razor files in the new Razor editor.

Picture from VS issue: image

VS Issue where this was originally reported: https://developercommunity.visualstudio.com/t/Razor-editor-not-respecting-code-backgro/1574754

NTaylorMullen avatar Nov 09 '21 04:11 NTaylorMullen

More reports:

  • https://developercommunity.visualstudio.com/t/Razor-syntax-highlighting-does-not-work-/1576862
  • https://developercommunity.visualstudio.com/t/Razor-Code-Background-Color:-Cannot-impl/1578592
  • https://developercommunity.visualstudio.com/t/Color-experience-of-Git-Changes-;HEAD-/1590694

NTaylorMullen avatar Nov 09 '21 19:11 NTaylorMullen

@NTaylorMullen judging by your first line you've already imagined a fix here, can you share?

ryanbrandenburg avatar Dec 06 '21 21:12 ryanbrandenburg

@NTaylorMullen judging by your first line you've already imagined a fix here, can you share?

So it'd be a bigger task where we'd hijack "loose" Razor files (ones not associated with a project) and allow our editor to run on those with a reasonable set of defaults. This would in turn result in consistent colorization among both sides. Alternatively we could also add "git diff" aware logic where we only swap the left hand side of the diff to the new editor if the right hand side is the new editor, in such an instance we'd also inherit the project information over. Latter would be a harder implementation most likely where the prior would be a bigger discussion on implications (for instance we'd indirectly change the default editor for .NET Framework Razor files).

NTaylorMullen avatar Dec 06 '21 21:12 NTaylorMullen

Of note: This is not a Razor or LSP specific thing. Roslyn (with LSP off) also experiences color differences: image

Does that change your prioritization preferences @NTaylorMullen?

ryanbrandenburg avatar Dec 06 '21 21:12 ryanbrandenburg

Does that change your prioritization preferences @NTaylorMullen?

Ah as from being a 'candidate' to backlog? If so, I don't think so only because the old/new Razor editor are a bit more jarring

NTaylorMullen avatar Dec 06 '21 21:12 NTaylorMullen