dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 671 forks source link

Updating settings requires manual restart #4501

Open seanbecker15 opened 3 years ago

seanbecker15 commented 3 years ago

Issue Description

When updating "editor.insertSpaces" in the following, the changes are not reflected immediately. In order for changes to take effect, I need to manually restart omnisharp.

settings.json:

"[csharp]": {
    "editor.defaultFormatter": "ms-dotnettools.csharp",
    "editor.detectIndentation": false,
    "editor.tabSize": 4,
    "editor.insertSpaces": true, <-- changing this to false is not reflected automatically
    "editor.formatOnPaste": true,
    "editor.formatOnType": true,
    "editor.formatOnSave": true
  }

Steps to Reproduce

  1. Open any .cs file and observe tab/space behavior
  2. F1
  3. Type & Click: "Preferences: Open Workspace Settings (JSON)
  4. Insert snippet above
  5. Toggle editor.insertSpaces from true to false

Expected Behavior

Toggling this setting should be reflected in real time, or a message should appear asking if user would like to restart VS Code for changes to take place.

Actual Behavior

Nothing changes, causing me to think that this setting is broken or I am changing the wrong setting.

Logs

OmniSharp log

There are no logs when any settings change.

C# log

There are no logs when any settings change.

Environment information

VSCode version: 1.55.2 C# Extension: 1.23.11

Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.101 Commit: d05174dc5a Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.101\ Host (useful for support): Version: 5.0.1 Commit: b02e13abab .NET SDKs installed: 5.0.100 [C:\Program Files\dotnet\sdk] 5.0.101 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |ayu|teabyii|0.20.1| |change-case|wmaurer|1.0.0| |csharp|ms-dotnettools|1.23.11| |debugger-for-chrome|msjsdiag|4.12.12| |es7-react-js-snippets|dsznajder|3.1.1| |gitlens|eamodio|11.4.1| |latex-workshop|James-Yu|8.16.1| |material-palenight-theme|whizkydee|2.0.1| |material-theme|zhuangtongfa|3.10.13| |night-owl|sdras|2.0.0| |prettier-vscode|esbenp|6.3.2| |remote-containers|ms-vscode-remote|0.166.1| |remote-wsl|ms-vscode-remote|0.54.6| |shades-of-purple|ahmadawais|6.13.0| |sonarlint-vscode|SonarSource|1.21.0| |synthwave-vscode|RobbOwen|0.1.8| |theme-dracula|dracula-theme|2.22.3| |vscode-commons|redhat|0.0.4| |vscode-icons|vscode-icons-team|11.4.0| |vscode-sort-json|richie5um2|1.20.0| |vscode-wakatime|WakaTime|5.0.1| |vscode-xml|redhat|0.16.0| |vsliveshare|ms-vsliveshare|1.0.4131| |winteriscoming|johnpapa|1.4.4|;
nohwnd commented 3 years ago

Thanks for reporting this, this should become part of the options that prompt for server restart. https://github.com/OmniSharp/omnisharp-vscode/blob/d1785942e51f3afee1d8e62b406ee46b35168c63/src/observers/OptionChangeObserver.ts#L15-L25

But because this is not in the omnisharp options directly, a bigger change might be needed to make this work.