Skip to content

Commit 4aa3f9c

Browse files
committed
Merge pull request #2972 from benlangmuir/index-finish-hook
2 parents 7c99877 + 5525319 commit 4aa3f9c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/swift/Index/IndexDataConsumer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class IndexDataConsumer {
3636
virtual bool recordRelatedEntity(const IndexSymbol &symbol) = 0;
3737
virtual bool finishSourceEntity(SymbolKind kind, SymbolSubKindSet subKinds,
3838
SymbolRoleSet roles) = 0;
39+
40+
virtual void finish() {}
3941
};
4042

4143
} // end namespace index

lib/Index/Index.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,7 @@ void index::indexSourceFile(SourceFile *SF, StringRef hash,
10691069
unsigned bufferID = SF->getBufferID().getValue();
10701070
IndexSwiftASTWalker walker(consumer, SF->getASTContext(), bufferID);
10711071
walker.visitModule(*SF->getParentModule(), hash);
1072+
consumer.finish();
10721073
}
10731074

10741075
void index::indexModule(ModuleDecl *module, StringRef hash,
@@ -1077,4 +1078,5 @@ void index::indexModule(ModuleDecl *module, StringRef hash,
10771078
IndexSwiftASTWalker walker(consumer, module->getASTContext(),
10781079
/*bufferID*/ -1);
10791080
walker.visitModule(*module, hash);
1081+
consumer.finish();
10801082
}

0 commit comments

Comments
 (0)