本文整理汇总了Java中com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.getInjectedPsiFiles方法的典型用法代码示例。如果您正苦于以下问题:Java InjectedLanguageUtil.getInjectedPsiFiles方法的具体用法?Java InjectedLanguageUtil.getInjectedPsiFiles怎么用?Java InjectedLanguageUtil.getInjectedPsiFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil
的用法示例。
在下文中一共展示了InjectedLanguageUtil.getInjectedPsiFiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getXmlTagForSQLCompletion
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil; //导入方法依赖的package包/类
/**
* get xml tag for code completion
*
* @param psiElement psiElement
* @param psiFile current file
* @return xml tag
*/
@Nullable
public static XmlTag getXmlTagForSQLCompletion(PsiElement psiElement, PsiFile psiFile) {
if (!psiFile.isPhysical()) {
if (psiElement.getParent().getClass().getName().contains("com.intellij.sql.psi")) { // text only
if (!psiElement.isPhysical()) { //injected sql mode
//todo jacky resolve parameter code completion in sql
List<Pair<PsiElement,TextRange>> files = InjectedLanguageUtil.getInjectedPsiFiles(psiElement);
InjectedLanguageManager manager = InjectedLanguageManager.getInstance(psiElement.getProject());
PsiLanguageInjectionHost psiLanguageInjectionHost = manager.getInjectionHost(psiElement);
if (psiElement.getContainingFile() instanceof XmlFile) {
XmlFile xmlFile = (XmlFile) psiElement.getContainingFile();
final DomFileElement fileElement = DomManager.getDomManager(psiFile.getProject()).getFileElement(xmlFile, DomElement.class);
if (fileElement != null && fileElement.getRootElement() instanceof SqlMap) {
return getParentSentence(psiElement);
}
}
}
}
}
return null;
}
示例2: getInjectedPsi
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil; //导入方法依赖的package包/类
@Nullable
@Deprecated
public List<Pair<PsiElement, TextRange>> getInjectedPsi() {
return InjectedLanguageUtil.getInjectedPsiFiles(this);
}