当前位置: 首页>>代码示例>>Java>>正文


Java FormatterUtil.getPreviousNonWhitespaceLeaf方法代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:GroovySpacingProcessor.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:GroovySpacingProcessor.java

示例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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:GroovySpacingProcessor.java

示例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());
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:GroovySpacingProcessor.java

示例5: getPrevElementType

import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
static ASTNode getPrevElementType(final ASTNode child) {
  return FormatterUtil.getPreviousNonWhitespaceLeaf(child);
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:4,代码来源:SpacingUtil.java

示例6: getPrevElementType

import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
@Nullable
private static ASTNode getPrevElementType(final ASTNode child) {
  return FormatterUtil.getPreviousNonWhitespaceLeaf(child);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:JavaSpacePropertyProcessor.java

示例7: getPrevElementType

import com.intellij.psi.formatter.FormatterUtil; //导入方法依赖的package包/类
@Nullable
private static ASTNode getPrevElementType(final ASTNode child)
{
	return FormatterUtil.getPreviousNonWhitespaceLeaf(child);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:6,代码来源:JavaSpacePropertyProcessor.java


注:本文中的com.intellij.psi.formatter.FormatterUtil.getPreviousNonWhitespaceLeaf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。