VSDiagnostics
VSDiagnostics copied to clipboard
A collection of static analyzers based on Roslyn that integrate with VS
We should use a call like the following instead: > SyntaxFacts.GetText(SyntaxKind.ElseKeyword)
Enumerators should be `struct`'s per the BCL and Roslyn guidelines. Explanation here: http://stackoverflow.com/a/3168435/1864167 From Roslyn guidelines: > Avoid using foreach over collections that do not have a struct enumerator. https://github.com/dotnet/roslyn/wiki/Contributing-Code
We already have a diagnostic that warns you when you're re-assigning `this` inside a struct. Now, let's add a diagnostic that warns you whenever you try to assign a field...
Test our analyzers/code fixes with code that uses `this.Foo` rather than just `Foo`. These use different node types and could cause a crash if we do not account for them.
It looks for ref/out usages in the current `ClassDeclarationSyntax` but it doesn't check whether there might be multiple syntax trees to look at. It's the same idea as in https://github.com/Vannevelj/VSDiagnostics/pull/541/files#diff-a0ce80244f17c3c3f091f71c63dabbcbR61
I think it's already covered but I'd like an explicit test that covers `this = default(MyStruct)` for `StructDoesNotMutateSelf`. Also: there's a test with some bad indentation -- fix that
If a method that returns a value is invoked without actually using the result, we should show a warning. For example these produce warnings: ``` ToString(); new StringBuilder().ToString(); "test".split("e"); ```...
NullableToShortHandCodeFix can make use of our alias mapping helper: ``` switch (type.MetadataName) { case "Int32": typeNameString = "int"; break; case "UInt32": typeNameString = "uint"; break; case "Int64": typeNameString = "long";...
Scan all comments and look for the strings ``//TODO` and `// TODO` (including case-insensitive) and show an info message for that location. We wouldn't want the user to miss some...
When instantiating a new object we expect it to be assigned to something. Show warnings in case of: ``` new StringBuilder(); ``` Don't show warnings in case of: ``` return...