All Questions
Tagged with code-formatting resharper
50
questions
1
vote
1
answer
158
views
How do I stop ReSharper/Rider from doing this: "}, {"
How do I prevent rider from generating }, { between chopped elements of an initialization?
I looked through Editor --> Code Style --> Braces Layout/Line Breaks and Wrapping, but I may have ...
0
votes
1
answer
264
views
Rider/ReSharper - Wrap chained method calls before first method
I have set Line Brakes and Wrapping -> Arrangement of Members Access Expression -> Wrap chained method calls to Chop always
Rider is formatting chained method calls this was:
var numbers = ...
4
votes
0
answers
880
views
Editorconfig setting to allow object-initializer be aligned beneath the new-keyword
I'm using VisualStudio 2022 together with R# 2022.2.4.
Resharper is configured to apply alignment as shown in drawing below. (aligned with the new keyword)
The problem now is that the ....
0
votes
1
answer
238
views
Editorconfig indent C# record properties
I am trying to use editorconfig + ReSharper/cleanupcode.exe to format my C# code (using this cool precommit hook)
The problem I am having is that cleanupcode refuses to indent properties in a record
...
1
vote
1
answer
128
views
ReSharper - format generic type constraint
Here is an example of a generic type constraint declaration from this MSDN page:
class MyClass<T, U>
where T : class
where U : struct
{ }
Is it possible to format my class using ...
1
vote
0
answers
137
views
Line break after opening brace in do-while in Resharper instead of before
I use Resharper a lot and I love it for the most part, but I use Whitesmiths style braces for method bodies and their sub-blocks and I'd like to keep the opening brace on the same line as "do" in do-...
1
vote
1
answer
381
views
Unexpected opening curly bracket indentation
If I type if (true) Enter
the cursor will be indented like
and if I continue with { Enter }, I will get a brace layout like
Why?
I expect the braces to be like
In resharpers Braces layout section ...
2
votes
1
answer
158
views
Stop ReSharper formatting C# field attributes
In Unity, attributes are often used to format the inspector window for a component. To make things look tidy in the code, I have my code look like this:
[Header("Items")]
[SerializeField] private ...
2
votes
1
answer
3k
views
Vertically aligning code in visual studio 2017
I found that the productivity tools do not do quite what I am looking for them to do.
Currently they will align all assignments (as the extension says it will do) while I am looking for something that ...
1
vote
1
answer
41
views
ReSharper functionheader code formating
I'm using ReSharper with VS2015. I want to do some changes in the code formatin settings, but I don't get exactly what I want.
For example I use a function like this:
public static MyFunction(int ...
7
votes
3
answers
1k
views
How to fix Resharper object initializer indentation as method argument
Resharper 2016.2
Current formatting
IEnumerable<Customer> customers = dbCustomers.Select(customer => new Customer
{
...
0
votes
1
answer
126
views
code formatting in VS and command line
I need a tool that would allow developers to format code using Visual Studio and also check if this formatting was applied from command line (for using in pre commit hook, CI builds, etc.) I am ...
2
votes
0
answers
99
views
Resharper - How to stop line breaks with expressions
I've tried all of the obvious Resharper settings I could but to no avail.
This is the code Resharper produces:
var customer = CustomerBuilder.Build(
c => c
....
0
votes
1
answer
252
views
How do I increase indentation in visual studio / resharper format with 4 or more spaces
When I do automatic code formatting with visual studio format, or resharper format, it uses 2 spaces for indentation.
I want to make it 4 or even 6 spaces, where is the setting to do this?
1
vote
1
answer
762
views
How do I get my cursor to jump to the last character on a line?
This problem has not always been around, and I can find no option in VS or ReSharper to correct it, but when I use the mouse to place the cursor on a shortish line of code, and I place the cursor near ...