This commit is contained in:
Alexey Kudravtsev
2017-03-10 20:08:52 +03:00
parent 6505694e95
commit 6caae6ff5e
@@ -127,6 +127,7 @@ import com.intellij.util.ui.UIUtil;
import junit.framework.ComparisonFailure;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import javax.swing.*;
import java.io.File;
@@ -168,10 +169,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
private static void addGutterIconRenderer(GutterMark renderer, int offset, @NotNull SortedMap<Integer, List<GutterMark>> result) {
if (renderer == null) return;
List<GutterMark> renderers = result.get(offset);
if (renderers == null) {
result.put(offset, renderers = new SmartList<>());
}
List<GutterMark> renderers = result.computeIfAbsent(offset, k -> new SmartList<>());
renderers.add(renderer);
}
@@ -195,10 +193,12 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
}
@NotNull
@TestOnly
public static List<HighlightInfo> instantiateAndRun(@NotNull PsiFile file,
@NotNull Editor editor,
@NotNull int[] toIgnore,
boolean canChangeDocument) {
ApplicationManager.getApplication().assertIsDispatchThread();
Project project = file.getProject();
ensureIndexesUpToDate(project);
DaemonCodeAnalyzerImpl codeAnalyzer = (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(project);