dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
505 stars 195 forks source link

[FUSE] Section names in cshtml files are not mapped #10857

Open davidwengier opened 2 months ago

davidwengier commented 2 months ago

I'm not actually sure if this is a bug, or just a difference, but right now in design time @section names are mapped to an object in the generated C#, so get classified by Roslyn, and would have to be valid C# identifiers etc. In runtime the section names are just an opaque string, and are not mapped.

This might not really help in tooling at all, but its at least a cause of a failing test so we should sort something out.

(Saw this in the cohost_use_generator branch, so it might not be FUSE, but I'm pretty sure)

jaredpar commented 1 month ago

@chsienki is this FUSE related?

chsienki commented 1 month ago

@jaredpar Yes, but after discussion I'm going to close it as by-design. It's a case where something has always been legal in runtime (and thus the command line compiler) but would fail at design time and squiggle in the IDE. Under fuse we no longer incorrectly squiggle.

Leaving it open right now to track removing the failing test that checks for the squiggle.