/** * Remembers the selection of a right hand side type (proposal type) for a certain left hand side * (expected type) in content assist. * * @param lhs the left hand side / expected type * @param rhs the selected right hand side */ public void remember(IType lhs, IType rhs) { Assert.isLegal(lhs != null); Assert.isLegal(rhs != null); try { if (!isCacheableRHS(rhs)) return; ITypeHierarchy hierarchy = rhs.newSupertypeHierarchy(getProgressMonitor()); if (hierarchy.contains(lhs)) { // TODO remember for every member of the LHS hierarchy or not? Yes for now. IType[] allLHSides = hierarchy.getAllSupertypes(lhs); String rhsQualifiedName = rhs.getFullyQualifiedName(); for (int i = 0; i < allLHSides.length; i++) rememberInternal(allLHSides[i], rhsQualifiedName); rememberInternal(lhs, rhsQualifiedName); } } catch (JavaModelException x) { JavaPlugin.log(x); } }