mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
more checkcanceled
This commit is contained in:
+2
@@ -46,6 +46,7 @@ import com.intellij.openapi.fileTypes.SyntaxHighlighter;
|
||||
import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -498,6 +499,7 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP
|
||||
final TextAttributes defaultAttrs = myGlobalScheme.getAttributes(HighlighterColors.TEXT);
|
||||
|
||||
for (Trinity<IElementType, PsiLanguageInjectionHost, TextRange> token : tokens) {
|
||||
ProgressManager.checkCanceled();
|
||||
IElementType tokenType = token.getFirst();
|
||||
PsiLanguageInjectionHost injectionHost = token.getSecond();
|
||||
TextRange textRange = token.getThird();
|
||||
|
||||
+2
@@ -304,11 +304,13 @@ public class InjectedLanguageUtil {
|
||||
PsiFile hostPsiFile = documentManager.getPsiFile(hostDocument);
|
||||
assert hostPsiFile != null;
|
||||
for (RangeMarker rangeMarker : injected) {
|
||||
ProgressManager.checkCanceled();
|
||||
PsiElement element = rangeMarker.isValid() ? hostPsiFile.findElementAt(rangeMarker.getStartOffset()) : null;
|
||||
if (element == null) {
|
||||
injected.remove(rangeMarker);
|
||||
continue;
|
||||
}
|
||||
ProgressManager.checkCanceled();
|
||||
// it is here reparse happens and old file contents replaced
|
||||
enumerate(element, hostPsiFile, new PsiLanguageInjectionHost.InjectedPsiVisitor() {
|
||||
public void visit(@NotNull PsiFile injectedPsi, @NotNull List<PsiLanguageInjectionHost.Shred> places) {
|
||||
|
||||
Reference in New Issue
Block a user