刚刚使用最新的omnisharp(开发分支)和omnisharp.json
(粘贴在下面)与我的项目位于同一文件夹中.sln
。
它应该适用于所有人releases https://github.com/OmniSharp/omnisharp-roslyn/releases从 v1.9-beta18 开始,我只是从源代码编译,因为我不使用受支持的系统。
{
"FormattingOptions": {
"newLine": "\n",
"useTabs": false,
"tabSize": 4,
"indentationSize": 4,
"NewLinesForBracesInTypes": false,
"NewLinesForBracesInMethods": false,
"NewLinesForBracesInProperties": false,
"NewLinesForBracesInAccessors": false,
"NewLinesForBracesInAnonymousMethods": false,
"NewLinesForBracesInControlBlocks": false,
"NewLinesForBracesInAnonymousTypes": false,
"NewLinesForBracesInObjectCollectionArrayInitializers": false,
"NewLinesForBracesInLambdaExpressionBody": false,
"NewLineForElse": false,
"NewLineForCatch": false,
"NewLineForFinally": false,
"NewLineForMembersInObjectInit": false,
"NewLineForMembersInAnonymousTypes": false,
"NewLineForClausesInQuery": false,
}
}
可用属性列于FormattingOptions.cs https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Shared/Options/FormattingOptions.cs in the omnisharp-roslyn存储库 https://github.com/OmniSharp/omnisharp-roslyn.