本文整理匯總了Java中com.intellij.psi.TokenType.CODE_FRAGMENT屬性的典型用法代碼示例。如果您正苦於以下問題:Java TokenType.CODE_FRAGMENT屬性的具體用法?Java TokenType.CODE_FRAGMENT怎麽用?Java TokenType.CODE_FRAGMENT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.intellij.psi.TokenType
的用法示例。
在下文中一共展示了TokenType.CODE_FRAGMENT屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: LuaCodeFragment
public LuaCodeFragment(Project project,
IElementType contentElementType,
boolean isPhysical,
@NonNls String name,
CharSequence text,
@Nullable PsiElement context) {
super(TokenType.CODE_FRAGMENT,
contentElementType,
PsiManagerEx.getInstanceEx(project).getFileManager().createFileViewProvider(
new LightVirtualFile(name, FileTypeManager.getInstance().getFileTypeByFileName(name), text), isPhysical)
);
setContext(context);
((SingleRootFileViewProvider)getViewProvider()).forceCachedPsi(this);
}
示例2: getTokenType
@Nullable
@Override
public IElementType getTokenType() {
if (myPos >= myEndOffset) {
return null;
}
if (findNextMarkIfStoppedOnMarkAndNotAtStart() != myEndOffset) {
return TokenType.CODE_FRAGMENT;
}
return TokenType.BAD_CHARACTER;
}
示例3: lazy
@NotNull
public static LazyParseableElement lazy(@NotNull final ILazyParseableElementType type, CharSequence text) {
final ASTNode node = type.createNode(text);
if (node != null) return (LazyParseableElement)node;
if (type == TokenType.CODE_FRAGMENT) {
return new CodeFragmentElement(null);
}
else if (type == TokenType.DUMMY_HOLDER) {
return new DummyHolderElement(text);
}
final LazyParseableElement customLazy = factory(type).createLazy(type, text);
return customLazy != null ? customLazy : DefaultFactoryHolder.DEFAULT.createLazy(type, text);
}
示例4: CodeFragmentElement
public CodeFragmentElement(CharSequence text) {
super(TokenType.CODE_FRAGMENT, text);
}