mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
add extension to weigh up/down known elements (IDEA-60157)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.psi.util.proximity;
|
||||
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -29,6 +30,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class KnownElementWeigher extends ProximityWeigher {
|
||||
|
||||
public Comparable weigh(@NotNull final PsiElement element, @NotNull final ProximityLocation location) {
|
||||
for (ForcedElementWeigher weigher : Extensions.getExtensions(ForcedElementWeigher.EP_NAME)) {
|
||||
final Comparable weigh = weigher.getForcedWeigh(element);
|
||||
if (weigh != null) return weigh;
|
||||
}
|
||||
if (element instanceof PsiClass) {
|
||||
@NonNls final String qname = ((PsiClass)element).getQualifiedName();
|
||||
if (qname != null) {
|
||||
|
||||
Reference in New Issue
Block a user