This commit is contained in:
Vladimir Krivosheev
2016-12-01 15:29:14 +01:00
parent 9f31026d75
commit a912be6187
4 changed files with 5 additions and 9 deletions
@@ -105,8 +105,7 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
try {
if (myProject != null) {
FileEditorManager editorManager = FileEditorManager.getInstance(myProject);
VirtualFile[] openFiles = editorManager.getOpenFiles();
for (VirtualFile openFile : openFiles) {
for (VirtualFile openFile : editorManager.getOpenFiles()) {
editorManager.closeFile(openFile);
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 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.
@@ -59,8 +59,7 @@ public class AddAllOpenFilesToFavorites extends AnAction implements DumbAware {
ArrayList<PsiFile> result = new ArrayList<>();
final FileEditorManager editorManager = FileEditorManager.getInstance(project);
final PsiManager psiManager = PsiManager.getInstance(project);
final VirtualFile[] openFiles = editorManager.getOpenFiles();
for (VirtualFile openFile : openFiles) {
for (VirtualFile openFile : editorManager.getOpenFiles()) {
if (!openFile.isValid()) continue;
final PsiFile psiFile = psiManager.findFile(openFile);
if (psiFile != null) {
@@ -297,8 +297,7 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest
protected void tearDown() throws Exception {
try {
FileEditorManager editorManager = FileEditorManager.getInstance(getProject());
VirtualFile[] openFiles = editorManager.getOpenFiles();
for (VirtualFile openFile : openFiles) {
for (VirtualFile openFile : editorManager.getOpenFiles()) {
editorManager.closeFile(openFile);
}
deleteVFile();
@@ -1174,8 +1174,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
DaemonCodeAnalyzerSettings.getInstance().setImportHintEnabled(true); // return default value to avoid unnecessary save
FileEditorManager editorManager = FileEditorManager.getInstance(getProject());
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
VirtualFile[] openFiles = editorManager.getOpenFiles();
for (VirtualFile openFile : openFiles) {
for (VirtualFile openFile : editorManager.getOpenFiles()) {
editorManager.closeFile(openFile);
}
}