Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes GitHub issue #28103: Formatting guidelines: clarify how empty class, struct and interface declarations should be formatted #37860

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/fsharp/style-guide/formatting.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: F# code formatting guidelines
description: Learn guidelines for formatting F# code.
ms.date: 09/19/2021
ms.date: 11/01/2023
---
# F# code formatting guidelines

Expand Down Expand Up @@ -1300,6 +1300,14 @@ let comparer = {
}
```

Empty type definitions may be formatted on one line:

```fsharp
type AnEmptyType = class end
```

Regardless of the chosen page width, `= class end` should always be on the same line.

### Formatting index/slice expressions

Index expressions shouldn't contain any spaces around the opening and closing brackets.
Expand Down
Loading