本文整理汇总了Java中com.intellij.psi.formatter.FormatterUtil.getPreviousNonWhitespaceLeaf方法的典型用法代码示例。如果您正苦于以下问题:Java FormatterUtil.getPreviousNonWhitespaceLeaf方法的具体用法?Java FormatterUtil.getPreviousNonWhitespaceLeaf怎么用?Java FormatterUtil.getPreviousNonWhitespaceLeaf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.formatter.FormatterUtil
的用法示例。
在下文中一共展示了FormatterUtil.getPreviousNonWhitespaceLeaf方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: manageComments
import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
private boolean manageComments() {
if (mySettings.KEEP_FIRST_COLUMN_COMMENT && TokenSets.COMMENT_SET.contains(myType2)) {
if (!isAfterElementOrSemi(GroovyElementTypes.IMPORT_STATEMENT)) {
myResult = Spacing.createKeepingFirstColumnSpacing(0, Integer.MAX_VALUE, true, 1);
return true;
}
return false;
}
ASTNode prev = FormatterUtil.getPreviousNonWhitespaceLeaf(myChild2);
if (prev != null && prev.getElementType() == GroovyTokenTypes.mNLS) {
prev = FormatterUtil.getPreviousNonWhitespaceLeaf(prev);
}
if (prev != null && prev.getElementType() == GroovyTokenTypes.mSL_COMMENT) {
myResult = Spacing.createSpacing(0, Integer.MAX_VALUE, 1, mySettings.KEEP_LINE_BREAKS, keepBlankLines());
return true;
}
return false;
}
示例2: manageComments
import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
private boolean manageComments() {
if (mySettings.KEEP_FIRST_COLUMN_COMMENT && COMMENT_SET.contains(myType2)) {
if (myType1 != IMPORT_STATEMENT) {
myResult = Spacing.createKeepingFirstColumnSpacing(0, Integer.MAX_VALUE, true, 1);
}
return true;
}
ASTNode prev = FormatterUtil.getPreviousNonWhitespaceLeaf(myChild2);
if (prev != null && prev.getElementType() == mNLS) {
prev = FormatterUtil.getPreviousNonWhitespaceLeaf(prev);
}
if (prev != null && prev.getElementType() == mSL_COMMENT) {
myResult = Spacing.createSpacing(0, Integer.MAX_VALUE, 1, mySettings.KEEP_LINE_BREAKS, keepBlankLines());
return true;
}
return false;
}
示例3: createNonLFSpace
import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
private Spacing createNonLFSpace(int spaces, @Nullable final TextRange dependantRange, final boolean keepLineBreaks) {
final ASTNode prev = FormatterUtil.getPreviousNonWhitespaceLeaf(myChild2);
if (prev != null && prev.getElementType() == GroovyTokenTypes.mSL_COMMENT) {
return Spacing.createSpacing(0, Integer.MAX_VALUE, 1, keepLineBreaks, keepBlankLines());
}
else if (dependantRange != null) {
return Spacing.createDependentLFSpacing(spaces, spaces, dependantRange, keepLineBreaks, keepBlankLines());
}
else {
return Spacing.createSpacing(spaces, spaces, 0, keepLineBreaks, keepBlankLines());
}
}
示例4: createNonLFSpace
import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
private Spacing createNonLFSpace(int spaces, @Nullable final TextRange dependantRange, final boolean keepLineBreaks) {
final ASTNode prev = FormatterUtil.getPreviousNonWhitespaceLeaf(myChild2);
if (prev != null && prev.getElementType() == mSL_COMMENT) {
return Spacing.createSpacing(0, Integer.MAX_VALUE, 1, keepLineBreaks, keepBlankLines());
}
else if (dependantRange != null) {
return Spacing.createDependentLFSpacing(spaces, spaces, dependantRange, keepLineBreaks, keepBlankLines());
}
else {
return Spacing.createSpacing(spaces, spaces, 0, keepLineBreaks, keepBlankLines());
}
}
示例5: getPrevElementType
import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
static ASTNode getPrevElementType(final ASTNode child) {
return FormatterUtil.getPreviousNonWhitespaceLeaf(child);
}
示例6: getPrevElementType
import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
@Nullable
private static ASTNode getPrevElementType(final ASTNode child) {
return FormatterUtil.getPreviousNonWhitespaceLeaf(child);
}
示例7: getPrevElementType
import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
@Nullable
private static ASTNode getPrevElementType(final ASTNode child)
{
return FormatterUtil.getPreviousNonWhitespaceLeaf(child);
}