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
18.91k stars 4.01k forks source link

`SyntaxGenerator.Declaration` missing interface modifiers #66387

Open Youssef1313 opened 1 year ago

Youssef1313 commented 1 year ago

https://github.com/dotnet/roslyn/blob/89976fde42e8a7cad791798653279a47e2c5599d/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs#L600-L622

Modifiers are missing in interfaces, unlike classes and structs (e.g, file).

Youssef1313 commented 1 year ago

cc @CyrusNajmabadi @kinkeadian25

DoctorKrolic commented 1 year ago

The SyntaxGenerator type is there from 2015, but suddenly ~10 pretty common (IMO) bugs are reported in just past several hours. I wonder, how all they were sitting undescovered in the codebase for all these years...

CyrusNajmabadi commented 1 year ago

SynGen is basically used by a subset of features, and contains with functionally to work well for them. There's a new customer using is to roundtrip all symbols, so it's finding holes that haven't been relevant for it features that sit on it.

Also, most of our features that require a high degree of customizability end up using a different code gen layer that is not exposed. It would be nice to unify all of this. But it hasn't ever been a priority, and it risks many regressions.