mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit/CursorInfo] Add constructor to call results
Cursor info for a constructor would previously give the cursor info for the containing type only. It now also adds cursor info for the constructor itself in a "secondary_symbols" field. Refactor `passCursorInfoForDecl` to use a single allocator rather than keeping track of positions in a buffer and assigning everything at the end of the function. Refactor the various available refactoring gathering functions to take a SmallVectorImpl and to not copy strings where they don't need to. Resolves rdar://75385556
This commit is contained in:
@@ -159,10 +159,13 @@ public:
|
||||
return;
|
||||
}
|
||||
const CursorInfoData &Info = Result.value();
|
||||
TestInfo.Name = Info.Name.str();
|
||||
TestInfo.Typename = Info.TypeName.str();
|
||||
TestInfo.Filename = Info.Filename.str();
|
||||
TestInfo.DeclarationLoc = Info.DeclarationLoc;
|
||||
if (!Info.Symbols.empty()) {
|
||||
const CursorSymbolInfo &MainSymbol = Info.Symbols[0];
|
||||
TestInfo.Name = std::string(MainSymbol.Name.str());
|
||||
TestInfo.Typename = MainSymbol.TypeName.str();
|
||||
TestInfo.Filename = MainSymbol.Filename.str();
|
||||
TestInfo.DeclarationLoc = MainSymbol.DeclarationLoc;
|
||||
}
|
||||
sema.signal();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user