gpt4 book ai didi

c# - 使用 Resharper 自定义大括号格式

转载 作者:IT王子 更新时间:2023-10-29 03:39:24 30 4
gpt4 key购买 nike

我使用的是 Resharper 4.5,在编写数组或对象初始值设定项时需要自定义大括号格式。 Resharper 支持一些样式:

Gnu 风格:

int[] array = new int[]  
{
1, 2, 3
}

但我需要:

int[] array = new int[] 
{
1, 2, 3
}

有什么方法可以自定义这个模板吗?

最佳答案

您可以自定义 ReSharper 来执行此操作,您需要执行以下操作(全部在 ReSharper -> Options -> C# -> Formatting Style 中):

  1. Braces Layout中,设置Array 和对象初始值设定项At Next行(BSD 风格)
  2. 其他中,确保Continuous line indent multiplier设置为1
  3. 其他中,确保Indent array, object and collection initializer block未选中

你应该得到你想要的样式。

关于c# - 使用 Resharper 自定义大括号格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/747351/

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