- 所有超级接口:
PsiElement,PsiExternalReferenceHost
Marks PSI element as (potentially) containing text in another language.
Injected language PSI does not embed into the PSI tree of the hosting element,
but is used by the IDE for highlighting, completion and other code insight actions.
In order to do the injection, you have to
- Implement
fleet.com.intellij.psi.LanguageInjectorto describe exact place where injection should occur. - Register injection in
fleet.com.intellij.psi.LanguageInjector#EXTENSION_POINT_NAMEextension point.
You don't have to implement PsiLanguageInjectionHost by yourself, unless you want to inject something into your own custom PSI.
For all returned injected PSI elements, InjectedLanguageManager#getInjectionHost(PsiElement) returns PsiLanguageInjectionHost they were injected into.
-
嵌套类概要
嵌套类修饰符和类型接口说明static interfacestatic interface -
字段概要
从接口继承的字段 com.intellij.psi.PsiElement
EMPTY_ARRAY -
方法概要
修饰符和类型方法说明@NotNull LiteralTextEscaper<? extends PsiLanguageInjectionHost>booleanupdateText(@NotNull String text) Update the host element using the provided text of the injected file.从接口继承的方法 com.intellij.psi.PsiElement
add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getFirstChild, getLanguage, getLastChild, getNavigationElement, getNextSibling, getNode, getOriginalElement, getParent, getPrevSibling, getReference, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, isEquivalentTo, isPhysical, isValid, isWritable, replace, textContains, textMatches, textMatches, textToCharArray, toString
-
方法详细资料
-
isValidHost
boolean isValidHost()- 返回:
trueif this instance can accept injections,falseotherwise
-
updateText
Update the host element using the provided text of the injected file. It may be required to escape characters fromtextin accordance with the host language syntax. The implementation may delegate toElementManipulators#handleContentChange(PsiElement, String)ifElementManipulatorimplementation is registered for this element class.- 参数:
text- text of the injected file- 返回:
- the updated instance
-
createLiteralTextEscaper
- 返回:
LiteralTextEscaperinstance which will be used to convert the content of this host element to the content of injected file
-