Fix: IDEA-66621 (Create action from usage)

This commit is contained in:
Sergey Evdokimov
2011-03-17 14:43:53 +03:00
parent 46fa8b4baf
commit 7e3390e960
@@ -28,6 +28,7 @@ import com.intellij.psi.impl.source.tree.LeafElement;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.SearchScope;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.IncorrectOperationException;
@@ -1075,6 +1076,10 @@ public class PsiUtil {
return element instanceof LeafElement && ((LeafElement)element).getElementType() == type;
}
public static boolean isLeafElementOfType(@Nullable PsiElement element, TokenSet tokenSet) {
return element instanceof LeafElement && tokenSet.contains(((LeafElement)element).getElementType());
}
public static GrNamedArgument[] getFirstMapNamedArguments(GrCall grCall) {
GrNamedArgument[] res = grCall.getNamedArguments();
if (res.length > 0) return res;