sourcekitd: define a new custom buffer for expression type response.

This custom buffer encapsulates the memory layout details of the response
for the expression type request. From the client side, each expression type
is represented as a tuple of {expr_offset, expr_length, printed_type}.

rdar://35199889
This commit is contained in:
Xi Ge
2019-02-21 17:53:20 -08:00
parent 05d3c4b328
commit 3fc52305a3
14 changed files with 269 additions and 29 deletions

View File

@@ -2057,8 +2057,7 @@ void SwiftLangSupport::collectExpressionTypes(StringRef FileName,
llvm::raw_svector_ostream OS(TypeBuffer);
ExpressionTypesInFile Result;
for (auto Item: collectExpressionType(*SF, Scratch, OS)) {
Result.Results.push_back({Item.offset, Item.length, Item.typeOffset,
Item.typeLength});
Result.Results.push_back({Item.offset, Item.length, Item.typeOffset});
}
Result.TypeBuffer = OS.str();
Receiver(Result);