[NFC] Adopt new ImportPath types and terminology

# Conflicts:
#	lib/IDE/CodeCompletion.cpp
This commit is contained in:
Brent Royal-Gordon
2020-09-10 19:05:40 -07:00
parent 1ed3caece6
commit cff4ddf13a
52 changed files with 375 additions and 361 deletions

View File

@@ -41,18 +41,17 @@ using namespace swift;
using namespace ide;
static ModuleDecl *getModuleByFullName(ASTContext &Ctx, StringRef ModuleName) {
SmallVector<Located<Identifier>, 4>
AccessPath;
ImportPath::Module::Builder modulePath;
while (!ModuleName.empty()) {
StringRef SubModuleName;
std::tie(SubModuleName, ModuleName) = ModuleName.split('.');
AccessPath.push_back({ Ctx.getIdentifier(SubModuleName), SourceLoc() });
modulePath.push_back(Ctx.getIdentifier(SubModuleName));
}
return Ctx.getModule(AccessPath);
return Ctx.getModule(modulePath.get());
}
static ModuleDecl *getModuleByFullName(ASTContext &Ctx, Identifier ModuleName) {
return Ctx.getModule({ Located<Identifier>(ModuleName, SourceLoc()) });
return Ctx.getModule(ImportPath::Module::Builder(ModuleName).get());
}
namespace {