dotnet / dotnet/vscode-csharp

C# Dev Kit: Editing not automatically indenting 'break;' in case statements

Open
#5,766 0 comments 0 reactions 1 assignee Claimed by @sharwell View on GitHub
Bug Triaged
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

C# Dev Kit; v0.0.516-alpha

Steps to reproduce:

1. Add a new case statement to a switch
2. New line
3. Type break;
4. Enter

Expected
The break; is intended one deeper than the case statement.

Actual
Case and break are at the same level of indentation.

Notes
If I format the document the indentation gets corrected

Example code (correctly fromatted)

```
public enum MyEnum
{
Hello,
World
}

public Foo(MyEnum My)
{
switch (my)
{
case MyEnum.Hello:

break;
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.