[RangeInfo] Using the underlying token array reference to represent the content of a range under selection. (#11106)

Comparing to CharSourceRange, token stream is a better way because we can preserve comment information at the start of the range.

Needed for rdar://33437855
This commit is contained in:
Xi Ge
2017-07-21 16:19:25 -07:00
committed by Mishal Shah
parent 92509d10cb
commit ac348b597a
3 changed files with 45 additions and 28 deletions

View File

@@ -1355,7 +1355,7 @@ static void resolveRange(SwiftLangSupport &Lang,
ASTInvok->applyTo(CompInvok);
RangeInfo Result;
Result.RangeKind = Lang.getUIDForRangeKind(Info.Kind);
Result.RangeContent = Info.Content.str();
Result.RangeContent = Info.getContent().str();
switch (Info.Kind) {
case RangeKind::SingleExpression: {
SmallString<64> SS;