如何在Visual Studio Code中的C#函数声明括号中设置自动leading/trailng空间?

Ger*_*eri 6 c# visual-studio-code vscode-settings

我有这个:

public void Scale(float amount);
Run Code Online (Sandbox Code Playgroud)

但我想要这个:

public void Scale( float amount );
Run Code Online (Sandbox Code Playgroud)

如果我可以将规则应用于现有C#文件,那将是最好的.

Oli*_*ver 3

您可以通过以下设置启用空格:

VS
1.打开VS文本编辑器(工具=>选项=>编辑器)
2.选择您的语言。例如(C#->格式->间距)
3.然后勾选Insert space within argument list parentheses

VS Code:
1.打开 VS 用户设置(文件 > 首选项 > 用户设置)。2.如果右侧的“用户设置”文档中
尚无新设置,则将其添加到该文档中。 3.保存用户设置文件。 4.在右下角的工具栏中,您将看到如下所示的项目: "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true,

在此输入图像描述
5.点击后您将看到语言列表并选择TypeScript。
6.按Shift++AltF