Search in sources :

Example 6 with Parameter

use of com.google.idea.blaze.base.lang.buildfile.psi.Parameter in project intellij by bazelbuild.

the class BuildEnterHandler method skipElement.

private static boolean skipElement(PsiElement element, int offset) {
    PsiElement parent = element.getParent();
    if (parent == null || parent.getNode() == null || parent instanceof PsiFileSystemItem) {
        return false;
    }
    TextRange childRange = element.getNode().getTextRange();
    return childRange.equals(parent.getNode().getTextRange()) || childRange.getStartOffset() == offset && (parent instanceof Argument || parent instanceof Parameter);
}
Also used : Argument(com.google.idea.blaze.base.lang.buildfile.psi.Argument) Parameter(com.google.idea.blaze.base.lang.buildfile.psi.Parameter) TextRange(com.intellij.openapi.util.TextRange) PsiFileSystemItem(com.intellij.psi.PsiFileSystemItem) PsiElement(com.intellij.psi.PsiElement)

Aggregations

Parameter (com.google.idea.blaze.base.lang.buildfile.psi.Parameter)6 FunctionStatement (com.google.idea.blaze.base.lang.buildfile.psi.FunctionStatement)5 BuildFile (com.google.idea.blaze.base.lang.buildfile.psi.BuildFile)3 WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)2 PsiElement (com.intellij.psi.PsiElement)2 PsiFileSystemItem (com.intellij.psi.PsiFileSystemItem)2 Test (org.junit.Test)2 NamedBuildLookupElement (com.google.idea.blaze.base.lang.buildfile.completion.NamedBuildLookupElement)1 Argument (com.google.idea.blaze.base.lang.buildfile.psi.Argument)1 Expression (com.google.idea.blaze.base.lang.buildfile.psi.Expression)1 ForStatement (com.google.idea.blaze.base.lang.buildfile.psi.ForStatement)1 FuncallExpression (com.google.idea.blaze.base.lang.buildfile.psi.FuncallExpression)1 StatementList (com.google.idea.blaze.base.lang.buildfile.psi.StatementList)1 TargetExpression (com.google.idea.blaze.base.lang.buildfile.psi.TargetExpression)1 LookupElement (com.intellij.codeInsight.lookup.LookupElement)1 TextRange (com.intellij.openapi.util.TextRange)1 Nullable (javax.annotation.Nullable)1