diff --git a/platform/lang-impl/src/com/intellij/execution/lineMarker/RunLineMarkerProvider.java b/platform/lang-impl/src/com/intellij/execution/lineMarker/RunLineMarkerProvider.java index 5b4a70dbebd4..c8bab0b1c432 100644 --- a/platform/lang-impl/src/com/intellij/execution/lineMarker/RunLineMarkerProvider.java +++ b/platform/lang-impl/src/com/intellij/execution/lineMarker/RunLineMarkerProvider.java @@ -40,7 +40,7 @@ public class RunLineMarkerProvider implements LineMarkerProvider { @Override public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) { List contributors = RunLineMarkerContributor.EXTENSION.allForLanguage(element.getLanguage()); - final DefaultActionGroup actionGroup = new DefaultActionGroup(); + DefaultActionGroup actionGroup = null; Icon icon = null; for (RunLineMarkerContributor contributor : contributors) { RunLineMarkerContributor.Info info = contributor.getInfo(element); @@ -50,6 +50,9 @@ public class RunLineMarkerProvider implements LineMarkerProvider { if (icon == null) { icon = info.icon; } + if (actionGroup == null) { + actionGroup = new DefaultActionGroup(); + } for (AnAction action : info.actions) { actionGroup.add(new LineMarkerActionWrapper(element, action)); } @@ -57,7 +60,9 @@ public class RunLineMarkerProvider implements LineMarkerProvider { } if (icon == null) return null; - return new LineMarkerInfo(element, element.getTextOffset(), icon, Pass.UPDATE_ALL, null, null, GutterIconRenderer.Alignment.CENTER) { + final DefaultActionGroup finalActionGroup = actionGroup; + return new LineMarkerInfo(element, element.getTextOffset(), icon, Pass.UPDATE_ALL, null, null, + GutterIconRenderer.Alignment.CENTER) { @Nullable @Override public GutterIconRenderer createGutterRenderer() { @@ -75,7 +80,7 @@ public class RunLineMarkerProvider implements LineMarkerProvider { @Nullable @Override public ActionGroup getPopupMenuActions() { - return actionGroup; + return finalActionGroup; } }; } diff --git a/platform/platform-impl/src/com/intellij/ide/ReopenProjectAction.java b/platform/platform-impl/src/com/intellij/ide/ReopenProjectAction.java index 2ece095ce65a..60776a0bdefb 100644 --- a/platform/platform-impl/src/com/intellij/ide/ReopenProjectAction.java +++ b/platform/platform-impl/src/com/intellij/ide/ReopenProjectAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -15,10 +15,7 @@ */ package com.intellij.ide; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.actionSystem.Presentation; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; @@ -48,7 +45,10 @@ public class ReopenProjectAction extends AnAction implements DumbAware { @Override public void actionPerformed(AnActionEvent e) { final int modifiers = e.getModifiers(); - final boolean forceOpenInNewFrame = (modifiers & InputEvent.CTRL_MASK) != 0 || (modifiers & InputEvent.SHIFT_MASK) != 0; + final boolean forceOpenInNewFrame = (modifiers & InputEvent.CTRL_MASK) != 0 + || (modifiers & InputEvent.SHIFT_MASK) != 0 + || e.getPlace() == ActionPlaces.WELCOME_SCREEN; + Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); if (!new File(myProjectPath).exists()) { if (Messages.showDialog(project, "The path " + FileUtil.toSystemDependentName(myProjectPath) + " does not exist.\n" + diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ShowFilePathAction.java b/platform/platform-impl/src/com/intellij/ide/actions/ShowFilePathAction.java index 3c367610feed..7f3622a9de54 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/ShowFilePathAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/ShowFilePathAction.java @@ -266,8 +266,8 @@ public class ShowFilePathAction extends AnAction { public static boolean isSupported() { return SystemInfo.isWindows || - Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN) || - SystemInfo.hasXdgOpen() || canUseNautilus.getValue(); + SystemInfo.hasXdgOpen() || canUseNautilus.getValue() || + Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN); } @NotNull @@ -285,9 +285,7 @@ public class ShowFilePathAction extends AnAction { if (!file.exists()) return; file = file.getAbsoluteFile(); File parent = file.getParentFile(); - if (parent == null) { - return; - } + if (parent == null) return; try { doOpen(parent, file); } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java index 7ac8a6a0b399..dcd57ed3410a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java @@ -134,10 +134,12 @@ public class RecentProjectPanel extends JPanel { myList.registerKeyboardAction(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - Object selection = myList.getSelectedValue(); - - if (selection != null) { - ((AnAction)selection).actionPerformed(AnActionEvent.createFromInputEvent((AnAction)selection, null, ActionPlaces.WELCOME_SCREEN)); + final Object[] selectedValued = myList.getSelectedValues(); + if (selectedValued != null) { + for (Object selection : selectedValued) { + AnActionEvent event = AnActionEvent.createFromInputEvent((AnAction)selection, null, ActionPlaces.WELCOME_SCREEN); + ((AnAction)selection).actionPerformed(event); + } } } }, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); diff --git a/platform/util/src/com/intellij/openapi/util/SystemInfo.java b/platform/util/src/com/intellij/openapi/util/SystemInfo.java index d349bd19dada..b12dba0b2b4e 100644 --- a/platform/util/src/com/intellij/openapi/util/SystemInfo.java +++ b/platform/util/src/com/intellij/openapi/util/SystemInfo.java @@ -113,22 +113,22 @@ public class SystemInfo extends SystemInfoRt { @NotNull @Override protected Boolean compute() { - return isUnix && new File("/usr/bin/xdg-open").canExecute(); + return new File("/usr/bin/xdg-open").canExecute(); } }; public static boolean hasXdgOpen() { - return ourHasXdgOpen.getValue(); + return isXWindow && ourHasXdgOpen.getValue(); } private static final NotNullLazyValue ourHasXdgMime = new AtomicNotNullLazyValue() { @NotNull @Override protected Boolean compute() { - return isUnix && new File("/usr/bin/xdg-mime").canExecute(); + return new File("/usr/bin/xdg-mime").canExecute(); } }; public static boolean hasXdgMime() { - return ourHasXdgOpen.getValue(); + return isXWindow && ourHasXdgMime.getValue(); } public static final boolean isMacOSTiger = isMac && isOsVersionAtLeast("10.4"); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/ShowChangeMarkerAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/ShowChangeMarkerAction.java index 262e40549cf8..ce64c1eea7b3 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/ShowChangeMarkerAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/ShowChangeMarkerAction.java @@ -97,7 +97,7 @@ public abstract class ShowChangeMarkerAction extends AbstractVcsAction { @Override protected void update(VcsContext context, Presentation presentation) { LineStatusTracker tracker = myChangeMarkerContext.getLineStatusTracker(context); - if (tracker == null || tracker.isSilentMode()) { + if (tracker == null || tracker.isReleased() || tracker.isSilentMode()) { presentation.setEnabledAndVisible(false); return; } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/BaseLineStatusRangeAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/BaseLineStatusRangeAction.java index d2c0b288cfef..91ca52999081 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/BaseLineStatusRangeAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/BaseLineStatusRangeAction.java @@ -35,7 +35,7 @@ public abstract class BaseLineStatusRangeAction extends AnAction implements Dumb } public void update(final AnActionEvent e) { - e.getPresentation().setEnabled(!myLineStatusTracker.isSilentMode() && isEnabled()); + e.getPresentation().setEnabled(!myLineStatusTracker.isSilentMode() && !myLineStatusTracker.isReleased() && isEnabled()); } public abstract boolean isEnabled(); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java index b2b82e89bf7e..56a1c59b5e86 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java @@ -231,6 +231,12 @@ public class LineStatusTracker { return highlighter; } + public boolean isReleased() { + synchronized (myLock) { + return myReleased; + } + } + public void release() { synchronized (myLock) { myReleased = true; @@ -832,7 +838,7 @@ public class LineStatusTracker { myApplication.assertWriteAccessAllowed(); synchronized (myLock) { - if (myBulkUpdate) return; + if (myReleased || myBulkUpdate || mySuppressUpdate || myAnathemaThrown) return; try { mySuppressUpdate = true; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java index 3d09cdc92696..b9a420b0cf4e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java @@ -215,6 +215,7 @@ public class LineStatusTrackerDrawing { @NotNull Editor editor, @NotNull LineStatusTracker tracker, @Nullable Point mousePosition) { + if (tracker.isReleased()) return; final Disposable disposable = Disposer.newDisposable(); List wordDiff = computeWordDiff(range, tracker); @@ -385,6 +386,7 @@ public class LineStatusTrackerDrawing { } public static void moveToRange(final Range range, final Editor editor, final LineStatusTracker tracker) { + if (tracker.isReleased()) return; final Document document = tracker.getDocument(); int line = Math.min(range.getType() == Range.DELETED ? range.getLine2() : range.getLine2() - 1, getLineCount(document) - 1); final int lastOffset = document.getLineStartOffset(line); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusAction.java index 9fb66d26e9a6..8b32ceea3d58 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/RollbackLineStatusAction.java @@ -45,7 +45,7 @@ public class RollbackLineStatusAction extends DumbAwareAction { return; } LineStatusTracker tracker = LineStatusTrackerManager.getInstance(project).getLineStatusTracker(editor.getDocument()); - if (tracker == null || tracker.isSilentMode()) { + if (tracker == null || tracker.isReleased() || tracker.isSilentMode()) { e.getPresentation().setEnabledAndVisible(false); return; } diff --git a/plugins/devkit/src/dom/impl/LanguageResolvingConverter.java b/plugins/devkit/src/dom/impl/LanguageResolvingConverter.java index da1fb7217f5f..7de64910d4b6 100644 --- a/plugins/devkit/src/dom/impl/LanguageResolvingConverter.java +++ b/plugins/devkit/src/dom/impl/LanguageResolvingConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -18,6 +18,7 @@ package org.jetbrains.idea.devkit.dom.impl; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupElementBuilder; import com.intellij.openapi.util.Condition; +import com.intellij.psi.PsiElement; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.xml.ConvertContext; import com.intellij.util.xml.ResolvingConverter; @@ -55,6 +56,12 @@ class LanguageResolvingConverter extends ResolvingConverter() { + @Override + public Boolean compute() { + PsiFile psiFile = PsiManager.getInstance(project).findFile(file); + if (psiFile instanceof PsiJavaFile) { + for (PsiClass aClass : ((PsiJavaFile)psiFile).getClasses()) { + if (aClass.hasModifierProperty(PsiModifier.PUBLIC)) { + PsiDocComment comment = aClass.getDocComment(); + return comment != null && comment.getText().contains("run build/scripts/icons.gant instead"); + } + } } + return false; } - } + }); } return false; } diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/events/AfterTestEvent.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/events/AfterTestEvent.java index 7fdc0eded8ab..3ba2a15e7518 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/events/AfterTestEvent.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/events/AfterTestEvent.java @@ -16,7 +16,10 @@ package org.jetbrains.plugins.gradle.execution.test.runner.events; import com.intellij.execution.testframework.sm.runner.SMTestProxy; +import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.Couple; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.util.ObjectUtils; import org.jetbrains.plugins.gradle.execution.test.runner.GradleTestsExecutionConsoleManager; import org.jetbrains.plugins.gradle.util.XmlXpathHelper; @@ -67,7 +70,17 @@ public class AfterTestEvent extends AbstractTestEvent { if ("comparison".equals(failureType)) { String actualText = eventXml.queryXml("/ijLog/event/test/result/actual"); String expectedText = eventXml.queryXml("/ijLog/event/test/result/expected"); - testProxy.setTestComparisonFailed(exceptionMsg, stackTrace, actualText, expectedText); + final Condition emptyString = new Condition() { + @Override + public boolean value(String s) { + return StringUtil.isEmpty(s); + } + }; + String filePath = ObjectUtils.nullizeByCondition( + eventXml.queryXml("/ijLog/event/test/result/filePath"), emptyString); + String actualFilePath = ObjectUtils.nullizeByCondition( + eventXml.queryXml("/ijLog/event/test/result/actualFilePath"), emptyString); + testProxy.setTestComparisonFailed(exceptionMsg, stackTrace, actualText, expectedText, filePath, actualFilePath); } else { Couple comparisonPair = diff --git a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/init/testFilterInit.gradle b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/init/testFilterInit.gradle index 031a8ebceecd..89611ade027d 100644 --- a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/init/testFilterInit.gradle +++ b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/init/testFilterInit.gradle @@ -53,6 +53,11 @@ gradle.taskGraph.beforeTask { Task task -> if (task instanceof Test) { try { + def urls = task.classpath.files.findAll{ + it.name.equals('idea_rt.jar') || it.name.startsWith('junit') + }.collect { it.toURI().toURL()} + Class.forName("org.gradle.launcher.daemon.bootstrap.DaemonMain").getClassLoader().addURLs(urls) + logTestReportLocation(task.reports?.html?.entryPoint?.path) task.beforeSuite { descriptor -> @@ -112,12 +117,33 @@ Object logTestEvent(def testEventType, TestDescriptorInternal testDescriptor, de failureType('comparison') xml.mkp.yieldUnescaped("$expected") xml.mkp.yieldUnescaped("$actual") - } else if('junit.framework.AssertionFailedError'.equals(testResult.exception?.class?.name) || + return + } + try { + if ('com.intellij.rt.execution.junit.FileComparisonFailure'.equals(testResult.exception?.class?.name)) { + def expected = escapeCdata(testResult.exception.expected) + def actual = escapeCdata(testResult.exception.actual) + def filePath = escapeCdata(testResult.exception.filePath) + def actualFilePath + if (testResult.exception.hasProperty('actualFilePath')) { + actualFilePath = escapeCdata(testResult.exception.actualFilePath) + } + failureType('comparison') + xml.mkp.yieldUnescaped("$expected") + xml.mkp.yieldUnescaped("$actual") + xml.mkp.yieldUnescaped("$filePath") + if (actualFilePath) xml.mkp.yieldUnescaped("$actualFilePath") + return + } + } + catch (ignore) { + } + if ('junit.framework.AssertionFailedError'.equals(testResult.exception?.class?.name) || testResult.exception instanceof AssertionError) { failureType('assertionFailed') - } else { - failureType('error') + return } + failureType('error') } } } diff --git a/python/gen/com/jetbrains/commandInterface/commandLine/psi/impl/CommandLineArgumentImpl.java b/python/gen/com/jetbrains/commandInterface/commandLine/psi/impl/CommandLineArgumentImpl.java index d8e8404ffcbc..5660f65030a4 100644 --- a/python/gen/com/jetbrains/commandInterface/commandLine/psi/impl/CommandLineArgumentImpl.java +++ b/python/gen/com/jetbrains/commandInterface/commandLine/psi/impl/CommandLineArgumentImpl.java @@ -1,18 +1,19 @@ // This is a generated file. Not intended for manual editing. package com.jetbrains.commandInterface.commandLine.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static com.jetbrains.commandInterface.commandLine.CommandLineElementTypes.*; -import com.jetbrains.commandInterface.commandLine.CommandLineElement; -import com.jetbrains.commandInterface.commandLine.psi.*; import com.jetbrains.commandInterface.command.Argument; import com.jetbrains.commandInterface.command.Help; import com.jetbrains.commandInterface.command.Option; +import com.jetbrains.commandInterface.commandLine.CommandLineElement; +import com.jetbrains.commandInterface.commandLine.psi.CommandLineArgument; +import com.jetbrains.commandInterface.commandLine.psi.CommandLineVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import static com.jetbrains.commandInterface.commandLine.CommandLineElementTypes.*; public class CommandLineArgumentImpl extends CommandLineElement implements CommandLineArgument { @@ -37,6 +38,12 @@ public class CommandLineArgumentImpl extends CommandLineElement implements Comma return findChildByType(LITERAL_STARTS_FROM_LETTER); } + @Override + @Nullable + public PsiElement getLiteralStartsFromSymbol() { + return findChildByType(LITERAL_STARTS_FROM_SYMBOL); + } + @Nullable public Option findOptionForOptionArgument() { return CommandLinePsiImplUtils.findOptionForOptionArgument(this); diff --git a/python/gen/com/jetbrains€commandInterface/commandLine/psi/impl/CommandLineArgumentImpl.java b/python/gen/com/jetbrains€commandInterface/commandLine/psi/impl/CommandLineArgumentImpl.java deleted file mode 100644 index 5660f65030a4..000000000000 --- a/python/gen/com/jetbrains€commandInterface/commandLine/psi/impl/CommandLineArgumentImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package com.jetbrains.commandInterface.commandLine.psi.impl; - -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.jetbrains.commandInterface.command.Argument; -import com.jetbrains.commandInterface.command.Help; -import com.jetbrains.commandInterface.command.Option; -import com.jetbrains.commandInterface.commandLine.CommandLineElement; -import com.jetbrains.commandInterface.commandLine.psi.CommandLineArgument; -import com.jetbrains.commandInterface.commandLine.psi.CommandLineVisitor; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import static com.jetbrains.commandInterface.commandLine.CommandLineElementTypes.*; - -public class CommandLineArgumentImpl extends CommandLineElement implements CommandLineArgument { - - public CommandLineArgumentImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof CommandLineVisitor) ((CommandLineVisitor)visitor).visitArgument(this); - else super.accept(visitor); - } - - @Override - @Nullable - public PsiElement getLiteralStartsFromDigit() { - return findChildByType(LITERAL_STARTS_FROM_DIGIT); - } - - @Override - @Nullable - public PsiElement getLiteralStartsFromLetter() { - return findChildByType(LITERAL_STARTS_FROM_LETTER); - } - - @Override - @Nullable - public PsiElement getLiteralStartsFromSymbol() { - return findChildByType(LITERAL_STARTS_FROM_SYMBOL); - } - - @Nullable - public Option findOptionForOptionArgument() { - return CommandLinePsiImplUtils.findOptionForOptionArgument(this); - } - - @Nullable - public Argument findRealArgument() { - return CommandLinePsiImplUtils.findRealArgument(this); - } - - @Nullable - public Help findBestHelp() { - return CommandLinePsiImplUtils.findBestHelp(this); - } - -}