Auto formatting breaks if an enum is present
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Command Line Tools (2.1.105)
Product Information:
Version: 2.1.105
Commit SHA-1 hash: 141cc8d976
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.105\
Microsoft .NET Core Shared Framework Host
Version : 2.0.7
Build : 2d61d0b043915bc948ebf98836fefe9ba942be11
VS Code version:
1.23.1 d0182c3417d225529c6d5ad24b7572815d0de9ac x64
C# Extension version:
1.15.2
Steps to reproduce
Open a .cs file with these contents:
public class EnumDemo {
/// <summary>
///
/// Here is my enum
/// </summary>
public enum DEMO { One, Two, Three };
void AFunctionHere () {
//things are indented wrong
var hello = 3;
}
void AnotherFunction () {
// hi
}
}
Then Format Document ( Alt + Shift + F)
Expected behavior
The indentation should look like this:
Actual behavior
The indentation looks like this
Enjoying the plugin, thank you guys for making it and maintaining it
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
How to stop Eclipse formatter from placing all enums on one line
Window > Preferences > Java > Code Style > Formatter · Click Edit · Select the Line Wrapping tab · Select the enum...
Read more >Line break for enumerations with constant arguments does not ...
Hi! In order to have a common code layout, I want to format enum-class declarations so, that each enum-element is in a separate...
Read more >enum class support · Issue #391 · fmtlib/fmt - GitHub
I'm working in a project that uses a number of enum classes, e.g: enum ... <typename FormatContext> auto format(OrderStatus order_status, ...
Read more >Enumeration declaration - cppreference.com
An enumeration is a distinct type whose value is restricted to a range of values (see below for details), which may include several ......
Read more >Enum HOWTO — Python 3.11.1 documentation
An Enum is a set of symbolic names bound to unique values. They are similar to global variables, but they offer a more...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dogboydog remove
;
after enum - it should fix issue (forC#FixFormat
).It is because of the semicolon. Remove semicolon at the end of ending brace.