InjectedLanguageManager
instead@Deprecated
public class InjectedLanguageUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
InjectedLanguageUtil.TokenInfo
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
static Key<java.lang.Boolean> |
FRANKENSTEIN_INJECTION
Deprecated.
|
static Key<IElementType> |
INJECTED_FRAGMENT_TYPE
Deprecated.
|
Constructor and Description |
---|
InjectedLanguageUtil()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static void |
enumerate(DocumentWindow documentWindow,
PsiFile hostPsiFile,
PsiLanguageInjectionHost.InjectedPsiVisitor visitor)
Deprecated.
|
static boolean |
enumerate(PsiElement host,
PsiFile containingFile,
boolean probeUp,
PsiLanguageInjectionHost.InjectedPsiVisitor visitor)
|
static boolean |
enumerate(PsiElement host,
PsiLanguageInjectionHost.InjectedPsiVisitor visitor)
Deprecated.
|
static PsiElement |
findElementAtNoCommit(PsiFile file,
int offset)
Deprecated.
Invocation of this method on uncommitted
file can lead to unexpected results, including throwing an exception! |
static PsiElement |
findElementInInjected(PsiLanguageInjectionHost injectionHost,
int offset)
Deprecated.
|
static <T extends PsiFileBase> |
findInjectedFile(PsiElement expression,
java.lang.Class<T> classToFind)
Deprecated.
Finds injected language in expression
|
static PsiFile |
findInjectedPsiNoCommit(PsiFile host,
int offset)
Deprecated.
Invocation of this method on uncommitted
host can lead to unexpected results, including throwing an exception! |
static PsiLanguageInjectionHost |
findInjectionHost(PsiElement psi)
Deprecated.
|
static PsiLanguageInjectionHost |
findInjectionHost(VirtualFile virtualFile)
Deprecated.
|
static ConcurrentList<DocumentWindow> |
getCachedInjectedDocuments(PsiFile hostPsiFile)
Deprecated.
|
static PsiFile |
getCachedInjectedFileWithLanguage(PsiElement element,
Language language)
Deprecated.
|
static Caret |
getCaretForInjectedLanguageNoCommit(Caret caret,
PsiFile file)
Deprecated.
Invocation of this method on uncommitted
file can lead to unexpected results, including throwing an exception! |
static DocumentWindow |
getDocumentWindow(PsiElement element)
Deprecated.
|
static Editor |
getEditorForInjectedLanguageNoCommit(Editor editor,
Caret caret,
PsiFile file)
Deprecated.
Invocation of this method on uncommitted
file can lead to unexpected results, including throwing an exception! |
static Editor |
getEditorForInjectedLanguageNoCommit(Editor editor,
PsiFile file)
Deprecated.
Invocation of this method on uncommitted
file can lead to unexpected results, including throwing an exception! |
static Editor |
getEditorForInjectedLanguageNoCommit(Editor editor,
PsiFile file,
int offset)
Deprecated.
Invocation of this method on uncommitted
file can lead to unexpected results, including throwing an exception! |
static java.util.List<InjectedLanguageUtil.TokenInfo> |
getHighlightTokens(PsiFile file)
Deprecated.
|
static Editor |
getInjectedEditorForInjectedFile(Editor hostEditor,
Caret hostCaret,
PsiFile injectedFile)
Deprecated.
|
static Editor |
getInjectedEditorForInjectedFile(Editor hostEditor,
PsiFile injectedFile)
Deprecated.
|
static int |
getInjectedStart(java.util.List<? extends PsiLanguageInjectionHost.Shred> places)
Deprecated.
|
static Place |
getShreds(FileViewProvider viewProvider)
Deprecated.
|
static Place |
getShreds(PsiFile injectedFile)
Deprecated.
|
static Editor |
getTopLevelEditor(Editor editor)
Deprecated.
|
static PsiFile |
getTopLevelFile(PsiElement element)
Deprecated.
|
static java.lang.String |
getUnescapedLeafText(PsiElement element,
boolean strict)
Deprecated.
|
static java.lang.String |
getUnescapedText(PsiFile file,
PsiElement startElement,
PsiElement endElement)
Deprecated.
|
static boolean |
hasInjections(PsiLanguageInjectionHost host)
Deprecated.
Use
InjectedLanguageManager.getInjectedPsiFiles(PsiElement) != null instead |
static int |
hostToInjectedUnescaped(DocumentWindow window,
int hostOffset)
Deprecated.
|
static void |
injectReference(MultiHostRegistrar registrar,
Language language,
java.lang.String prefix,
java.lang.String suffix,
PsiLanguageInjectionHost host,
TextRange rangeInsideHost)
Deprecated.
Start injecting the reference in
language in this place. |
static boolean |
isHighlightInjectionBackground(PsiLanguageInjectionHost host)
Deprecated.
|
static boolean |
isInInjectedLanguagePrefixSuffix(PsiElement element)
Deprecated.
|
static Editor |
openEditorFor(PsiFile file,
Project project)
Deprecated.
|
static <T> void |
putInjectedFileUserData(MultiHostRegistrar registrar,
Key<T> key,
T value)
Deprecated.
|
static <T> void |
putInjectedFileUserData(PsiElement element,
Language language,
Key<T> key,
T value)
Deprecated.
|
static BooleanRunnable |
reparse(PsiFile injectedPsiFile,
DocumentWindow injectedDocument,
PsiFile hostPsiFile,
Document hostDocument,
FileViewProvider hostViewProvider,
ProgressIndicator indicator,
ASTNode oldRoot,
ASTNode newRoot,
PsiDocumentManagerBase documentManager)
Deprecated.
|
public static final Key<IElementType> INJECTED_FRAGMENT_TYPE
public static final Key<java.lang.Boolean> FRANKENSTEIN_INJECTION
public static java.util.List<InjectedLanguageUtil.TokenInfo> getHighlightTokens(PsiFile file)
public static Place getShreds(FileViewProvider viewProvider)
public static void enumerate(DocumentWindow documentWindow, PsiFile hostPsiFile, PsiLanguageInjectionHost.InjectedPsiVisitor visitor)
@Deprecated public static boolean enumerate(PsiElement host, PsiLanguageInjectionHost.InjectedPsiVisitor visitor)
InjectedLanguageManager.enumerate(PsiElement, PsiLanguageInjectionHost.InjectedPsiVisitor)
instead@Deprecated public static boolean enumerate(PsiElement host, PsiFile containingFile, boolean probeUp, PsiLanguageInjectionHost.InjectedPsiVisitor visitor)
public static Editor getEditorForInjectedLanguageNoCommit(Editor editor, PsiFile file)
file
can lead to unexpected results, including throwing an exception!public static Editor getEditorForInjectedLanguageNoCommit(Editor editor, Caret caret, PsiFile file)
file
can lead to unexpected results, including throwing an exception!public static Caret getCaretForInjectedLanguageNoCommit(Caret caret, PsiFile file)
file
can lead to unexpected results, including throwing an exception!public static <T extends PsiFileBase> T findInjectedFile(PsiElement expression, java.lang.Class<T> classToFind)
T
- class that represents language we look forexpression
- where to findclassToFind
- class that represents language we look forpublic static Editor getEditorForInjectedLanguageNoCommit(Editor editor, PsiFile file, int offset)
file
can lead to unexpected results, including throwing an exception!public static Editor getInjectedEditorForInjectedFile(Editor hostEditor, PsiFile injectedFile)
public static Editor getInjectedEditorForInjectedFile(Editor hostEditor, Caret hostCaret, PsiFile injectedFile)
hostCaret
- if not null
, take into account caret's selection (in case it's not contained completely in injected fragment,
return host editor)public static PsiFile findInjectedPsiNoCommit(PsiFile host, int offset)
host
can lead to unexpected results, including throwing an exception!public static PsiElement findElementAtNoCommit(PsiFile file, int offset)
file
can lead to unexpected results, including throwing an exception!@Deprecated public static ConcurrentList<DocumentWindow> getCachedInjectedDocuments(PsiFile hostPsiFile)
InjectedLanguageManager.getCachedInjectedDocumentsInRange(PsiFile, TextRange)
instead@Deprecated public static PsiFile getTopLevelFile(PsiElement element)
InjectedLanguageManager.getTopLevelFile(PsiElement)
insteadpublic static boolean isInInjectedLanguagePrefixSuffix(PsiElement element)
public static int hostToInjectedUnescaped(DocumentWindow window, int hostOffset)
@Deprecated public static boolean hasInjections(PsiLanguageInjectionHost host)
InjectedLanguageManager.getInjectedPsiFiles(PsiElement)
!= null insteadpublic static java.lang.String getUnescapedText(PsiFile file, PsiElement startElement, PsiElement endElement)
public static java.lang.String getUnescapedLeafText(PsiElement element, boolean strict)
public static DocumentWindow getDocumentWindow(PsiElement element)
public static boolean isHighlightInjectionBackground(PsiLanguageInjectionHost host)
public static int getInjectedStart(java.util.List<? extends PsiLanguageInjectionHost.Shred> places)
public static PsiElement findElementInInjected(PsiLanguageInjectionHost injectionHost, int offset)
public static PsiLanguageInjectionHost findInjectionHost(PsiElement psi)
public static PsiLanguageInjectionHost findInjectionHost(VirtualFile virtualFile)
public static <T> void putInjectedFileUserData(PsiElement element, Language language, Key<T> key, T value)
@Deprecated public static <T> void putInjectedFileUserData(MultiHostRegistrar registrar, Key<T> key, T value)
putInjectedFileUserData(PsiElement, Language, Key, Object)
insteadpublic static PsiFile getCachedInjectedFileWithLanguage(PsiElement element, Language language)
public static void injectReference(MultiHostRegistrar registrar, Language language, java.lang.String prefix, java.lang.String suffix, PsiLanguageInjectionHost host, TextRange rangeInsideHost)
language
in this place.
Unlike MultiHostRegistrar.startInjecting(Language)
this method doesn't inject the full blown file in the other language.
Instead, it just marks some range as a reference in some language.
For example, you can inject file reference into string literal.
After that, it won't be highlighted as an injected fragment but still can be subject to e.g. "Goto declaraion" action.public static BooleanRunnable reparse(PsiFile injectedPsiFile, DocumentWindow injectedDocument, PsiFile hostPsiFile, Document hostDocument, FileViewProvider hostViewProvider, ProgressIndicator indicator, ASTNode oldRoot, ASTNode newRoot, PsiDocumentManagerBase documentManager)