Omnisharp ignores omnisharp.json settings while formatting in v1.25.1
See original GitHub issueIssue Description
Omnisharp does not respect the omnisharp.json
files anymore under VS Code C# extension v1.25.1
while it does for v1.25.0
.
Steps to Reproduce
I use the omnisharp language server for among other formatting of my source code in VS Code. I have an omnisharp.json
file in %USERPROFILE%/.omnisharp
. Also, for testing purposes I copied this file to my projects working directory.
Steps:
- Open a file (C# of course)
- Format
Expected Behavior
I expected omnisharp to respect the formatting choices as present in the configuration file as it did every previous day.
Actual Behavior
It used the default configuration for formatting.
Workaround
I rolled back to the VS Code C# extension v1.25.0
(which you can see in the logs below) and this fixed the issue. I do not know if some new settings are needed from my side maybe with the new omnisharp.useModernNet
or that something has gone awry with the included update to omnisharp 1.39.2
.
Logs
OmniSharp log
OmniSharp server started with .NET 6.0.403 . Path: c:\Users\5803969.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64.omnisharp\1.39.0-net6.0\OmniSharp.dll PID: 17164
Starting OmniSharp on Windows 10.0.19044.0 (x64)
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
Using the 'dotnet' on the PATH.
DotNetPath set to dotnet
Located 2 MSBuild instance(s)
1: .NET Core SDK 6.0.403 17.3.2 - "C:\Program Files\dotnet\sdk\6.0.403\"
2: .NET Core SDK 6.0.401 17.3.1 - "C:\Program Files\dotnet\sdk\6.0.401\"
Registered MSBuild instance: .NET Core SDK 6.0.403 17.3.2 - "C:\Program Files\dotnet\sdk\6.0.403\"
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
No solution files found in 'c:\Users\5803969\src\stitch'
Queue project update for 'c:\Users\5803969\src\stitch\stitch\stitch.csproj'
Queue project update for 'c:\Users\5803969\src\stitch\tests\tests.csproj'
Detecting CSX files in 'c:\Users\5803969\src\stitch'.
Loading project: c:\Users\5803969\src\stitch\stitch\stitch.csproj
Did not find any CSX files
Configuration finished.
Omnisharp server running using Stdio at location 'c:\Users\5803969\src\stitch' on host 17916.
Successfully loaded project file 'c:\Users\5803969\src\stitch\stitch\stitch.csproj'.
Adding project 'c:\Users\5803969\src\stitch\stitch\stitch.csproj'
Loading project: c:\Users\5803969\src\stitch\tests\tests.csproj
Successfully loaded project file 'c:\Users\5803969\src\stitch\tests\tests.csproj'.
Adding project 'c:\Users\5803969\src\stitch\tests\tests.csproj'
Update project: stitch
Update project: tests
C# log
Environment information
VSCode version: 1.73.0 C# Extension: 1.25.0
Dotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.403 Commit: 2bc18bf292Runtime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.403\
global.json file: Not found
Host: Version: 6.0.11 Architecture: x64 Commit: 943474ca16
.NET SDKs installed: 3.1.425 [C:\Program Files\dotnet\sdk] 6.0.401 [C:\Program Files\dotnet\sdk] 6.0.403 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Download .NET: https://aka.ms/dotnet-download
Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-info
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
better-toml | bungcip | 0.3.2 |
code-spell-checker | streetsidesoftware | 2.11.0 |
crates | serayuzgur | 0.5.10 |
csharp | ms-dotnettools | 1.25.0 |
docomment | k–kato | 0.1.31 |
errorlens | usernamehw | 3.6.0 |
githistory | donjayamanne | 0.6.19 |
gitlens | eamodio | 13.0.4 |
haskelly | UCL | 0.5.5 |
hexeditor | ms-vscode | 1.9.9 |
intellicode-api-usage-examples | VisualStudioExptTeam | 0.2.6 |
isort | ms-python | 2022.4.0 |
jupyter | ms-toolsai | 2022.9.1202862440 |
jupyter-keymap | ms-toolsai | 1.0.0 |
jupyter-renderers | ms-toolsai | 1.0.12 |
language-haskell | justusadam | 3.6.0 |
latex-workshop | James-Yu | 9.0.1 |
LiveServer | ritwickdey | 5.7.9 |
material-product-icons | PKief | 1.4.1 |
python | ms-python | 2022.18.1 |
r | REditorSupport | 2.6.1 |
rainbow-csv | mechatroner | 3.3.0 |
reflow-paragraph | TroelsDamgaard | 1.3.0 |
rust-analyzer | rust-lang | 0.3.1277 |
svg | jock | 1.4.22 |
unique-lines | bibhasdn | 1.0.0 |
vscode-html-css | ecmel | 1.13.1 |
vscode-intelephense-client | bmewburn | 1.8.2 |
vscode-jupyter-cell-tags | ms-toolsai | 0.1.6 |
vscode-jupyter-slideshow | ms-toolsai | 0.1.5 |
vscode-lldb | vadimcn | 1.8.1 |
vscode-pull-request-github | GitHub | 0.54.0 |
vscode-pylance | ms-python | 2022.11.10 |
vscode-todo-highlight | wayou | 1.0.5 |
vsliveshare | ms-vsliveshare | 1.0.5762 |
wordpress-toolbox | wordpresstoolbox | 1.3.14 |
Issue Analytics
- State:
- Created 10 months ago
- Reactions:7
- Comments:10 (3 by maintainers)
@filipw : Thank-you. This is working after adding
"omnisharp.enableEditorConfigSupport": false,
, and updating to 1.25.1.I would have expected a setting like “Enable Editor Config Support” to fall back to omnisharp.json when there is no .editorconfig in the workspace, which the current implementation did not do.
It seems inappropriate to make the default behavior break backwards compatibility in a patch release.