Tabnine Logo
Indent.getNormalIndent
Code IndexAdd Tabnine to your IDE (free)

How to use
getNormalIndent
method
in
com.intellij.formatting.Indent

Best Java code snippets using com.intellij.formatting.Indent.getNormalIndent (Showing top 20 results out of 315)

origin: go-lang-plugin-org/go-lang-idea-plugin

private Indent indentOfMultipleDeclarationChild(@NotNull IElementType childType, @NotNull IElementType specType) {
 if (childType == specType) {
  return Indent.getNormalIndent();
 }
 return COMMENTS.contains(childType) && myNode.findChildByType(specType) != null ? Indent.getNormalIndent() : Indent.getNoneIndent();
}
origin: go-lang-plugin-org/go-lang-idea-plugin

@NotNull
private static Indent indentIfNotBrace(@NotNull ASTNode child) {
 return BRACES_TOKEN_SET.contains(child.getElementType()) ? Indent.getNoneIndent() : Indent.getNormalIndent();
}
origin: ballerina-platform/ballerina-lang

  return Indent.getNormalIndent();
} else if (parentElementType == BallerinaTypes.RECORD_LITERAL_BODY) {
  return Indent.getNormalIndent();
} else if (parentElementType == BallerinaTypes.WAIT_FOR_COLLECTION) {
  if (childElementType != BallerinaTypes.LEFT_BRACE && childElementType != BallerinaTypes.RIGHT_BRACE) {
    return Indent.getNormalIndent();
        || parentElementType == BallerinaTypes.COMMITTED_CLAUSE
        || parentElementType == BallerinaTypes.RECORD_TYPE_NAME)) {
  return Indent.getNormalIndent();
} else if (parentElementType == BallerinaTypes.CALLABLE_UNIT_SIGNATURE) {
  return Indent.getIndent(Indent.Type.NORMAL, true, true);
} else if (childElementType == BallerinaTypes.RETURN_PARAMETER) {
  return Indent.getNormalIndent();
} else if (childElementType == BallerinaTypes.RETURN_TYPE) {
  return Indent.getIndent(Indent.Type.NORMAL, true, true);
  return Indent.getIndent(Indent.Type.NORMAL, true, true);
} else if (parentElementType == BallerinaTypes.MATCH_PATTERN_CLAUSE) {
  return Indent.getNormalIndent();
} else if (childElementType == BallerinaTypes.FIELD_DEFINITION
    || childElementType == BallerinaTypes.RECORD_REST_FIELD_DEFINITION) {
  return Indent.getNormalIndent();
} else if (childElementType == BallerinaTypes.SERVICE_BODY_MEMBER
    && parentElementType == BallerinaTypes.SERVICE_BODY) {
  return Indent.getNormalIndent();
} else if (childElementType == BallerinaTypes.TYPE_REFERENCE
    && parentElementType == BallerinaTypes.RECORD_FIELD_DEFINITION_LIST) {
  return Indent.getNormalIndent();
origin: KronicDeth/intellij-elixir

@NotNull
private List<com.intellij.formatting.Block> buildKeywordsChildren(@NotNull ASTNode keywords,
                                 @NotNull Wrap keywordPairWrap) {
  return buildChildren(
      keywords,
      (child, childElementType, blockList) -> {
        if (childElementType == KEYWORD_PAIR) {
          blockList.add(buildChild(child, keywordPairWrap, Indent.getNormalIndent()));
        } else {
          // commas and comments
          blockList.add(buildChild(child));
        }
        return blockList;
      }
  );
}
origin: KronicDeth/intellij-elixir

@NotNull
private List<com.intellij.formatting.Block> buildAssociationsBaseChildren(
    @NotNull ASTNode associationsBase,
    @NotNull Wrap containerAssociationOperationWrap) {
  return buildChildren(
      associationsBase,
      (child, childElementType, blockList) -> {
        if (childElementType == CONTAINER_ASSOCIATION_OPERATION) {
          blockList.add(buildChild(child, containerAssociationOperationWrap, Indent.getNormalIndent()));
        } else {
          blockList.add(buildChild(child));
        }
        return blockList;
      }
  );
}
origin: go-lang-plugin-org/go-lang-idea-plugin

@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
 Indent childIndent = Indent.getNoneIndent();
 IElementType parentType = myNode.getElementType();
 if (BLOCKS_TOKEN_SET.contains(parentType) ||
   parentType == IMPORT_DECLARATION ||
   parentType == CONST_DECLARATION ||
   parentType == VAR_DECLARATION ||
   parentType == TYPE_DECLARATION ||
   parentType == ARGUMENT_LIST) {
  childIndent = Indent.getNormalIndent();
 }
 if (parentType == EXPR_SWITCH_STATEMENT || parentType == TYPE_SWITCH_STATEMENT || parentType == SELECT_STATEMENT) {
  List<Block> subBlocks = getSubBlocks();
  Block block = subBlocks.size() > newChildIndex ? subBlocks.get(newChildIndex - 1) : null;
  if (block instanceof GoFormattingBlock) {
   IElementType type = ((GoFormattingBlock)block).getNode().getElementType();
   if (type == TYPE_CASE_CLAUSE || type == EXPR_CASE_CLAUSE) {
    childIndent = Indent.getNormalIndent();
   }
   else if (type == COMM_CLAUSE) {
    childIndent = Indent.getNormalIndent(true);
   }
  }
 }
 return new ChildAttributes(childIndent, null);
}
origin: KronicDeth/intellij-elixir

@NotNull
private List<com.intellij.formatting.Block> buildMapArgumentsChildren(@NotNull ASTNode mapArguments,
                                   @Nullable Wrap openingCurlyWrap,
                                   @Nullable Indent elementIndent,
                                   @Nullable Wrap mapArgumentsWrap,
                                   @Nullable Alignment mapArgumentsAlignment) {
  return buildContainerChildren(
      mapArguments,
      OPENING_CURLY,
      openingCurlyWrap,
      elementIndent,
      mapArgumentsWrap,
      CLOSING_CURLY,
      mapArgumentsAlignment,
      (child, childElementType, tailWrap, childrenIndent, blockList) -> {
        if (childElementType == MAP_CONSTRUCTION_ARGUMENTS) {
          blockList.addAll(buildMapConstructArgumentsChildren(child, tailWrap));
        } else if (childElementType == MAP_UPDATE_ARGUMENTS) {
          blockList.addAll(buildMapUpdateArgumentsChildren(child, tailWrap));
        } else {
          blockList.add(buildChild(child, tailWrap, Indent.getNormalIndent()));
        }
        return blockList;
      });
}
origin: ballerina-platform/ballerina-lang

Indent childIndent = Indent.getNoneIndent();
if (myNode.getElementType() == BallerinaTypes.CALLABLE_UNIT_BODY) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.WORKER_WITH_STATEMENTS_BLOCK) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.SERVICE_BODY) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.RECORD_LITERAL) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.RECORD_LITERAL_BODY) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.WORKER_BODY) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.WHILE_STATEMENT_BODY) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.FORK_JOIN_STATEMENT) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.MATCH_STATEMENT_BODY) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.VAR_MATCH_PATTERN) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.STATIC_MATCH_PATTERN) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.FOREACH_STATEMENT) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.IF_CLAUSE) {
  childIndent = Indent.getNormalIndent();
} else if (myNode.getElementType() == BallerinaTypes.ELSE_IF_CLAUSE) {
  childIndent = Indent.getNormalIndent();
origin: KronicDeth/intellij-elixir

@Nullable
private Indent stabChildrenIndent(@NotNull ASTNode stab) {
  Indent childrenIndent;
  if (firstOnLine(stab)) {
    ASTNode stabParent = stab.getTreeParent();
    childrenIndent = Indent.getNormalIndent(
        stabParent.getElementType() == DO_BLOCK &&
            codeStyleSettings(stabParent).ALIGN_UNMATCHED_CALL_DO_BLOCKS ==
                CodeStyleSettings.UnmatchedCallDoBlockAlignment.CALL.value
    );
  } else {
    childrenIndent = null;
  }
  return childrenIndent;
}
origin: KronicDeth/intellij-elixir

if (childElementType == ACCESS_EXPRESSION) {
  blockList.addAll(buildAccessExpressionChildren(child, tailWrap, Indent.getNormalIndent()));
} else if (childElementType == CLOSING_PARENTHESIS) {
  blockList.add(buildChild(child, tailWrap, parentAlignment, Indent.getNoneIndent()));
} else {
  blockList.add(buildChild(child, tailWrap, Indent.getNormalIndent()));
origin: go-lang-plugin-org/go-lang-idea-plugin

@NotNull
private Indent calcIndent(@NotNull ASTNode child) {
 IElementType parentType = myNode.getElementType();
 IElementType type = child.getElementType();
 if (type == SWITCH_START) return Indent.getNoneIndent();
 if (parentType == BLOCK && type == SELECT_STATEMENT) return Indent.getNoneIndent();
 if (parentType == SELECT_STATEMENT && type == RBRACE) return Indent.getNormalIndent();
 if (parentType == ARGUMENT_LIST && type != LPAREN && type != RPAREN) return Indent.getNormalIndent();
 if ((parentType == EXPR_CASE_CLAUSE || parentType == TYPE_CASE_CLAUSE) && (type == CASE || type == DEFAULT)) return Indent.getNoneIndent();
 if (BLOCKS_TOKEN_SET.contains(parentType)) return indentIfNotBrace(child);
 if (parentType == IMPORT_DECLARATION) return indentOfMultipleDeclarationChild(type, IMPORT_SPEC);
 if (parentType == CONST_DECLARATION) return indentOfMultipleDeclarationChild(type, CONST_SPEC);
 if (parentType == VAR_DECLARATION) return indentOfMultipleDeclarationChild(type, VAR_SPEC);
 if (parentType == TYPE_DECLARATION) return indentOfMultipleDeclarationChild(type, TYPE_SPEC);
 if (parentType == COMM_CLAUSE && child.getPsi() instanceof GoStatement) return Indent.getNormalIndent();
 if (child.getPsi() instanceof GoExpression) return Indent.getContinuationWithoutFirstIndent(); 
 return Indent.getNoneIndent();
}
origin: KronicDeth/intellij-elixir

                                    @Nullable Alignment endAlignment) {
boolean relativeToIndirectParent = !firstOnLine(anonymousFunction) && !lastArgument(anonymousFunction);
Indent stabIndent = Indent.getNormalIndent(relativeToIndirectParent);
origin: KronicDeth/intellij-elixir

@NotNull
private List<com.intellij.formatting.Block> buildParentheticalStabChildren(@NotNull ASTNode parentheticalStab) {
  Indent childIndent = Indent.getNormalIndent();
  Wrap stabBodyChildrenWrap;
  if (parentheticalStab.textContains('\n')) {
    stabBodyChildrenWrap = null;
  } else {
    stabBodyChildrenWrap = Wrap.createWrap(WrapType.CHOP_DOWN_IF_LONG, true);
  }
  return buildChildren(
      parentheticalStab,
      (child, childElementType, blockList) -> {
        if (childElementType == SEMICOLON) {
          blockList.add(
              buildChild(child, Wrap.createWrap(WrapType.NONE, true), childIndent)
          );
        } else if (childElementType == STAB) {
          blockList.addAll(buildStabChildren((CompositeElement) child, stabBodyChildrenWrap));
        } else {
          blockList.add(buildChild(child));
        }
        return blockList;
      }
  );
}
origin: KronicDeth/intellij-elixir

openingWrap,
containerValueWrap(child),
Indent.getNormalIndent(true),
null
openingWrap,
listContainerValueWrap(child),
Indent.getNormalIndent(true),
null
openingWrap,
mapContainerValueWrap(openingWrap, child),
Indent.getNormalIndent(true),
null
openingWrap,
containerValueWrap(child),
Indent.getNormalIndent(true),
null
origin: KronicDeth/intellij-elixir

@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
  ChildAttributes childAttributes;
  if (newChildIndex > 0) {
    childAttributes = DELEGATE_TO_PREV_CHILD;
  } else if (myNode.getElementType() == DO) {
    boolean indentRelativeToDirectParent =
        codeStyleSettings(myNode).ALIGN_UNMATCHED_CALL_DO_BLOCKS ==
            CodeStyleSettings.UnmatchedCallDoBlockAlignment.CALL.value;
    Indent indent = Indent.getNormalIndent(indentRelativeToDirectParent);
    childAttributes = new ChildAttributes(
        indent,
        /* all children share the same alignment as expressions inside a doBlock above the stab are assumed
          to be aligned on the left-side */
        Alignment.createAlignment()
    );
  } else {
    childAttributes = super.getChildAttributes(newChildIndex);
  }
  return childAttributes;
}
origin: KronicDeth/intellij-elixir

} else if (childElementType == END_OF_EXPRESSION) {
  blockList.addAll(
      buildEndOfExpressionChildren(child, null, Indent.getNormalIndent())
  );
} else if (childElementType == STAB) {
origin: KronicDeth/intellij-elixir

IElementType stabParentElementType = stabParent.getElementType();
childrenIndent = Indent.getNormalIndent(
    stabParentElementType == DO_BLOCK &&
        codeStyleSettings(stabParent).ALIGN_UNMATCHED_CALL_DO_BLOCKS ==
        childrenIndent = Indent.getNormalIndent();
      } else {
origin: KronicDeth/intellij-elixir

  blocks = buildArrowOperationChildren(parent, null);
} else if (parentElementType == BIT_STRING) {
  blocks = buildBitStringChildren(parent, null, childrenWrap, Indent.getNormalIndent(), childrenAlignment);
} else if (parentElementType == BLOCK_ITEM) {
  blocks = buildBlockItemChildren(parent, parentAlignment);
  blocks = buildLineChildren(parent);
} else if (parentElementType == LIST) {
  blocks = buildListChildren(parent, null, childrenWrap, Indent.getNormalIndent(), childrenAlignment);
} else if (MATCHED_CALL_TOKEN_SET.contains(parentElementType)) {
  blocks = buildMatchedCallChildren(parent, parentWrap, parentAlignment);
  blocks = buildTupleChildren(parent, null, childrenWrap, Indent.getNormalIndent(), childrenAlignment);
} else if (WHEN_OPERATION_TOKEN_SET.contains(parentElementType)) {
  blocks = buildWhenOperationChildren(parent);
origin: halirutan/Mathematica-IntelliJ-Plugin

@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
 return new ChildAttributes(Indent.getNormalIndent(false), null);
}
origin: Camelcade/Perl5-IDEA

 @Nullable
 @Override
 public Indent getChildIndent(@NotNull PerlAstBlock block, int newChildIndex) {
  IElementType elementType = block.getElementType();
  if (elementType == HTML_MASON_ARGS_BLOCK || elementType == HTML_MASON_ATTR_BLOCK) {
   return Indent.getNormalIndent();
  }
  return super.getChildIndent(block, newChildIndex);
 }
}
com.intellij.formattingIndentgetNormalIndent

Popular methods of Indent

  • getNoneIndent
  • getAbsoluteNoneIndent
  • getContinuationWithoutFirstIndent
  • getContinuationIndent
  • getIndent
  • getSpaceIndent
  • getType

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now