Omnisharp для VS Code все еще не соответствует настройкам .editorconfig - PullRequest
0 голосов
/ 09 марта 2020

Я везде читаю, что 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

using System;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            bool isPostCrisis = true;

            if (isPostCrisis) {
                Console.WriteLine("Hello World!");
            } else {
                Console.WriteLine("Welcome to the Multiverse!");
            }
        }
    }
}

Я вижу, что правило "enableAnalyzersSupport": true работает, но обратной связи не вижу для csharp_new_line_before_else = true.

enter image description here

Я использую:

  • VS Код v1.42.1
  • C# расширение для VS Code v1.21.12
    • Сервер Omnisharp v1.34.13 (включен через родительское расширение)

Вот репозиторий тестового проекта : https://github.com/roydukkey/moist/tree/stackoverflow/60607975

...