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

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

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

origin: KronicDeth/intellij-elixir

@Override
public Indent getIndent() {
  return Indent.getNoneIndent();
}
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: 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

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
@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);
}
origin: KronicDeth/intellij-elixir

@NotNull
private List<com.intellij.formatting.Block> buildOperatorRuleChildren(
    @NotNull ASTNode operatorRule,
    @Nullable Wrap operatorWrap,
    @Nullable Alignment operatorAlignment,
    @Nullable Alignment rightCommentAlignment
) {
  final Alignment[] commentAlignment = {operatorAlignment};
  Indent operatorIndent = Indent.getNoneIndent();
  final Indent[] commentIndent = {operatorIndent};
  return buildChildren(
      operatorRule,
      (child, childElementType, blockList) -> {
        if (OPERATOR_TOKEN_SET.contains(childElementType)) {
          blockList.add(buildChild(child, operatorWrap, operatorAlignment, operatorIndent));
          commentAlignment[0] = rightCommentAlignment;
          commentIndent[0] = null;
        } else {
          blockList.add(buildChild(child, commentAlignment[0], commentIndent[0]));
        }
        return blockList;
      }
  );
}
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

@NotNull
private List<com.intellij.formatting.Block> buildHeredocChildren(CompositeElement heredoc) {
  ASTNode heredocPrefix = heredoc.findChildByType(HEREDOC_PREFIX);
  int heredocPrefixLength = 0;
  if (heredocPrefix != null) {
    heredocPrefixLength = heredocPrefix.getTextLength();
  }
  Indent indent = Indent.getNoneIndent();
  int finalHeredocPrefixLength = heredocPrefixLength;
  return buildChildren(
      heredoc,
      (child, childElementType, blockList) -> {
        if (HEREDOC_LINE_TOKEN_SET.contains(childElementType)) {
          blockList.addAll(buildHeredocLineChildren(child, finalHeredocPrefixLength));
        } else if (childElementType != HEREDOC_PREFIX) {
          /* The heredocPrefix while important for determining the significant white space in each heredoc
            line, is normal, insignificant whitespace when shifting the lines, so it has no block */
          blockList.add(buildChild(child, indent));
        }
        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

  blockList.add(buildChild(child, tailWrap, parentAlignment, Indent.getNoneIndent()));
} else if (childElementType == COMMA) {
  blockList.add(buildChild(child));
origin: ballerina-platform/ballerina-lang

@NotNull
@Override
public FormattingModel createModel(PsiElement element, CodeStyleSettings settings) {
  if (!isGrammarViolated(element.getNode())) {
    BallerinaBlock rootBlock = new BallerinaBlock(element.getNode(), null, Indent.getNoneIndent(), null,
        settings, createSpaceBuilder(settings), new HashMap<>());
    return FormattingModelProvider
        .createFormattingModelForPsiFile(element.getContainingFile(), rootBlock, settings);
  // If the plugin grammar tree is not generated correctly for the file, code reformat should not work.
  } else {
    AbstractBlock rootBlock = new AbstractBlock(element.getNode(), null, null) {
      @Nullable
      @Override
      public Spacing getSpacing(@Nullable Block child1, @NotNull Block child2) {
        return null;
      }
      @Override
      public boolean isLeaf() {
        return false;
      }
      @Override
      protected List<Block> buildChildren() {
        return new LinkedList<>();
      }
    };
    return FormattingModelProvider
        .createFormattingModelForPsiFile(element.getContainingFile(), rootBlock, settings);
  }
}
origin: KronicDeth/intellij-elixir

  blockList.addAll(
      buildEndOfExpressionChildren(child, finalChildrenAlignment, Indent.getNoneIndent())
  );
} else if (childElementType == WHEN_INFIX_OPERATOR) {
origin: ballerina-platform/ballerina-lang

  return Indent.getNormalIndent();
return Indent.getNoneIndent();
origin: KronicDeth/intellij-elixir

(child, childElementType, blockList) -> {
  if (childElementType == closingElementType) {
    blockList.add(buildChild(child, tailWrap[0], closingAlignment, Indent.getNoneIndent()));
  } else if (childElementType == openingElementType) {
    blockList.add(buildChild(child, openingWrap));
origin: ballerina-platform/ballerina-lang

@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
  Indent childIndent = Indent.getNoneIndent();
  if (myNode.getElementType() == BallerinaTypes.CALLABLE_UNIT_BODY) {
    childIndent = Indent.getNormalIndent();
origin: Camelcade/Perl5-IDEA

@NotNull
protected Indent getForeignIndent() {
 //noinspection ConstantConditions
 return getForeignIndent(Indent.getNoneIndent());
}
origin: BashSupport/BashSupport

private ChildAttributes getAttributesByParent() {
  ASTNode astNode = myNode;
  final PsiElement psiParent = astNode.getPsi();
  if (psiParent instanceof BashFile) {
    return new ChildAttributes(Indent.getNoneIndent(), null);
  }
  return new ChildAttributes(Indent.getNoneIndent(), null);
}
origin: Camelcade/Perl5-IDEA

 @Nullable
 @Override
 public Indent getChildIndent(@NotNull PerlAstBlock block, int newChildIndex) {
  if (block.getElementType() == EmbeddedPerlParserDefinition.FILE) {
   return Indent.getNoneIndent();
  }
  return super.getChildIndent(block, newChildIndex);
 }
}
origin: halirutan/Mathematica-IntelliJ-Plugin

@NotNull
@Override
public ChildAttributes getChildAttributes(int newChildIndex) {
 if (isIncomplete()) {
  return new ChildAttributes(getIndent(), null);
 }
 return new ChildAttributes(Indent.getNoneIndent(), null);
}
origin: protostuff/protobuf-jetbrains-plugin

private void appendProtoBlocks(ASTNode protoRootNode, List<Block> blocks) {
  ASTNode child = protoRootNode.getFirstChildNode();
  Alignment alignment = Alignment.createAlignment();
  while (child != null) {
    if (!FormatterUtil.containsWhiteSpacesOnly(child)) {
      Block block = createBlock(child, alignment, Indent.getNoneIndent(), settings);
      blocks.add(block);
    }
    child = child.getTreeNext();
  }
}
com.intellij.formattingIndentgetNoneIndent

Popular methods of Indent

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • requestLocationUpdates (LocationManager)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Notification (javax.management)
  • Top plugins for WebStorm
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