use of com.intellij.openapi.editor.ex.DocumentEx in project intellij-community by JetBrains.
the class InjectedPsiCachedValueProvider method compute.
@Override
public CachedValueProvider.Result<MultiHostRegistrarImpl> compute(PsiElement element) {
PsiFile hostPsiFile = element.getContainingFile();
if (hostPsiFile == null)
return null;
FileViewProvider viewProvider = hostPsiFile.getViewProvider();
final DocumentEx hostDocument = (DocumentEx) viewProvider.getDocument();
if (hostDocument == null)
return null;
PsiManager psiManager = viewProvider.getManager();
final Project project = psiManager.getProject();
InjectedLanguageManagerImpl injectedManager = InjectedLanguageManagerImpl.getInstanceImpl(project);
final MultiHostRegistrarImpl result = doCompute(element, injectedManager, project, hostPsiFile);
return CachedValueProvider.Result.create(result, PsiModificationTracker.MODIFICATION_COUNT, hostDocument);
}
use of com.intellij.openapi.editor.ex.DocumentEx in project intellij-community by JetBrains.
the class PersistentRangeHighlighterImpl method translatedViaDiff.
private boolean translatedViaDiff(DocumentEvent e, DocumentEventImpl event) {
try {
myLine = event.translateLineViaDiff(myLine);
} catch (FilesTooBigForDiffException ignored) {
return false;
}
if (myLine < 0 || myLine >= getDocument().getLineCount()) {
invalidate(e);
} else {
DocumentEx document = getDocument();
setIntervalStart(document.getLineStartOffset(myLine));
setIntervalEnd(document.getLineEndOffset(myLine));
}
return true;
}
use of com.intellij.openapi.editor.ex.DocumentEx in project intellij-community by JetBrains.
the class EditorFactoryImpl method createDocument.
@NotNull
public Document createDocument(@NotNull CharSequence text, boolean acceptsSlashR, boolean allowUpdatesWithoutWriteAction) {
DocumentEx document = new DocumentImpl(text, acceptsSlashR, allowUpdatesWithoutWriteAction);
myEditorEventMulticaster.registerDocument(document);
return document;
}
use of com.intellij.openapi.editor.ex.DocumentEx in project intellij-community by JetBrains.
the class EditorFactoryImpl method createDocument.
@NotNull
public Document createDocument(boolean allowUpdatesWithoutWriteAction) {
DocumentEx document = new DocumentImpl("", allowUpdatesWithoutWriteAction);
myEditorEventMulticaster.registerDocument(document);
return document;
}
use of com.intellij.openapi.editor.ex.DocumentEx in project intellij-community by JetBrains.
the class EditorFactoryImpl method createDocument.
@Override
@NotNull
public Document createDocument(@NotNull CharSequence text) {
DocumentEx document = new DocumentImpl(text);
myEditorEventMulticaster.registerDocument(document);
return document;
}
Aggregations