本文整理汇总了Java中com.intellij.formatting.Indent.getContinuationWithoutFirstIndent方法的典型用法代码示例。如果您正苦于以下问题:Java Indent.getContinuationWithoutFirstIndent方法的具体用法?Java Indent.getContinuationWithoutFirstIndent怎么用?Java Indent.getContinuationWithoutFirstIndent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.formatting.Indent
的用法示例。
在下文中一共展示了Indent.getContinuationWithoutFirstIndent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChildIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public Indent getChildIndent() {
PsiElement element = myNode.getPsi();
if (element instanceof TagBlockElement) {
return Indent.getNormalIndent();
} else if (myNode.getPsi() instanceof TagElement) {
return Indent.getContinuationWithoutFirstIndent();
} else {
return Indent.getNoneIndent();
}
}
示例2: createJavaBlocks
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@NotNull
private List<Block> createJavaBlocks(@NotNull final List<ASTNode> subNodes) {
final ArrayList<Block> result = new ArrayList<Block>();
for (ASTNode node : subNodes) {
Indent indent = Indent.getContinuationWithoutFirstIndent(myIndentSettings.USE_RELATIVE_INDENTS);
result.add(newJavaBlock(node, mySettings, myJavaSettings, indent, null, AlignmentStrategy.getNullStrategy()));
}
return result;
}
示例3: visitCatchClause
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitCatchClause(GrCatchClause catchClause) {
if (myChild == catchClause.getBody()) {
myResult = Indent.getNoneIndent();
}
else {
myResult = Indent.getContinuationWithoutFirstIndent();
}
}
示例4: getSubBlocks
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@NotNull
@Override
public List<Block> getSubBlocks() {
if (mySubBlocks == null) {
mySubBlocks = new ArrayList<Block>();
final Indent indent = Indent.getContinuationWithoutFirstIndent();
mySubBlocks.add(new GroovyBlock(myNameElement.getNode(), indent, Wrap.createWrap(WrapType.NONE, false), myContext));
new GroovyBlockGenerator(this).addNestedChildrenSuffix(mySubBlocks, null, myTopLevel, myChildren, myChildren.size());
}
return mySubBlocks;
}
示例5: visitWhileStatement
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitWhileStatement(GrWhileStatement whileStatement) {
if (myChild == (whileStatement).getBody() && !TokenSets.BLOCK_SET.contains(myChildType)) {
myResult = Indent.getNormalIndent();
}
else if (myChild == whileStatement.getCondition()) {
myResult = Indent.getContinuationWithoutFirstIndent();
}
}
示例6: getChildIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
/**
* Calculates indent, based on code style, between parent block and child node
*
* @param parent parent block
* @param child child node
* @param prevChildNode previous child node
* @return indent
*/
@NotNull
public static Indent getChildIndent(@NotNull final LuaFormattingBlock parent, @Nullable final ASTNode prevChildNode, @NotNull final ASTNode child) {
ASTNode astNode = parent.getNode();
final PsiElement psiParent = astNode.getPsi();
// if (psiParent instanceof LuaAnonymousFunctionExpression)
// return Indent.getNormalIndent();
// For Lua Blocks
if (psiParent instanceof LuaBlock && !(psiParent instanceof LuaPsiFile) && !(psiParent.getParent() instanceof LuaRepeatStatement)) {
return Indent.getNormalIndent();
}
if (psiParent instanceof LuaTableConstructor) {
if (child.getElementType() == RCURLY)
return Indent.getNoneIndent();
if (child.getElementType() == LCURLY)
return Indent.getContinuationWithoutFirstIndent();
return Indent.getNormalIndent();
}
if ((child.getElementType() == LUADOC_COMMENT || child.getPsi() instanceof PsiComment) && psiParent instanceof LuaStatementElement) {
return Indent.getNormalIndent();
}
if (psiParent.getParent() instanceof LuaFunctionArguments) {
if (child.getElementType() == RPAREN)
return Indent.getNoneIndent();
if (child.getElementType() == LPAREN)
return Indent.getContinuationWithoutFirstIndent();
return Indent.getNormalIndent();
}
// For common code block
// if (BLOCK_SET.contains(astNode.getElementType())) {
// return indentForBlock(psiParent, child);
// }
return Indent.getNoneIndent();
}
示例7: build
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
public Block build(List<ASTNode> nodes) {
List<Block> blocks = buildBlocksFrom(nodes);
Indent indent = myBlockIndent != null ? myBlockIndent : Indent.getContinuationWithoutFirstIndent(myIndentSettings.USE_RELATIVE_INDENTS);
return new SyntheticCodeBlock(blocks, myBlockAlignment, mySettings, myJavaSettings, indent, myBlockWrap);
}
示例8: visitTypeArgumentList
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitTypeArgumentList(GrTypeArgumentList typeArgumentList) {
myResult = Indent.getContinuationWithoutFirstIndent();
}
示例9: visitListOrMap
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitListOrMap(GrListOrMap listOrMap) {
if (myChildType != GroovyTokenTypes.mLBRACK && myChildType != GroovyTokenTypes.mRBRACK) {
myResult = Indent.getContinuationWithoutFirstIndent();
}
}
示例10: visitArgumentList
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitArgumentList(GrArgumentList list) {
if (myChildType != GroovyTokenTypes.mLPAREN && myChildType != GroovyTokenTypes.mRPAREN) {
myResult = Indent.getContinuationWithoutFirstIndent();
}
}
示例11: visitAnnotationNameValuePair
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitAnnotationNameValuePair(GrAnnotationNameValuePair nameValuePair) {
myResult = Indent.getContinuationWithoutFirstIndent();
}
示例12: visitVariable
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitVariable(GrVariable variable) {
myResult = Indent.getContinuationWithoutFirstIndent();
}
示例13: visitForClause
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitForClause(GrForClause forClause) {
myResult = Indent.getContinuationWithoutFirstIndent();
}
示例14: visitArrayDeclaration
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitArrayDeclaration(GrArrayDeclaration arrayDeclaration) {
myResult = Indent.getContinuationWithoutFirstIndent();
}
示例15: visitAssignmentExpression
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitAssignmentExpression(GrAssignmentExpression expression) {
myResult = Indent.getContinuationWithoutFirstIndent();
}