Skip to content

Commit 2673222

Browse files
committed
Disable indentation testing for newlines in Scala-2 mode
1 parent aecd984 commit 2673222

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,9 @@ object Scanners {
435435
true
436436
}
437437

438+
def isContinuingParens() =
439+
openParensTokens.contains(token) && !pastBlankLine && !isScala2Mode
440+
438441
/** The indentation width of the given offset */
439442
def indentWidth(offset: Offset): IndentWidth = {
440443
import IndentWidth.{Run, Conc}
@@ -532,7 +535,7 @@ object Scanners {
532535
&& canEndStatTokens.contains(lastToken)
533536
&& canStartStatTokens.contains(token)
534537
&& !isLeadingInfixOperator()
535-
&& !(openParensTokens.contains(token) && lastWidth < nextWidth && !pastBlankLine)
538+
&& !(lastWidth < nextWidth && isContinuingParens())
536539
then
537540
insert(if (pastBlankLine) NEWLINES else NEWLINE, lineOffset)
538541
skipEndMarker(nextWidth)

0 commit comments

Comments
 (0)