3535#include " swift/Frontend/ModuleInterfaceSupport.h"
3636#include " swift/IRGen/TBDGen.h"
3737#include " swift/Migrator/MigratorOptions.h"
38- #include " swift/Parse/CodeCompletionCallbacks .h"
38+ #include " swift/Parse/IDEInspectionCallbacks .h"
3939#include " swift/Parse/Parser.h"
4040#include " swift/Sema/SourceLoader.h"
4141#include " swift/Serialization/Validation.h"
@@ -95,13 +95,14 @@ class CompilerInvocation {
9595 IRGenOptions IRGenOpts;
9696 TBDGenOptions TBDGenOpts;
9797 ModuleInterfaceOptions ModuleInterfaceOpts;
98- llvm::MemoryBuffer *CodeCompletionBuffer = nullptr ;
98+ llvm::MemoryBuffer *IDEInspectionTargetBuffer = nullptr ;
9999
100- // / Code completion offset in bytes from the beginning of the main
101- // / source file. Valid only if \c isCodeCompletion() == true.
102- unsigned CodeCompletionOffset = ~0U ;
100+ // / The offset that IDEInspection wants to further examine in offset of bytes
101+ // / from the beginning of the main source file. Valid only if
102+ // / \c isIDEInspection() == true.
103+ unsigned IDEInspectionOffset = ~0U ;
103104
104- CodeCompletionCallbacksFactory *CodeCompletionFactory = nullptr ;
105+ IDEInspectionCallbacksFactory *IDEInspectionFactory = nullptr ;
105106
106107public:
107108 CompilerInvocation ();
@@ -322,22 +323,22 @@ class CompilerInvocation {
322323 return FrontendOpts.InputsAndOutputs .getSingleOutputFilename ();
323324 }
324325
325- void setCodeCompletionPoint (llvm::MemoryBuffer *Buf, unsigned Offset) {
326+ void setIDEInspectionTarget (llvm::MemoryBuffer *Buf, unsigned Offset) {
326327 assert (Buf);
327- CodeCompletionBuffer = Buf;
328- CodeCompletionOffset = Offset;
328+ IDEInspectionTargetBuffer = Buf;
329+ IDEInspectionOffset = Offset;
329330 // We don't need typo-correction for code-completion.
330331 // FIXME: This isn't really true, but is a performance issue.
331332 LangOpts.TypoCorrectionLimit = 0 ;
332333 }
333334
334- std::pair<llvm::MemoryBuffer *, unsigned > getCodeCompletionPoint () const {
335- return std::make_pair (CodeCompletionBuffer, CodeCompletionOffset );
335+ std::pair<llvm::MemoryBuffer *, unsigned > getIDEInspectionTarget () const {
336+ return std::make_pair (IDEInspectionTargetBuffer, IDEInspectionOffset );
336337 }
337338
338339 // / \returns true if we are doing code completion.
339- bool isCodeCompletion () const {
340- return CodeCompletionOffset != ~0U ;
340+ bool isIDEInspection () const {
341+ return IDEInspectionOffset != ~0U ;
341342 }
342343
343344 // / Retrieve a module hash string that is suitable for uniquely
@@ -588,9 +589,9 @@ class CompilerInstance {
588589
589590 const CompilerInvocation &getInvocation () const { return Invocation; }
590591
591- // / If a code completion buffer has been set, returns the corresponding source
592+ // / If a IDE inspection buffer has been set, returns the corresponding source
592593 // / file.
593- SourceFile *getCodeCompletionFile () const ;
594+ SourceFile *getIDEInspectionFile () const ;
594595
595596private:
596597 // / Set up the file system by loading and validating all VFS overlay YAML
@@ -609,7 +610,7 @@ class CompilerInstance {
609610 // / \return false if successful, true on error.
610611 bool setupDiagnosticVerifierIfNeeded ();
611612
612- Optional<unsigned > setUpCodeCompletionBuffer ();
613+ Optional<unsigned > setUpIDEInspectionTargetBuffer ();
613614
614615 // / Find a buffer for a given input file and ensure it is recorded in
615616 // / SourceMgr, PartialModules, or InputSourceCodeBufferIDs as appropriate.
0 commit comments