Search in sources :

Example 1 with ModulesManager

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);
}
Also used : SourceModule(org.python.pydev.ast.codecompletion.revisited.modules.SourceModule) ModulesManager(org.python.pydev.ast.codecompletion.revisited.ModulesManager) MisconfigurationException(org.python.pydev.core.MisconfigurationException) ModulesKey(org.python.pydev.core.ModulesKey)

Aggregations

ModulesManager (org.python.pydev.ast.codecompletion.revisited.ModulesManager)1 SourceModule (org.python.pydev.ast.codecompletion.revisited.modules.SourceModule)1 MisconfigurationException (org.python.pydev.core.MisconfigurationException)1 ModulesKey (org.python.pydev.core.ModulesKey)1