use of com.python.pydev.analysis.refactoring.refactorer.RefactorerFindReferences in project Pydev by fabioz.
the class ClassHierarchySearchTest method assertIsIn.
private HierarchyNodeModel assertIsIn(String name, String modName, List<HierarchyNodeModel> parents) {
FastStringBuffer available = new FastStringBuffer();
for (HierarchyNodeModel model : parents) {
available.append(model.name).append(" - ").append(model.moduleName);
if (model.name.equals(name)) {
if (modName == null) {
return model;
} else if (model.moduleName.equals(modName) || model.moduleName.startsWith(modName)) {
return model;
}
}
}
try {
RefactorerFindReferences references = new RefactorerFindReferences();
RefactoringRequest request = new RefactoringRequest(null, null, nature);
request.qualifier = name;
List<Tuple<List<ModulesKey>, IPythonNature>> findPossibleReferences = references.findPossibleReferences(request);
String errorMsg = "Unable to find node with name:" + name + " mod:" + modName + "\nAvailable:" + available + "\n\nPythonpath: " + nature.getPythonPathNature().getOnlyProjectPythonPathStr(true) + "\n" + "Found possible references: " + StringUtils.join("\n", findPossibleReferences);
fail(errorMsg);
} catch (CoreException e) {
throw new RuntimeException(e);
}
return null;
}
Aggregations