roslynator
roslynator copied to clipboard
Roslynator is a set of code analysis tools for C#, powered by Roslyn.
It is well known that there is an Extract Method refactoring in VS. Is it possible to add a refactoring to _Extract Local Function_?
**Product and Version Used**: Roslynator 2019 - Version: 2.1.3 **Steps to Reproduce**: - Write an async method. - Call it from inside of another method. - Try to refactoring by...
This ```csharp try { return Load(path); } catch (IOException) { } catch (UnauthorizedAccessException) { } catch (XmlException) { } ``` can be replaced with this ```csharp try { return Load(path);...
Code along these lines: ```csharp var (foo, bar, quux) = MethodThatReturnsATwoTuple(); foo.DoSomething(); // bar is never used and could be discarded quux.AnotherThing(); ``` could be rewritten as: ```csharp var (foo,...
https://docs.microsoft.com/en-us/dotnet/csharp/deconstruct#deconstructing-a-tuple It would be extremely useful if we could convert e.g. the following: ```csharp (var foo, var bar) = MethodThatReturnsATwoTuple(); ``` to e.g.: ```csharp var (foo, bar) = MethodThatReturnsATwoTuple(); ```
Roslynator Refactorings 2017 up to and including 2.1.1 When refactoring, and flipping conditional code around, you can sometimes end up with something like ``` int i = 0; while (i...
Collections of type `IDictionary` implement `IEnumerable` and also offer direct `Values` and `Keys` enumerators. For these collections, I would like Roslynator to identify this kind of LINQ expression: `collection.First().Key` or...
An analyzer could detect this pattern: `dictionary.TryGetValue(key, out var _)` and suggest to turn it to `dictionary.ContainsKey(key)` This can possibly be extended to other similar methods in the .NET Framework...
The [Parameter Object refactoring](https://refactoring.com/catalog/introduceParameterObject.html) is a common refactoring, described by Martin Fowler in his book *Refactoring, Improving the Design of Existing Code*. It would be a welcome addition to Roslynator...
When "Quick Actions" is invoked with the cursor on an integral-type cast, like `(uint)value` It would be nice to suggest adding a checked() around the cast-expression `checked((uint)value)` But only if...