mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit/CodeCompletion] Use callback function to run the second pass
To controls the lifetime of CompilerInstance within CompletionIntance. - Prevent from using the same CompilerInstance from multiple completion requests - Separate the stacktrace between "fast" and "normal" completions - Further code consolidation between various completion-like requests
This commit is contained in:
@@ -436,6 +436,16 @@ public:
|
||||
/// returns the original path;
|
||||
static std::string resolvePathSymlinks(StringRef FilePath);
|
||||
|
||||
/// Perform a completion like operation. It initializes a \c CompilerInstance,
|
||||
/// the calls \p Callback with it. \p Callback must perform the second pass
|
||||
/// using that instance.
|
||||
bool performCompletionLikeOperation(
|
||||
llvm::MemoryBuffer *UnresolvedInputFile, unsigned Offset,
|
||||
ArrayRef<const char *> Args,
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
|
||||
std::string &Error,
|
||||
llvm::function_ref<void(swift::CompilerInstance &)> Callback);
|
||||
|
||||
//==========================================================================//
|
||||
// LangSupport Interface
|
||||
//==========================================================================//
|
||||
|
||||
Reference in New Issue
Block a user