Merge remote-tracking branch 'origin/master'

This commit is contained in:
Dmitry Trofimov
2014-12-10 21:32:03 +01:00
4 changed files with 38 additions and 15 deletions
@@ -37,6 +37,7 @@ public class RunContentDescriptor implements Disposable {
private final String myDisplayName;
private final Icon myIcon;
private final String myHelpId;
private RunnerLayoutUi myRunnerLayoutUi = null;
private boolean myActivateToolWindowWhenAdded = true;
private boolean myReuseToolWindowActivation = false;
@@ -72,6 +73,7 @@ public class RunContentDescriptor implements Disposable {
public RunContentDescriptor(@NotNull RunProfile profile, @NotNull ExecutionResult executionResult, @NotNull RunnerLayoutUi ui) {
this(executionResult.getExecutionConsole(), executionResult.getProcessHandler(), ui.getComponent(), profile.getName(),
profile.getIcon());
myRunnerLayoutUi = ui;
if (executionResult instanceof DefaultExecutionResult) {
myRestartActions = ((DefaultExecutionResult)executionResult).getRestartActions();
}
@@ -209,4 +211,17 @@ public class RunContentDescriptor implements Disposable {
public void setAutoFocusContent(boolean autoFocusContent) {
myAutoFocusContent = autoFocusContent;
}
/**
* Returns the runner layout UI interface that can be used to manage the sub-tabs in this run/debug tab, if available.
* (The runner layout UI is used, for example, by debugger tabs which have multiple sub-tabs, but is not used by other tabs
* which only display a single piece of content.
*
* @since 14.1
* @return the RunnerLayoutUi instance or null if this tab does not use RunnerLayoutUi for managing its contents.
*/
@Nullable
public RunnerLayoutUi getRunnerLayoutUi() {
return myRunnerLayoutUi;
}
}
@@ -23,6 +23,7 @@ import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.intellij.psi.impl.PsiManagerEx;
@@ -94,12 +95,13 @@ public class StubTreeLoaderImpl extends StubTreeLoader {
SerializedStubTree stubTree = datas.get(0);
if (!stubTree.contentLengthMatches(vFile.getLength(), getCurrentTextContentLength(project, vFile, document))) {
//todo find another way of early stub-ast mismatch prevention
//return processError(vFile,
// "Outdated stub in index: " + StubUpdatingIndex.getIndexingStampInfo(vFile) +
// ", docSaved=" + saved +
// ", queried at " + vFile.getTimeStamp(),
// null);
return processError(vFile,
"Outdated stub in index: " + StubUpdatingIndex.getIndexingStampInfo(vFile) +
", doc=" + document +
", docSaved=" + saved +
", wasIndexedAlready=" + wasIndexedAlready +
", queried at " + vFile.getTimeStamp(),
null);
}
Stub stub;
@@ -131,7 +133,7 @@ public class StubTreeLoaderImpl extends StubTreeLoader {
}
if (document != null) {
return document.getTextLength();
return PsiDocumentManager.getInstance(project).getLastCommittedText(document).length();
}
return -1;
}
@@ -46,7 +46,7 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.stubs.StubUpdatingIndex");
// todo remove once we don't need this for stub-ast mismatch debug info
private static final FileAttribute INDEXED_STAMP = new FileAttribute("stubIndexStamp", 1, false);
private static final FileAttribute INDEXED_STAMP = new FileAttribute("stubIndexStamp", 2, false);
public static final ID<Integer, SerializedStubTree> INDEX_ID = ID.create("Stubs");
@@ -127,7 +127,13 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi
if (rootStub == null) return;
VirtualFile file = inputData.getFile();
int contentLength = file.getFileType().isBinary() ? -1 : inputData.getContentAsText().length();
int contentLength;
if (file.getFileType().isBinary()) {
contentLength = -1;
}
else {
contentLength = ((FileContentImpl)inputData).getPsiFileForPsiDependentIndex().getTextLength();
}
rememberIndexingStamp(file, contentLength);
final BufferExposingByteArrayOutputStream bytes = new BufferExposingByteArrayOutputStream();
@@ -17,14 +17,14 @@ package com.intellij.openapi.ui;
import com.intellij.ide.DataManager;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.CommonShortcuts;
import com.intellij.openapi.actionSystem.DataProvider;
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
import com.intellij.openapi.actionSystem.impl.MouseGestureManager;
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.project.ProjectManagerAdapter;
import com.intellij.openapi.project.ProjectManagerListener;
import com.intellij.openapi.project.*;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.DimensionService;
import com.intellij.openapi.util.Disposer;
@@ -228,7 +228,7 @@ public class FrameWrapper implements Disposable, DataProvider {
}
private void addCloseOnEsc(final RootPaneContainer frame) {
new AnAction() {
new DumbAwareAction() {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
MenuSelectionManager menuSelectionManager = MenuSelectionManager.defaultManager();