提交 696a64a9 编写于 作者: P Petr Houska

Fix bug in case there's only attribute.

上级 5bac5ce2
......@@ -470,7 +470,13 @@ private static TextSpan GetSpanWithoutAttributes(SyntaxNode node, SyntaxNode roo
var endOfAttributeLists = attributeList.Last().Span.End;
var afterAttributesToken = root.FindTokenOnRightOfPosition(endOfAttributeLists);
return TextSpan.FromBounds(afterAttributesToken.Span.Start, node.Span.End);
var endOfNode = node.Span.End;
var startOfTokenAfterAttributes = afterAttributesToken.Span.Start;
var startOfNodeWithoutAttributes = endOfNode >= startOfTokenAfterAttributes
? afterAttributesToken.Span.Start
: endOfNode;
return TextSpan.FromBounds(startOfNodeWithoutAttributes, endOfNode);
}
return node.Span;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册