use of com.intellij.refactoring.typeCook.deductive.builder.Result in project intellij-community by JetBrains.
the class TypeCookProcessor method findUsages.
@NotNull
protected UsageInfo[] findUsages() {
final SystemBuilder systemBuilder = new SystemBuilder(myProject, mySettings);
final ReductionSystem commonSystem = systemBuilder.build(myElements);
myResult = new Result(commonSystem);
final ReductionSystem[] systems = commonSystem.isolate();
for (final ReductionSystem system : systems) {
if (system != null) {
final ResolverTree tree = new ResolverTree(system);
tree.resolve();
final Binding solution = tree.getBestSolution();
if (solution != null) {
myResult.incorporateSolution(solution);
}
}
}
final Set<PsiElement> changedItems = myResult.getCookedElements();
final UsageInfo[] usages = new UsageInfo[changedItems.size()];
int i = 0;
for (final PsiElement element : changedItems) {
if (!(element instanceof PsiTypeCastExpression)) {
usages[i++] = new UsageInfo(element) {
public String getTooltipText() {
return myResult.getCookedType(element).getCanonicalText();
}
};
} else {
usages[i++] = new UsageInfo(element);
}
}
return usages;
}
Aggregations