Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation: fix wrapping issues with rider #6570

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

anna-git
Copy link
Contributor

@anna-git anna-git commented Jan 17, 2025

Summary of changes

When using ctrl+k,d on Rider, lines like

 var addressesDictionary = new Dictionary<string, object>
        {
            { AddressesConstants.RequestMethod, request.Method },
            { AddressesConstants.ResponseStatus, request.HttpContext.Response.StatusCode.ToString() },
            { AddressesConstants.RequestUriRaw, request.GetUrlForWaf() },
            { AddressesConstants.RequestClientIp, _localRootSpan.GetTag(Tags.HttpClientIp) }
        };

ends up in one single line.

This is because of a Rider limitation where csharp_new_line_before_members_in_object_initializers is not taken into account, one can circumvent using: https://www.jetbrains.com/help/resharper/EditorConfig_CSHARP_LineBreaksPageSchema.html#Arrangement_of_initializers
https://youtrack.jetbrains.com/issue/RIDER-20834/csharpnewlinebeforemembersinobjectinitializers-highlights-as-unknown-but-it-works

Reason for change

Better indentation

Implementation details

Test coverage

Other details

@anna-git anna-git requested a review from a team as a code owner January 17, 2025 12:33
@vandonr
Copy link
Contributor

vandonr commented Jan 17, 2025

linking to the bug report on JetBrains' side for posterity: https://youtrack.jetbrains.com/issue/RSRP-486359

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 17, 2025

Datadog Report

Branch report: anna/fix-indentation-wrap-issues
Commit report: df7b806
Test service: dd-trace-dotnet

✅ 0 Failed, 244899 Passed, 1993 Skipped, 18h 47m 38.91s Total Time

@andrewlock
Copy link
Member

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6570) - mean (69ms)  : 66, 72
     .   : milestone, 69,
    master - mean (69ms)  : 66, 71
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6570) - mean (981ms)  : 953, 1009
     .   : milestone, 981,
    master - mean (979ms)  : 953, 1006
     .   : milestone, 979,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6570) - mean (107ms)  : 105, 109
     .   : milestone, 107,
    master - mean (107ms)  : 105, 109
     .   : milestone, 107,

    section CallTarget+Inlining+NGEN
    This PR (6570) - mean (681ms)  : 667, 695
     .   : milestone, 681,
    master - mean (678ms)  : 665, 692
     .   : milestone, 678,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6570) - mean (91ms)  : 89, 93
     .   : milestone, 91,
    master - mean (91ms)  : 89, 93
     .   : milestone, 91,

    section CallTarget+Inlining+NGEN
    This PR (6570) - mean (633ms)  : 614, 652
     .   : milestone, 633,
    master - mean (635ms)  : 618, 651
     .   : milestone, 635,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6570) - mean (191ms)  : 187, 195
     .   : milestone, 191,
    master - mean (190ms)  : 185, 195
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (6570) - mean (1,093ms)  : 1062, 1125
     .   : milestone, 1093,
    master - mean (1,092ms)  : 1054, 1130
     .   : milestone, 1092,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6570) - mean (275ms)  : 271, 279
     .   : milestone, 275,
    master - mean (274ms)  : 269, 278
     .   : milestone, 274,

    section CallTarget+Inlining+NGEN
    This PR (6570) - mean (867ms)  : 838, 896
     .   : milestone, 867,
    master - mean (865ms)  : 837, 894
     .   : milestone, 865,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6570) - mean (264ms)  : 259, 268
     .   : milestone, 264,
    master - mean (264ms)  : 260, 268
     .   : milestone, 264,

    section CallTarget+Inlining+NGEN
    This PR (6570) - mean (849ms)  : 816, 883
     .   : milestone, 849,
    master - mean (849ms)  : 812, 886
     .   : milestone, 849,

Loading

@anna-git anna-git merged commit 7925730 into master Jan 17, 2025
123 of 127 checks passed
@anna-git anna-git deleted the anna/fix-indentation-wrap-issues branch January 17, 2025 15:06
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants