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

How to use
Indent
in
com.intellij.formatting

Best Java code snippets using com.intellij.formatting.Indent (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 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: 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);
} else if ((childElementType == BallerinaTypes.TUPLE_TYPE_NAME
    || childElementType == BallerinaTypes.UNION_TYPE_NAME) && (parentElementType
    == BallerinaTypes.RETURN_TYPE)) {
  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
origin: KronicDeth/intellij-elixir

@Override
public Indent getIndent() {
  return Indent.getNoneIndent();
}
origin: Camelcade/Perl5-IDEA

return Indent.getAbsoluteNoneIndent();
return Indent.getNormalIndent();
return Indent.getContinuationWithoutFirstIndent();
return isLast() ? Indent.getNormalIndent() : Indent.getContinuationWithoutFirstIndent();
return isLast() ? Indent.getNoneIndent() : Indent.getNormalIndent();
return Indent.getContinuationWithoutFirstIndent();
return Indent.getNormalIndent();
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: neueda/jetbrains-plugin-graph-database-support

    && (type == CypherTypes.READING_CLAUSE || type == CypherTypes.UPDATING_CLAUSE ||
    type == CypherTypes.READING_WITH_RETURN)) {
  return Indent.getNoneIndent();
  return Indent.getNoneIndent();
  return Indent.getNormalIndent();
  return Indent.getNormalIndent();
  return Indent.getNormalIndent();
  return Indent.getContinuationIndent();
  return Indent.getContinuationIndent();
  return Indent.getNormalIndent();
    return Indent.getContinuationIndent();
  return Indent.getContinuationIndent();
  return Indent.getContinuationIndent();
return Indent.getNoneIndent();
origin: KronicDeth/intellij-elixir

          endWrap,
          parentAlignment,
          Indent.getIndent(Indent.Type.NONE, indentRelativeToDirectParent, false)
      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.getSpaceIndent(normalIndentSize(stab), true);
} else {
  ASTNode stabParent = stab.getTreeParent();
        childrenIndent = Indent.getNormalIndent();
      } else {
        childrenIndent = Indent.getSpaceIndent(spaces, true);
origin: Camelcade/Perl5-IDEA

@Nullable
@Override
protected Indent getChildIndent() {
 IElementType elementType = myNode.getElementType();
 if (NORMAL_CHILD_INDENTED_CONTAINERS.contains(elementType)) {
  return Indent.getNormalIndent();
 }
 else if (CONTINUOS_CHILD_INDENTED_CONTAINERS.contains(elementType)) {
  return Indent.getContinuationWithoutFirstIndent();
 }
 return super.getChildIndent();
}
origin: Camelcade/Perl5-IDEA

public PerlSyntheticBlock(@NotNull PerlAstBlock realBlock,
             @NotNull List<Block> subBlocks,
             @Nullable Wrap wrap,
             @Nullable Alignment alignment,
             @NotNull PerlFormattingContext context) {
 if (subBlocks.isEmpty()) {
  throw new IllegalArgumentException("Subblocks should not be empty");
 }
 mySubBlocks = ContainerUtil.immutableList(new ArrayList<>(subBlocks));
 myRealBlock = realBlock;
 myWrap = wrap;
 myAlignment = alignment;
 myContext = context;
 myIndent = getFirstRealBlock().getIndent();
 mySubBlocks.stream()
  .filter(block -> block instanceof PerlAstBlock && block.getIndent() != Indent.getAbsoluteNoneIndent())
  .forEach(block -> ((PerlAstBlock)block)
   .setIndent(Indent.getContinuationWithoutFirstIndent()));
}
origin: protostuff/protobuf-jetbrains-plugin

  @Override
  public Indent getIndent() {
    return Indent.getAbsoluteNoneIndent();
  }
}
origin: KronicDeth/intellij-elixir

@NotNull
private List<com.intellij.formatting.Block> buildNoParenthesesKeywordsChildren(ASTNode noParenthesesKeywords) {
  return buildChildren(
      noParenthesesKeywords,
      (child, childElementType, blockList) -> {
        if (childElementType == NO_PARENTHESES_KEYWORD_PAIR) {
          blockList.add(buildChild(child, Indent.getIndent(Indent.Type.NONE, true, false)));
        } else {
          // commas and comments
          blockList.add(buildChild(child));
        }
        return blockList;
      }
  );
}
origin: KronicDeth/intellij-elixir

@NotNull
private List<com.intellij.formatting.Block> buildBlockListChildren(@NotNull ASTNode blockListNode,
                                  @Nullable Alignment parentAlignment) {
  return buildChildren(
      blockListNode,
      (child, childElementType, blockList) -> {
        blockList.add(buildChild(child, parentAlignment, Indent.getNoneIndent()));
        return blockList;
      }
  );
}
origin: Camelcade/Perl5-IDEA

return Indent.getContinuationIndent();
return Indent.getContinuationIndent();
 || isLast && BLOCK_CLOSERS.contains(nodeType)
) {
return Indent.getNoneIndent();
return Indent.getNoneIndent();
assert psi instanceof PerlHeredocElementImpl;
if (!((PerlHeredocElementImpl)psi).isIndentable()) {
 return Indent.getAbsoluteNoneIndent();
return Indent.getAbsoluteNoneIndent();
return Indent.getNoneIndent();
return Indent.getNoneIndent();
return Indent.getNoneIndent();
return Indent.getNoneIndent();
return Indent.getContinuationIndent();
   nodeType == ATTRIBUTE && prevSiblingElementType != COLON
  ) {
  return Indent.getContinuationIndent();
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: BashSupport/BashSupport

@NotNull
public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
  ASTNode node = element.getNode();
  assert node != null;
  PsiFile containingFile = element.getContainingFile();
  ASTNode astNode = containingFile.getNode();
  assert astNode != null;
  BashProjectSettings projectSettings = BashProjectSettings.storedSettings(containingFile.getProject());
  if (!projectSettings.isFormatterEnabled()) {
    return FormattingModelProvider.createFormattingModelForPsiFile(containingFile,
        new NoOpBlock(astNode), settings);
  }
  return FormattingModelProvider.createFormattingModelForPsiFile(containingFile,
      new BashBlock(astNode, null, Indent.getAbsoluteNoneIndent(), null, settings), settings);
}
origin: KronicDeth/intellij-elixir

@NotNull
private List<com.intellij.formatting.Block> buildNoParenthesesKeywordPairChildren(
    @NotNull ASTNode noParenthesesKeywordPair
) {
  Wrap keywordKeyWrap = Wrap.createWrap(WrapType.CHOP_DOWN_IF_LONG, true);
  Indent keywordKeyIndent = Indent.getIndent(Indent.Type.NONE, true, false);
  Wrap keywordPairColonWrap = Wrap.createChildWrap(keywordKeyWrap, WrapType.NONE, true);
  Wrap keywordValueWrap = Wrap.createChildWrap(keywordKeyWrap, WrapType.NONE, true);
  return buildChildren(
      noParenthesesKeywordPair,
      (child, childElementType, blockList) -> {
        if (childElementType == ACCESS_EXPRESSION) {
          blockList.addAll(buildContainerValueAccessExpressionChildren(child, keywordValueWrap));
        } else if (childElementType == KEYWORD_KEY) {
          blockList.add(buildChild(child, keywordKeyWrap, keywordKeyIndent));
        } else if (childElementType == KEYWORD_PAIR_COLON) {
          blockList.add(buildChild(child, keywordPairColonWrap));
        } else {
          blockList.add(buildChild(child, keywordValueWrap));
        }
        return blockList;
      }
  );
}
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: go-lang-plugin-org/go-lang-idea-plugin

@NotNull
@Override
public FormattingModel createModel(@NotNull PsiElement element, @NotNull CodeStyleSettings settings) {
 Block block = new GoFormattingBlock(element.getNode(), null, Indent.getNoneIndent(), null, settings, createSpacingBuilder(settings));
 return FormattingModelProvider.createFormattingModelForPsiFile(element.getContainingFile(), block, settings);
}
com.intellij.formattingIndent

Most used methods

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

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Collectors (java.util.stream)
  • JLabel (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Vim plugins
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