提交 180a7cbf 编写于 作者: C Cyrus Najmabadi

Fixup tests

上级 f7932661
......@@ -278,8 +278,9 @@ public async Task TrailingLongWrapping2()
}",
@"class C {
void Bar() {
the.quick.brown().fox.jumped().over
.the().lazy().dog();
the.quick.brown().fox
.jumped().over.the().lazy()
.dog();
}
}",
@"class C {
......@@ -322,7 +323,7 @@ public async Task TrailingLongWrapping3()
@"class C {
void Bar() {
the.quick.brown().fox.jumped().over.the().lazy()
.dog();
.dog();
}
}",
@"class C {
......
......@@ -52,9 +52,9 @@ private class CallExpressionCodeActionComputer :
/// <summary>
/// The indent trivia to insert if we are trying to align wrapped chunks with the
/// start of the original chunk.
/// first period of the original chunk.
/// </summary>
private readonly SyntaxTriviaList _indentAndAlignTrivia;
private readonly SyntaxTriviaList _firstPeriodIndentationTrivia;
/// <summary>
/// The indent trivia to insert if we are trying to simply smart-indent all wrapped
......@@ -80,7 +80,7 @@ private class CallExpressionCodeActionComputer :
// (i.e. <c>. name (arglist)</c>).
var firstPeriod = chunks[0][0];
_indentAndAlignTrivia = new SyntaxTriviaList(generator.Whitespace(
_firstPeriodIndentationTrivia = new SyntaxTriviaList(generator.Whitespace(
OriginalSourceText.GetOffset(firstPeriod.SpanStart).CreateIndentationString(UseTabs, TabSize)));
_smartIndentTrivia = new SyntaxTriviaList(generator.Whitespace(
......@@ -128,8 +128,12 @@ private ImmutableArray<Edit> GetWrapEdits(int wrappingColumn, bool align)
var firstChunk = _chunks[0];
DeleteAllSpacesInChunk(result, firstChunk);
var indentationTrivia = align ? _indentAndAlignTrivia : _smartIndentTrivia;
var position = indentationTrivia.FullSpan.Length + NormalizedWidth(firstChunk);
var indentationTrivia = align ? _firstPeriodIndentationTrivia : _smartIndentTrivia;
// Our starting position is at the end of the first chunk. That position
// is effectively the start of the first period, plus the length of the
// normalized first chuck.
var position = _firstPeriodIndentationTrivia.FullSpan.Length + NormalizedWidth(firstChunk);
// Now, go to each subsequent chunk. If keeping it on the current line would
// cause us to go past the requested wrapping column, then wrap it and proceed.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册