Create analyzer to correctly guide users using GetDeclaredSymbol() and GetSymbolInfo() #337
Labels
Area-Microsoft.CodeAnalysis.Analyzers
Feature Request
help wanted
The issue is up-for-grabs, and can be claimed by commenting
Milestone
The difference between these two APIs is not always clear to people new to Roslyn. See this Stack Overflow question as an example.
I'm not 100% on the rule, but could we make an analyzer that says:
SyntaxNode
withDeclarationSyntax
in the name toGetSymbolInfo()
, issue a warning.SyntaxNode
withoutDeclarationSyntax
in the name toGetDeclaredSymbol
, issue a warning.I'm not 100% sure if this rule correctly covers all cases, but it might be a good starting point. I'd love to get some feedback on whether or not this approach would make sense.
The text was updated successfully, but these errors were encountered: