@@ -22,7 +22,7 @@ let outputPos os (p: Position) = Printf.fprintf os "(%d:%d)" p.OriginalLine p.Co
2222/// Used for warning strings, which should display columns as 1-based and display
2323/// the lines after taking '# line' directives into account (i.e. do not use
2424/// p.OriginalLine)
25- let warningStringOfPos ( p : Position ) = sprintf " ( %d : %d ) " p.Line ( p.Column + 1 )
25+ let warningStringOfPosition ( p : Position ) = warningStringOfCoords p.Line p.Column
2626
2727type Context =
2828 // Position is position of keyword.
@@ -651,7 +651,7 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu
651651 initialLookaheadTokenTup
652652
653653 let warn ( s : TokenTup ) msg =
654- warning( Lexhelp. IndentationProblem( msg, mkSynRange ( startPosOfTokenTup s) s.LexbufState.EndPos))
654+ warning( IndentationProblem( msg, mkSynRange ( startPosOfTokenTup s) s.LexbufState.EndPos))
655655
656656 // 'query { join x in ys ... }'
657657 // 'query { ...
@@ -865,9 +865,9 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu
865865 warn tokenTup
866866 ( if debug then
867867 sprintf " possible incorrect indentation: this token is offside of context at position %s , newCtxt = %A , stack = %A , newCtxtPos = %s , c1 = %d , c2 = %d "
868- ( warningStringOfPos p1.Position) newCtxt offsideStack ( stringOfPos ( newCtxt.StartPos)) p1.Column c2
868+ ( warningStringOfPosition p1.Position) newCtxt offsideStack ( stringOfPos ( newCtxt.StartPos)) p1.Column c2
869869 else
870- FSComp.SR.lexfltTokenIsOffsideOfContextStartedEarlier( warningStringOfPos p1.Position))
870+ FSComp.SR.lexfltTokenIsOffsideOfContextStartedEarlier( warningStringOfPosition p1.Position))
871871 let newOffsideStack = newCtxt :: offsideStack
872872 if debug then dprintf " --> pushing, stack = %A \n " newOffsideStack
873873 offsideStack <- newOffsideStack
@@ -1749,7 +1749,7 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu
17491749 let cond1 = tokenStartCol + ( if leadingBar then 0 else 2 ) < offsidePos.Column
17501750 let cond2 = tokenStartCol + ( if leadingBar then 1 else 2 ) < offsidePos.Column
17511751 if ( cond1 <> cond2) then
1752- errorR( Lexhelp. IndentationProblem( FSComp.SR.lexfltSeparatorTokensOfPatternMatchMisaligned(), mkSynRange ( startPosOfTokenTup tokenTup) tokenTup.LexbufState.EndPos))
1752+ errorR( IndentationProblem( FSComp.SR.lexfltSeparatorTokensOfPatternMatchMisaligned(), mkSynRange ( startPosOfTokenTup tokenTup) tokenTup.LexbufState.EndPos))
17531753 cond1
17541754 | END -> tokenStartCol + ( if leadingBar then - 1 else 1 ) < offsidePos.Column
17551755 | _ -> tokenStartCol + ( if leadingBar then - 1 else 1 ) < offsidePos.Column)) ->
@@ -2066,6 +2066,11 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu
20662066 let offsidePos = tokenStartPos
20672067 pushCtxt tokenTup ( CtxtWithAsLet offsidePos)
20682068 returnToken tokenLexbufState OWITH
2069+
2070+ // Recovery for `interface ... with` member without further indented member implementations
2071+ elif lookaheadTokenStartPos.Column <= limCtxt.StartCol && ( match limCtxt with CtxtInterfaceHead _ -> true | _ -> false ) then
2072+ returnToken tokenLexbufState token
2073+
20692074 else
20702075 // In these situations
20712076 // interface I with
0 commit comments