Jeroen Vannevel
Jeroen Vannevel
Often you'll see people throw exceptions like `new ArgumentException(nameof(param), "my message")`. This is wrong: the correct order is (message, param). Things to account for: - `nameof()` vs string literal -...
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...
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...
This is a result of #517. Apparently we provided a fix that goes from faster -> slower. We'll make that a simple contextual option to keep the option open for...