gpt4 book ai didi

c# - 如何设置格式以便方法参数垂直堆叠,每行一个?

转载 作者:IT王子 更新时间:2023-10-29 04:49:25 26 4
gpt4 key购买 nike

我有一个方法,我想要这样格式化:

public static IQueryable<ThingRequest> GetThings( this EntityContext one
, int? two = null
, int? three = null
, int? four = null
, int? five = null
, String six = null
, IEnumerable<String> seven = null) {

基本上,如果方法定义要超过一行的长度,我希望每一行有一个参数。我不太关心逗号(如果它们出现在每行的末尾,那很好)。

但是 R# 将其格式化为:

public static IQueryable<ThingRequest> GetThings( this EntityContext one, int? two = null, int? three = null, int? four = null, int? five = null,
String six = null, IEnumerable<String> seven = null ) {

...所以,它把它们排成一行,但每行有几个参数,很难挑选出任何一个参数。

顺便说一句,当调用 方法时,如果超过最大行长度,它会每行堆叠一个参数(尽管在那种情况下,我几乎不希望它没有)。

我已经研究了 R# 选项并探索了各种可用的复选框,但我不知道如何改善我的情况。想法?

最佳答案

尝试从此路径更改选项:

ReSharper | Options -> 
Code Editing | C# | Formatting style | Line breaks and Wrapping ->
Line wrapping | Wrap formal parameters

一直砍。我不知道是否可以按照你想要的方式放置逗号,但至少每行会有一个参数。祝你好运!

关于c# - 如何设置格式以便方法参数垂直堆叠,每行一个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10761058/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com