mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IOOBE
This commit is contained in:
+1
-2
@@ -86,8 +86,7 @@ class InjectedSelfElementInfo extends SelfElementInfo {
|
||||
PsiDocumentManager documentManager = PsiDocumentManager.getInstance(hostFile.getProject());
|
||||
Document document = documentManager.getDocument(hostFile);
|
||||
if (document != null && documentManager.isUncommited(document)) {
|
||||
List<DocumentWindow> documents = InjectedLanguageUtil.getCachedInjectedDocuments(hostFile);
|
||||
for (DocumentWindow documentWindow : documents) {
|
||||
for (DocumentWindow documentWindow : InjectedLanguageUtil.getCachedInjectedDocuments(hostFile)) {
|
||||
PsiFile injected = documentManager.getPsiFile(documentWindow);
|
||||
if (injected != null) {
|
||||
visitor.visit(injected, Collections.<PsiLanguageInjectionHost.Shred>emptyList());
|
||||
|
||||
+11
-7
@@ -143,7 +143,9 @@ public class InjectedLanguageManagerImpl extends InjectedLanguageManager impleme
|
||||
RangeMarker rangeMarker = documentWindow.getHostRanges()[0];
|
||||
PsiElement element = rangeMarker.isValid() ? hostPsiFile.findElementAt(rangeMarker.getStartOffset()) : null;
|
||||
if (element == null) {
|
||||
injected.remove(documentWindow);
|
||||
synchronized (PsiLock.LOCK) {
|
||||
injected.remove(documentWindow);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
final DocumentWindow[] stillInjectedDocument = {null};
|
||||
@@ -155,12 +157,14 @@ public class InjectedLanguageManagerImpl extends InjectedLanguageManager impleme
|
||||
PsiDocumentManagerImpl.checkConsistency(injectedPsi, stillInjectedDocument[0]);
|
||||
}
|
||||
});
|
||||
if (stillInjectedDocument[0] == null) {
|
||||
injected.remove(documentWindow);
|
||||
}
|
||||
else if (stillInjectedDocument[0] != documentWindow) {
|
||||
injected.remove(documentWindow);
|
||||
injected.add(stillInjectedDocument[0]);
|
||||
synchronized (PsiLock.LOCK) {
|
||||
if (stillInjectedDocument[0] == null) {
|
||||
injected.remove(documentWindow);
|
||||
}
|
||||
else if (stillInjectedDocument[0] != documentWindow) {
|
||||
injected.remove(documentWindow);
|
||||
injected.add(stillInjectedDocument[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
+1
@@ -385,6 +385,7 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar, ModificationT
|
||||
TreeUtil.clearCaches((TreeElement)parsedNode);
|
||||
}
|
||||
|
||||
// under com.intellij.psi.PsiLock.LOCK
|
||||
private static PsiFile registerDocument(final DocumentWindowImpl documentWindow,
|
||||
final PsiFile injectedPsi,
|
||||
final Place shreds,
|
||||
|
||||
Reference in New Issue
Block a user