use of org.python.pydev.ast.codecompletion.revisited.ModulesManager in project Pydev by fabioz.
the class AdditionalInfoTestsBase method addModuleToNature.
/**
* @param ast the ast that defines the module
* @param modName the module name
* @param natureToAdd the nature where the module should be added
*/
protected void addModuleToNature(final SimpleNode ast, String modName, PythonNature natureToAdd, File f) {
// this is to add the info from the module that we just created...
AbstractAdditionalDependencyInfo additionalInfo;
try {
additionalInfo = AdditionalProjectInterpreterInfo.getAdditionalInfoForProject(natureToAdd);
} catch (MisconfigurationException e) {
throw new RuntimeException(e);
}
additionalInfo.addAstInfo(ast, new ModulesKey(modName, f), false);
ModulesManager modulesManager = (ModulesManager) natureToAdd.getAstManager().getModulesManager();
SourceModule mod = (SourceModule) AbstractModule.createModule(ast, f, modName, natureToAdd);
modulesManager.doAddSingleModule(new ModulesKey(modName, f), mod);
}
Aggregations