From afd62613bd053d6d9a15e7ae339ffdfd4e5903b6 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Mon, 23 Jun 2014 12:30:27 +0200 Subject: [PATCH 1/8] Platform: OS X scrollbars: completion sorter position fixed when there are scrollbars --- .../codeInsight/lookup/impl/LookupUi.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupUi.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupUi.java index c1f2c6a89ab1..b1b0c8434ebb 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupUi.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupUi.java @@ -377,18 +377,18 @@ class LookupUi { myScrollBarIncreaseButton.setPreferredSize(buttonSize); myScrollBarIncreaseButton.setMinimumSize(buttonSize); myScrollBarIncreaseButton.setMaximumSize(buttonSize); - JScrollBar scrollBar = myScrollPane.getVerticalScrollBar(); - scrollBar.revalidate(); - scrollBar.repaint(); - + JScrollBar vScrollBar = myScrollPane.getVerticalScrollBar(); + vScrollBar.revalidate(); + vScrollBar.repaint(); + final Dimension iconSize = myProcessIcon.getPreferredSize(); - myIconPanel.setBounds(getWidth() - iconSize.width - (scrollBar.isVisible() ? scrollBar.getWidth() : 0), 0, iconSize.width, iconSize.height); + myIconPanel.setBounds(getWidth() - iconSize.width - (vScrollBar.isVisible() ? vScrollBar.getWidth() : 0), 0, iconSize.width, + iconSize.height); final Dimension sortSize = mySortingLabel.getPreferredSize(); - final Point sbLocation = SwingUtilities.convertPoint(scrollBar, 0, 0, myLayeredPane); - - final int sortHeight = Math.max(adHeight, mySortingLabel.getPreferredSize().height); - mySortingLabel.setBounds(sbLocation.x, getHeight() - sortHeight, sortSize.width, sortHeight); + final int sortWidth = vScrollBar.isVisible() ? vScrollBar.getWidth() : sortSize.width; + final int sortHeight = Math.max(sortSize.height, adHeight); + mySortingLabel.setBounds(getWidth() - sortWidth, getHeight() - sortHeight, sortSize.width, sortHeight); } void layoutHint() { From 5dc65e1f45a41b6cb6f27ce631d2c947313d5ee6 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Mon, 23 Jun 2014 13:05:11 +0200 Subject: [PATCH 2/8] Platform: friendly major.minor version in the tip of the day - do not show '3.0', show '3' instead --- .../platform-impl/src/com/intellij/ide/util/TipUIUtil.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/util/TipUIUtil.java b/platform/platform-impl/src/com/intellij/ide/util/TipUIUtil.java index f8c1029e0a97..bbd52139bd51 100644 --- a/platform/platform-impl/src/com/intellij/ide/util/TipUIUtil.java +++ b/platform/platform-impl/src/com/intellij/ide/util/TipUIUtil.java @@ -92,8 +92,11 @@ public class TipUIUtil { updateShortcuts(text); updateImages(text, tipLoader); String replaced = text.toString().replace("&productName;", ApplicationNamesInfo.getInstance().getFullProductName()); - replaced = replaced.replace("&majorVersion;", ApplicationInfo.getInstance().getMajorVersion()); - replaced = replaced.replace("&minorVersion;", ApplicationInfo.getInstance().getMinorVersion()); + String major = ApplicationInfo.getInstance().getMajorVersion(); + replaced = replaced.replace("&majorVersion;", major); + String minor = ApplicationInfo.getInstance().getMinorVersion(); + replaced = replaced.replace("&minorVersion;", minor); + replaced = replaced.replace("&majorMinorVersion;", major + ("0".equals(minor) ? "" : ("." + minor))); if (UIUtil.isUnderDarcula()) { replaced = replaced.replace("css/tips.css", "css/tips_darcula.css"); } From 5f38541f5fcdcdf2a55113a54d8fa461881a35d4 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 23 Jun 2014 13:54:28 +0200 Subject: [PATCH 3/8] DumbService queuing & cancellation logging --- .../src/com/intellij/openapi/project/DumbServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java index f3e7da762f91..188f42c23ce4 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java @@ -82,6 +82,7 @@ public class DumbServiceImpl extends DumbService implements Disposable { @Override public void cancelTask(@NotNull DumbModeTask task) { + if (ApplicationManager.getApplication().isInternal()) LOG.info("cancel " + task); ProgressIndicatorEx indicator = myProgresses.get(task); if (indicator != null) { indicator.cancel(); @@ -143,6 +144,7 @@ public class DumbServiceImpl extends DumbService implements Disposable { } private void scheduleCacheUpdate(@NotNull final DumbModeTask task, boolean forceDumbMode) { + if (ApplicationManager.getApplication().isInternal()) LOG.info("schedule " + task); final Application application = ApplicationManager.getApplication(); if (application.isUnitTestMode() || From 6b35988553c4aa046304633a0ee6b79a33455abf Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 23 Jun 2014 13:54:58 +0200 Subject: [PATCH 4/8] if there's an exception during completion, tests should not hang forever --- .../codeInsight/completion/CompletionProgressIndicator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java index b98fe4a6b985..36c13aad6040 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java @@ -759,8 +759,8 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement catch (ProcessCanceledException ignore) { } catch (Throwable t) { - LOG.error(t); cancel(); + LOG.error(t); } } } From e4da6a9113b898dc1be3256fbd2627fff1fc3b4f Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 23 Jun 2014 14:05:59 +0200 Subject: [PATCH 5/8] dumb tasks: log cancellation trace --- .../src/com/intellij/openapi/project/DumbServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java index 188f42c23ce4..db70a97929d7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java @@ -35,6 +35,7 @@ import com.intellij.openapi.wm.IdeFrame; import com.intellij.openapi.wm.WindowManager; import com.intellij.openapi.wm.ex.ProgressIndicatorEx; import com.intellij.openapi.wm.ex.StatusBarEx; +import com.intellij.psi.impl.DebugUtil; import com.intellij.ui.AppIcon; import com.intellij.util.concurrency.Semaphore; import com.intellij.util.containers.ContainerUtil; @@ -82,7 +83,7 @@ public class DumbServiceImpl extends DumbService implements Disposable { @Override public void cancelTask(@NotNull DumbModeTask task) { - if (ApplicationManager.getApplication().isInternal()) LOG.info("cancel " + task); + if (ApplicationManager.getApplication().isInternal()) LOG.info("cancel " + task + "\n" + DebugUtil.currentStackTrace()); ProgressIndicatorEx indicator = myProgresses.get(task); if (indicator != null) { indicator.cancel(); From f859f2b39ac848b6b85f7fad82368643d2b08ace Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Mon, 23 Jun 2014 12:29:15 +0400 Subject: [PATCH 6/8] enable smart backspace by default --- .../editor/EditorSmartKeysConfigurable.form | 1 + .../codeInsight/CodeInsightSettings.java | 2 +- .../IndentingBackspaceHandlerTest.java | 16 ---------------- resources-en/src/search/searchableOptions.xml | 3 +++ 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.form b/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.form index b69087962ab0..f9cb5da0f632 100644 --- a/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.form +++ b/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.form @@ -160,6 +160,7 @@ + diff --git a/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightSettings.java b/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightSettings.java index 1b7003239c3e..013b0808faca 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightSettings.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightSettings.java @@ -100,7 +100,7 @@ public class CodeInsightSettings implements PersistentStateComponent, C public boolean SHOW_FULL_SIGNATURES_IN_PARAMETER_INFO = false; - public boolean INDENTING_BACKSPACE = false; + public boolean INDENTING_BACKSPACE = true; public boolean SMART_INDENT_ON_ENTER = true; public boolean INSERT_BRACE_ON_ENTER = true; diff --git a/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerTest.java b/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerTest.java index 979d4fdee197..009338fa8f7d 100644 --- a/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerTest.java +++ b/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerTest.java @@ -15,7 +15,6 @@ */ package com.intellij.codeInsight.editorActions; -import com.intellij.codeInsight.CodeInsightSettings; import com.intellij.openapi.application.Result; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.testFramework.FileBasedTestCaseHelper; @@ -23,8 +22,6 @@ import com.intellij.testFramework.LightPlatformCodeInsightTestCase; import com.intellij.testFramework.TestDataPath; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.junit.After; -import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,19 +29,6 @@ import org.junit.runner.RunWith; @RunWith(com.intellij.testFramework.Parameterized.class) @TestDataPath("/testData/../../../platform/lang-impl/testData/editor/indentingBackspace/") public class IndentingBackspaceHandlerTest extends LightPlatformCodeInsightTestCase implements FileBasedTestCaseHelper { - private boolean mySavedConfigurationState; - - @Before - public void enableIndentingBackspace() { - mySavedConfigurationState = CodeInsightSettings.getInstance().INDENTING_BACKSPACE; - CodeInsightSettings.getInstance().INDENTING_BACKSPACE = true; - } - - @After - public void restoreSettings() { - CodeInsightSettings.getInstance().INDENTING_BACKSPACE = mySavedConfigurationState; - } - @Test public void testAction() { new WriteCommandAction(null) { diff --git a/resources-en/src/search/searchableOptions.xml b/resources-en/src/search/searchableOptions.xml index f0c1983a67c2..86e76b805242 100644 --- a/resources-en/src/search/searchableOptions.xml +++ b/resources-en/src/search/searchableOptions.xml @@ -22334,6 +22334,9 @@