mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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:
@@ -1524,7 +1524,6 @@ findModuleGroups(StringRef ModuleName, ArrayRef<const char *> Args,
|
||||
// Display diagnostics to stderr.
|
||||
PrintingDiagnosticConsumer PrintDiags;
|
||||
CI.addDiagnosticConsumer(&PrintDiags);
|
||||
std::vector<StringRef> Groups;
|
||||
std::string Error;
|
||||
if (getASTManager()->initCompilerInvocationNoInputs(Invocation, Args,
|
||||
CI.getDiags(), Error)) {
|
||||
@@ -1551,7 +1550,8 @@ findModuleGroups(StringRef ModuleName, ArrayRef<const char *> Args,
|
||||
Receiver(RequestResult<ArrayRef<StringRef>>::fromError(Error));
|
||||
return;
|
||||
}
|
||||
std::vector<StringRef> Scratch;
|
||||
Receiver(RequestResult<ArrayRef<StringRef>>::fromResult(
|
||||
collectModuleGroups(M, Scratch)));
|
||||
|
||||
llvm::SmallVector<StringRef, 0> Groups;
|
||||
collectModuleGroups(M, Groups);
|
||||
Receiver(RequestResult<ArrayRef<StringRef>>::fromResult(Groups));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user