Open conwid opened 6 years ago
This would be probably possible by changing the whole idea behind the tool and instead of a CodeRefactoringProvider, an Analyzer and a CodeFixProvider should be created. When registering a syntax node action with RegisterSyntaxNodeAction, the language version can be set.
The currently generated guard clauses could be made a lot more elegant by using the nameof operator and throw expressions. But in order to do this, first we should be able to determine the selected C# language version of the project. See the stackoverflow question:
https://stackoverflow.com/questions/50176715/roslyn-net-compiler-platform-get-current-project-c-sharp-language-version