Skip to content

Automatically indent (and de-indent on braces) in single line if/for/while #6597

Open
@dibarbet

Description

@dibarbet

Copied from microsoft/vscode-dotnettools#618

Describe the Issue

After write an if/for/while and hitting enter (presumably to write an one line statement with no brackets), the caret should go to next line with a nested indentation level, not the same as if/for/while

VS/ VSMac:

Screen.Recording.2023-10-15.at.1.47.27.PM.mov

VSCode:

Screen.Recording.2023-10-15.at.1.56.32.PM.mov

I really think .NET on VSCode have potential. But this kind of paper-cut make really annoy to use it.

Steps To Reproduce

Hit Enter after an if/while/for statement

Expected Behavior

It should just behave like VS or VSMac editor

Environment Information

VSCode: Version: 1.83.1 (Universal)
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:46:55.789Z (4 days ago)
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin x64 22.6.0

C# v2.6.24
C# Dev Kit v0.5.150

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions