1 package com.intellij.structuralsearch.impl.matcher;
3 import com.intellij.psi.*;
4 import org.jetbrains.annotations.NonNls;
7 * Created by IntelliJ IDEA.
11 * To change this template use Options | File Templates.
13 public class MatchUtils {
14 public static final String SPECIAL_CHARS = "*(){}[]^$\\.-|";
16 public static final boolean compareWithNoDifferenceToPackage(final String typeImage,@NonNls final String typeImage2) {
17 if (typeImage == null || typeImage2 == null) return typeImage == typeImage2;
18 return typeImage2.endsWith(typeImage) && (
19 typeImage.length() == typeImage2.length() ||
20 typeImage2.charAt(typeImage2.length()-typeImage.length()-1)=='.' // package separator
24 public static PsiElement getReferencedElement(final PsiElement element) {
25 if (element instanceof PsiReference) {
26 return ((PsiReference)element).resolve();
29 /*if (element instanceof PsiTypeElement) {
30 PsiType type = ((PsiTypeElement)element).getType();
32 if (type instanceof PsiArrayType) {
33 type = ((PsiArrayType)type).getComponentType();
35 if (type instanceof PsiClassType) {
36 return ((PsiClassType)type).resolve();