mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Remove IDEInspectionFileRequest
We now maintain a mapping of buffer IDs to SourceFiles on the SourceManager we can use.
This commit is contained in:
@@ -912,20 +912,6 @@ ArrayRef<SourceFile *> ModuleDecl::getPrimarySourceFiles() const {
|
||||
return evaluateOrDefault(eval, PrimarySourceFilesRequest{mutableThis}, {});
|
||||
}
|
||||
|
||||
SourceFile *IDEInspectionFileRequest::evaluate(Evaluator &evaluator,
|
||||
ModuleDecl *mod) const {
|
||||
const auto &SM = mod->getASTContext().SourceMgr;
|
||||
assert(mod->isMainModule() && "Can only do completion in the main module");
|
||||
assert(SM.hasIDEInspectionTargetBuffer() && "Not in IDE inspection mode?");
|
||||
|
||||
for (auto *file : mod->getFiles()) {
|
||||
auto *SF = dyn_cast<SourceFile>(file);
|
||||
if (SF && SF->getBufferID() == SM.getIDEInspectionTargetBufferID())
|
||||
return SF;
|
||||
}
|
||||
llvm_unreachable("Couldn't find the completion file?");
|
||||
}
|
||||
|
||||
#define FORWARD(name, args) \
|
||||
for (const FileUnit *file : getFiles()) { \
|
||||
file->name args; \
|
||||
|
||||
Reference in New Issue
Block a user