This commit is contained in:
Alexey Kudravtsev
2016-03-11 13:26:46 +03:00
parent 0289ea9e8b
commit 2d6396adf4
2 changed files with 4 additions and 5 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -180,9 +180,8 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
public void run() {
highlight.run();
progress.checkCanceled();
HighlightingSession highlightingSession = HighlightingSessionImpl.getHighlightingSession(file, progress);
PostHighlightingVisitor highlightingVisitor = new PostHighlightingVisitor(file, document, refCountHolder);
highlightingVisitor.collectHighlights(file, holder, progress);
highlightingVisitor.collectHighlights(holder, progress);
}
});
}
@@ -74,12 +74,12 @@ public class HighlightingSessionImpl implements HighlightingSession {
@Nullable EditorColorsScheme editorColorsScheme) {
HighlightingSession session = getHighlightingSession(psiFile, progressIndicator);
if (session == null) {
session = new HighlightingSessionImpl(psiFile, editor, progressIndicator, editorColorsScheme);
ConcurrentMap<PsiFile, HighlightingSession> map = progressIndicator.getUserData(HIGHLIGHTING_SESSION);
if (map == null) {
map = progressIndicator.putUserDataIfAbsent(HIGHLIGHTING_SESSION, ContainerUtil.newConcurrentMap());
}
session = ConcurrencyUtil.cacheOrGet(map, psiFile, session);
session = ConcurrencyUtil.cacheOrGet(map, psiFile,
new HighlightingSessionImpl(psiFile, editor, progressIndicator, editorColorsScheme));
}
return session;
}