Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Omnisharp for VS代码仍然没有';我似乎不尊重编辑或配置设置_C#_Omnisharp_Editorconfig - Fatal编程技术网

C# Omnisharp for VS代码仍然没有';我似乎不尊重编辑或配置设置

C# Omnisharp for VS代码仍然没有';我似乎不尊重编辑或配置设置,c#,omnisharp,editorconfig,C#,Omnisharp,Editorconfig,我在任何地方都读到Omnisharp现在支持.editorconfig中的配置。然而,我尝试过的一切似乎都不起作用。这是我能想出的最苗条的测试,但这里出了什么问题 omnisharp.json { "RoslynExtensionsOptions": { "enableAnalyzersSupport": true }, "FormattingOptions": { "enableEditorConfigSupport": true

我在任何地方都读到Omnisharp现在支持
.editorconfig
中的配置。然而,我尝试过的一切似乎都不起作用。这是我能想出的最苗条的测试,但这里出了什么问题

omnisharp.json

{
    "RoslynExtensionsOptions": {
        "enableAnalyzersSupport": true
    },
    "FormattingOptions": {
        "enableEditorConfigSupport": true
    }
}
.editorconfig

root = true

[*]
insert_final_newline = true
indent_size = 2
indent_style = tab
tab_width = 2
trim_trailing_whitespace = true
charset = utf-8

[*.cs]
csharp_new_line_before_else = true
Program.cs

使用系统;
命名空间测试控制台
{
班级计划
{
静态void Main(字符串[]参数)
{
bool isPostCrisis=true;
如果(isPostCrisis){
控制台。WriteLine(“你好,世界!”);
}否则{
WriteLine(“欢迎来到多元宇宙!”);
}
}
}
}
我可以看到
“enableAnalyzersSupport”:true
规则正在工作,但我看不到在else=true之前对
csharp\u new\u line\u的任何反馈

我正在使用:

  • VS代码v1.42.1
  • VS代码v1.21.12的C#扩展
    • Omnisharp服务器v1.34.13(通过父扩展提供)

下面是测试项目的报告:

前面有一行新行。@HansPassant我已经更新了示例,但仍然没有看到错误或警告。它不是要生成错误,它对您有帮助。在其他行之前有一行新行。@HansPassant我已经更新了示例,但仍然没有看到错误或警告。它不是要生成错误,它对您有帮助。