Java 类com.intellij.lang.TokenWrapper 实例源码

项目:intellij-ce-playground    文件:LexerTestCase.java   
private static String getTokenText(Lexer lexer) {
  final IElementType tokenType = lexer.getTokenType();
  if (tokenType instanceof TokenWrapper) {
    return ((TokenWrapper)tokenType).getValue();
  }

  String text = lexer.getBufferSequence().subSequence(lexer.getTokenStart(), lexer.getTokenEnd()).toString();
  text = StringUtil.replace(text, "\n", "\\n");
  return text;
}
项目:intellij-ce-playground    文件:ForeignLeafPsiElement.java   
@NotNull
private static IElementType dereferenceElementType(@NotNull IElementType type) {
  while ( type instanceof TokenWrapper)
    type = (( TokenWrapper ) type ).getDelegate();

  return type;
}
项目:glsl4idea    文件:MultiRemapPsiBuilderAdapter.java   
@Nullable
@Override
public IElementType getTokenType() {
    if (waitingTokens.isEmpty()) {
        return super.getTokenType();
    } else if (waitingTokens.get(0) instanceof TokenWrapper) {
        return ((TokenWrapper) waitingTokens.get(0)).getDelegate();
    }
    return waitingTokens.get(0);
}
项目:glsl4idea    文件:MultiRemapPsiBuilderAdapter.java   
@Nullable
@Override
public String getTokenText() {
    if (waitingTokens.isEmpty()) {
        return super.getTokenText();
    } else if (waitingTokens.get(0) instanceof TokenWrapper) {
        return ((TokenWrapper) waitingTokens.get(0)).getValue();
    }
    return "";
}
项目:tools-idea    文件:LexerTestCase.java   
private static String getTokenText(Lexer lexer) {
  final IElementType tokenType = lexer.getTokenType();
  if (tokenType instanceof TokenWrapper) {
    return ((TokenWrapper)tokenType).getValue();
  }

  String text = lexer.getBufferSequence().subSequence(lexer.getTokenStart(), lexer.getTokenEnd()).toString();
  text = StringUtil.replace(text, "\n", "\\n");
  return text;
}
项目:consulo    文件:LexerTestCase.java   
private static String getTokenText(Lexer lexer) {
  final IElementType tokenType = lexer.getTokenType();
  if (tokenType instanceof TokenWrapper) {
    return ((TokenWrapper)tokenType).getValue();
  }

  String text = lexer.getBufferSequence().subSequence(lexer.getTokenStart(), lexer.getTokenEnd()).toString();
  text = StringUtil.replace(text, "\n", "\\n");
  return text;
}
项目:tools-idea    文件:ForeignLeafPsiElement.java   
private static IElementType dereferenceElementType(IElementType type) {
  while ( type instanceof TokenWrapper)
    type = (( TokenWrapper ) type ).getDelegate();

  return type;
}
项目:consulo    文件:ForeignLeafPsiElement.java   
private static IElementType dereferenceElementType(IElementType type) {
  while ( type instanceof TokenWrapper)
    type = (( TokenWrapper ) type ).getDelegate();

  return type;
}