You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more consistent with most settings, which have dashes
between words.
We keep `-noindent` as an alias (abbreviation) not to break
existing builds that rely on it.
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
93
93
valnewSyntax:Setting[Boolean] =BooleanSetting("-new-syntax", "Require `then` and `do` in control expressions.")
94
94
valoldSyntax:Setting[Boolean] =BooleanSetting("-old-syntax", "Require `(...)` around conditions.")
95
95
valindent:Setting[Boolean] =BooleanSetting("-indent", "Together with -rewrite, remove {...} syntax when possible due to significant indentation.")
96
-
valnoindent:Setting[Boolean] =BooleanSetting("-noindent", "Require classical {...} syntax, indentation is not significant.")
96
+
valnoindent:Setting[Boolean] =BooleanSetting("-no-indent", "Require classical {...} syntax, indentation is not significant.").withAbbreviation("-noindent")
97
97
valYindentColons:Setting[Boolean] =BooleanSetting("-Yindent-colons", "Allow colons at ends-of-lines to start indentation blocks.")
Copy file name to clipboardExpand all lines: docs/docs/reference/other-new-features/indentation.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ title: Optional Braces
5
5
6
6
As an experimental feature, Scala 3 enforces some rules on indentation and allows
7
7
some occurrences of braces `{...}` to be optional.
8
-
It can be turned off with the compiler flag `-noindent`.
8
+
It can be turned off with the compiler flag `-no-indent`.
9
9
10
10
- First, some badly indented programs are flagged with warnings.
11
11
- Second, some occurrences of braces `{...}` are made optional. Generally, the rule
@@ -28,7 +28,7 @@ The compiler enforces two rules for well-indented programs, flagging violations
28
28
println("done") // error: indented too far to the left
29
29
```
30
30
31
-
2. If significant indentation is turned off (i.e. under Scala-2 mode or under `-noindent`) and we are at the start of an indented sub-part of an expression, and the indented part ends in a newline, the next statement must start at an indentation width less than the sub-part. This prevents errors where an opening brace was forgotten, asin
31
+
2. If significant indentation is turned off (i.e. under Scala-2 mode or under `-no-indent`) and we are at the start of an indented sub-part of an expression, and the indented part ends in a newline, the next statement must start at an indentation width less than the sub-part. This prevents errors where an opening brace was forgotten, asin
32
32
33
33
```scala
34
34
if (x <0)
@@ -349,13 +349,13 @@ end IndentWidth
349
349
350
350
###Settings and Rewrites
351
351
352
-
Significant indentation is enabled by default. It can be turned off by giving any of the options `-noindent`, `old-syntax` and `language:Scala2`. If indentation is turned off, it is nevertheless checked that indentation conforms to the logical program structure asdefined by braces. If that is not the case, the compiler issues a warning.
352
+
Significant indentation is enabled by default. It can be turned off by giving any of the options `-no-indent`, `old-syntax` and `language:Scala2`. If indentation is turned off, it is nevertheless checked that indentation conforms to the logical program structure asdefined by braces. If that is not the case, the compiler issues a warning.
353
353
354
354
TheDotty compiler can rewrite source code to indented code and back.
355
355
When invoked with options `-rewrite -indent` it will rewrite braces to
356
-
indented regions where possible. When invoked with options `-rewrite -noindent` it will rewrite in the reverse direction, inserting braces for indentation regions.
356
+
indented regions where possible. When invoked with options `-rewrite -no-indent` it will rewrite in the reverse direction, inserting braces for indentation regions.
357
357
The `-indent` option only works on [new-style syntax](./control-syntax.html). So to go from old-style syntax to new-style indented code one has to invoke the compiler twice, first with options `-rewrite -new-syntax`, then again with options
358
-
`-rewrite -indent`. To go in the opposite direction, from indented code to old-style syntax, it's `-rewrite -noindent`, followed by `-rewrite -old-syntax`.
358
+
`-rewrite -indent`. To go in the opposite direction, from indented code to old-style syntax, it's `-rewrite -no-indent`, followed by `-rewrite -old-syntax`.
0 commit comments