Skip to content

VS Code Formats my Code when hitting ENTER. #8560

@SimonCahill

Description

@SimonCahill

Issue Description

For a few updates now, VS Code has been doing this stupid thing, where it reformats my code to use the Microsoft/Allmann styling.

If I wanted to an inferior bracing style, I would. VS Code is, specifically for this reason, configured that it DOESN'T reformat my C# code.
It's not only frustrating, but infuriating behaviour; don't force an inferior coding style onto us.

Steps to Reproduce

Write C# code. Hit enter. Braces placed using K&R style will be moved to Allman style.

Expected Behavior

That it leaves my braces tf alone.

Actual Behavior

It doesn't.

Config

{
    // snip
    "omnisharp.useEditorFormattingSettings": false,
    "csharp.format.enable": false,
}

Logs

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires the `C#` output window log level to be set to `Trace`

Environment information

VSCode version: 1.104.0-insider
C# Extension: 2.87.31
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 9.0.109 Commit: a1e39f97e5 Workload version: 9.0.100-manifests.d3740a48 MSBuild version: 17.12.41+a1e39f97e

Runtime Environment:
OS Name: ubuntu
OS Version: 25.04
OS Platform: Linux
RID: ubuntu.25.04-x64
Base Path: /usr/lib/dotnet/sdk/9.0.109/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.8
Architecture: x64
Commit: a1e39f97e5

.NET SDKs installed:
8.0.119 [/usr/lib/dotnet/sdk]
9.0.109 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.19 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.8 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.19 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.8 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Code Extensions
Extension Author Version Folder Name
bash-ide-vscode mads-hartmann 1.43.0 mads-hartmann.bash-ide-vscode-1.43.0
c-cpp-flylint jbenden 1.15.0 jbenden.c-cpp-flylint-1.15.0
cmake twxs 0.0.17 twxs.cmake-0.0.17
copilot GitHub 1.350.0 github.copilot-1.350.0
copilot-chat GitHub 0.31.2025081801 github.copilot-chat-0.31.2025081801
cpp-helper amiralizadeh9480 0.3.4 amiralizadeh9480.cpp-helper-0.3.4
cppcheck-lite JustusRijke 1.3.1 justusrijke.cppcheck-lite-1.3.1
cpptools ms-vscode 1.27.0 ms-vscode.cpptools-1.27.0
cpptools-extension-pack ms-vscode 1.3.1 ms-vscode.cpptools-extension-pack-1.3.1
csdevkit ms-dotnettools 1.41.11 ms-dotnettools.csdevkit-1.41.11-linux-x64
csharp ms-dotnettools 2.87.31 ms-dotnettools.csharp-2.87.31-linux-x64
debug webfreak 0.27.0 webfreak.debug-0.27.0
debugpy ms-python 2025.10.0 ms-python.debugpy-2025.10.0
docker docker 0.15.0 docker.docker-0.15.0-linux-x64
dotnet-test-explorer formulahendry 0.7.8 formulahendry.dotnet-test-explorer-0.7.8
doxdocgen cschlosser 1.4.0 cschlosser.doxdocgen-1.4.0
EditorConfig EditorConfig 0.17.4 editorconfig.editorconfig-0.17.4
gitlens eamodio 17.3.4 eamodio.gitlens-17.3.4
hexeditor ms-vscode 1.11.1 ms-vscode.hexeditor-1.11.1
lua sumneko 3.15.0 sumneko.lua-3.15.0-linux-x64
markdown-preview-github-styles bierner 2.2.0 bierner.markdown-preview-github-styles-2.2.0
markdown-shiki bierner 0.1.1 bierner.markdown-shiki-0.1.1
plantuml jebbs 2.18.1 jebbs.plantuml-2.18.1
python ms-python 2025.12.0 ms-python.python-2025.12.0
shellcheck timonwong 0.38.3 timonwong.shellcheck-0.38.3
sonarlint-vscode SonarSource 4.29.0 sonarsource.sonarlint-vscode-4.29.0
test-adapter-converter ms-vscode 0.2.1 ms-vscode.test-adapter-converter-0.2.1
todo-tree Gruntfuggly 0.0.226 gruntfuggly.todo-tree-0.0.226
vscode-catch2-test-adapter matepek 4.17.3 matepek.vscode-catch2-test-adapter-4.17.3
vscode-containers ms-azuretools 2.1.0 ms-azuretools.vscode-containers-2.1.0
vscode-diff fabiospampinato 2.1.2 fabiospampinato.vscode-diff-2.1.2
vscode-docker ms-azuretools 2.0.0 ms-azuretools.vscode-docker-2.0.0
vscode-dotnet-runtime ms-dotnettools 2.3.7 ms-dotnettools.vscode-dotnet-runtime-2.3.7
vscode-github-actions github 0.27.2 github.vscode-github-actions-0.27.2
vscode-google-test-adapter OpenNingia 0.3.1 openningia.vscode-google-test-adapter-0.3.1
vscode-intelephense-client bmewburn 1.14.4 bmewburn.vscode-intelephense-client-1.14.4
vscode-lizard brobeson 1.0.1 brobeson.vscode-lizard-1.0.1
vscode-proto3 zxh404 0.5.5 zxh404.vscode-proto3-0.5.5
vscode-pull-request-github GitHub 0.116.1 github.vscode-pull-request-github-0.116.1
vscode-pylance ms-python 2025.7.1 ms-python.vscode-pylance-2025.7.1
vscode-python-envs ms-python 1.2.0 ms-python.vscode-python-envs-1.2.0
vscode-test-explorer hbenl 2.22.1 hbenl.vscode-test-explorer-2.22.1
vscode-zig ziglang 0.6.12 ziglang.vscode-zig-0.6.12
vscodeintellicode-csharp ms-dotnettools 2.2.3 ms-dotnettools.vscodeintellicode-csharp-2.2.3-linux-x64
vsliveshare ms-vsliveshare 1.0.5959 ms-vsliveshare.vsliveshare-1.0.5959
yocto-bitbake yocto-project 2.8.0 yocto-project.yocto-bitbake-2.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions