35
35
#include " swift/Frontend/ModuleInterfaceSupport.h"
36
36
#include " swift/IRGen/TBDGen.h"
37
37
#include " swift/Migrator/MigratorOptions.h"
38
- #include " swift/Parse/CodeCompletionCallbacks .h"
38
+ #include " swift/Parse/IDEInspectionCallbacks .h"
39
39
#include " swift/Parse/Parser.h"
40
40
#include " swift/Sema/SourceLoader.h"
41
41
#include " swift/Serialization/Validation.h"
@@ -95,13 +95,14 @@ class CompilerInvocation {
95
95
IRGenOptions IRGenOpts;
96
96
TBDGenOptions TBDGenOpts;
97
97
ModuleInterfaceOptions ModuleInterfaceOpts;
98
- llvm::MemoryBuffer *CodeCompletionBuffer = nullptr ;
98
+ llvm::MemoryBuffer *IDEInspectionTargetBuffer = nullptr ;
99
99
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 ;
103
104
104
- CodeCompletionCallbacksFactory *CodeCompletionFactory = nullptr ;
105
+ IDEInspectionCallbacksFactory *IDEInspectionFactory = nullptr ;
105
106
106
107
public:
107
108
CompilerInvocation ();
@@ -322,22 +323,22 @@ class CompilerInvocation {
322
323
return FrontendOpts.InputsAndOutputs .getSingleOutputFilename ();
323
324
}
324
325
325
- void setCodeCompletionPoint (llvm::MemoryBuffer *Buf, unsigned Offset) {
326
+ void setIDEInspectionTarget (llvm::MemoryBuffer *Buf, unsigned Offset) {
326
327
assert (Buf);
327
- CodeCompletionBuffer = Buf;
328
- CodeCompletionOffset = Offset;
328
+ IDEInspectionTargetBuffer = Buf;
329
+ IDEInspectionOffset = Offset;
329
330
// We don't need typo-correction for code-completion.
330
331
// FIXME: This isn't really true, but is a performance issue.
331
332
LangOpts.TypoCorrectionLimit = 0 ;
332
333
}
333
334
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 );
336
337
}
337
338
338
339
// / \returns true if we are doing code completion.
339
- bool isCodeCompletion () const {
340
- return CodeCompletionOffset != ~0U ;
340
+ bool isIDEInspection () const {
341
+ return IDEInspectionOffset != ~0U ;
341
342
}
342
343
343
344
// / Retrieve a module hash string that is suitable for uniquely
@@ -588,9 +589,9 @@ class CompilerInstance {
588
589
589
590
const CompilerInvocation &getInvocation () const { return Invocation; }
590
591
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
592
593
// / file.
593
- SourceFile *getCodeCompletionFile () const ;
594
+ SourceFile *getIDEInspectionFile () const ;
594
595
595
596
private:
596
597
// / Set up the file system by loading and validating all VFS overlay YAML
@@ -609,7 +610,7 @@ class CompilerInstance {
609
610
// / \return false if successful, true on error.
610
611
bool setupDiagnosticVerifierIfNeeded ();
611
612
612
- Optional<unsigned > setUpCodeCompletionBuffer ();
613
+ Optional<unsigned > setUpIDEInspectionTargetBuffer ();
613
614
614
615
// / Find a buffer for a given input file and ensure it is recorded in
615
616
// / SourceMgr, PartialModules, or InputSourceCodeBufferIDs as appropriate.
0 commit comments