|
|
|
|
@ -222,7 +222,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -222,7 +222,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
{ |
|
|
|
|
int endOffset = segment.EndOffset; |
|
|
|
|
for (int i = segment.Offset; i < endOffset; i++) { |
|
|
|
|
if (!IsSpacing(document.GetCharAt(i))) |
|
|
|
|
if (!IsSpacing (document.GetCharAt (i))) |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
@ -1348,8 +1348,18 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -1348,8 +1348,18 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
ForceSpacesAround (binaryOperatorExpression.OperatorToken, forceSpaces); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
base.VisitBinaryOperatorExpression (binaryOperatorExpression); |
|
|
|
|
// Handle line breaks in binary opeartor expression.
|
|
|
|
|
if (binaryOperatorExpression.Left.StartLocation.Line != binaryOperatorExpression.Right.StartLocation.Line) { |
|
|
|
|
IndentLevel++; |
|
|
|
|
if (binaryOperatorExpression.OperatorToken.StartLocation.Line == binaryOperatorExpression.Right.StartLocation.Line) { |
|
|
|
|
FixStatementIndentation (binaryOperatorExpression.OperatorToken.StartLocation); |
|
|
|
|
} else { |
|
|
|
|
FixStatementIndentation (binaryOperatorExpression.Right.StartLocation); |
|
|
|
|
} |
|
|
|
|
IndentLevel--; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void VisitConditionalExpression (ConditionalExpression conditionalExpression) |
|
|
|
|
@ -1558,7 +1568,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -1558,7 +1568,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
if (offset < endOffset) { |
|
|
|
|
AddChange (offset, endOffset - offset, null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void PlaceOnNewLine (bool newLine, AstNode keywordNode) |
|
|
|
|
{ |
|
|
|
|
@ -1631,18 +1641,18 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -1631,18 +1641,18 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string GetIndentation(int lineNumber) |
|
|
|
|
string GetIndentation (int lineNumber) |
|
|
|
|
{ |
|
|
|
|
IDocumentLine line = document.GetLineByNumber(lineNumber); |
|
|
|
|
StringBuilder b = new StringBuilder(); |
|
|
|
|
IDocumentLine line = document.GetLineByNumber (lineNumber); |
|
|
|
|
StringBuilder b = new StringBuilder (); |
|
|
|
|
int endOffset = line.EndOffset; |
|
|
|
|
for (int i = line.Offset; i < endOffset; i++) { |
|
|
|
|
char c = document.GetCharAt(i); |
|
|
|
|
if (!IsSpacing(c)) |
|
|
|
|
char c = document.GetCharAt (i); |
|
|
|
|
if (!IsSpacing (c)) |
|
|
|
|
break; |
|
|
|
|
b.Append(c); |
|
|
|
|
b.Append (c); |
|
|
|
|
} |
|
|
|
|
return b.ToString(); |
|
|
|
|
return b.ToString (); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|