sonar-dotnet
sonar-dotnet copied to clipboard
Introduction of Syntax node abstractions
Why at #5741 I had the idea that the code would have been easier if there was something possible like the following:
var conditional = (Language.)Syntax.As.Conditional(epxression);
return Syntax.IsNullLiteral(conditional.WhenTrue) || Syntax.IsNullLiteral(conditional.WhenFalse);
As I did not want to mess up that PR with this idea, I made this one. I took another example: BinaryExpression, but the idea is the same. Add a builder/factory to the SyntaxFacade that returns an abstaction of a SyntaxNode that is a language independent wrapper on top of specify SyntaxNodes.
What do you think?