diff --git a/.idea/libraries/Eclipse.xml b/.idea/libraries/Eclipse.xml index 5d0645c38f46..09b7e2c73bd4 100644 --- a/.idea/libraries/Eclipse.xml +++ b/.idea/libraries/Eclipse.xml @@ -1,11 +1,11 @@ - + - + \ No newline at end of file diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java index ae6252e4407f..be293f4b6c95 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java @@ -398,7 +398,7 @@ public class EvaluatorBuilderImpl implements EvaluatorBuilder { } private static boolean isBinaryNumericPromotionApplicable(PsiType lType, PsiType rType, IElementType opType) { - if (lType == null && rType == null) { + if (lType == null || rType == null) { return false; } if (opType == JavaTokenType.EQEQ || opType == JavaTokenType.NE) { diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/ThreadReferenceProxyImpl.java b/java/debugger/impl/src/com/intellij/debugger/jdi/ThreadReferenceProxyImpl.java index 93c87145dd1d..25d08bb63732 100644 --- a/java/debugger/impl/src/com/intellij/debugger/jdi/ThreadReferenceProxyImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/jdi/ThreadReferenceProxyImpl.java @@ -240,7 +240,11 @@ public final class ThreadReferenceProxyImpl extends ObjectReferenceProxyImpl imp return null; } checkFrames(threadReference); - return myFramesFromBottom.get(frameCount() - i - 1); + final int frameCount = frameCount(); + if (frameCount == 0) { + return null; + } + return myFramesFromBottom.get(frameCount - i - 1); } catch (ObjectCollectedException e) { return null; diff --git a/java/java-impl/src/com/intellij/psi/impl/compiled/ClsFileImpl.java b/java/java-impl/src/com/intellij/psi/impl/compiled/ClsFileImpl.java index 360d33225dd1..fd9ae54733c0 100644 --- a/java/java-impl/src/com/intellij/psi/impl/compiled/ClsFileImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/compiled/ClsFileImpl.java @@ -225,17 +225,14 @@ public class ClsFileImpl extends ClsRepositoryPsiElement } PsiClass[] classes = getClasses(); - if (classes.length == 1) { - if (!JavaPsiFacade.getInstance(getProject()).getNameHelper().isIdentifier(classes[0].getName())) { - return; // Can happen for package-info.class, or classes compiled from languages, that support different class naming scheme, like Scala. - } - } - - PsiClass[] mirrorClasses = ((PsiJavaFile)mirrorFile).getClasses(); - LOG.assertTrue(classes.length == mirrorClasses.length); - if (classes.length == mirrorClasses.length) { - for (int i = 0; i < classes.length; i++) { - ((ClsElementImpl)classes[i]).setMirror((TreeElement)SourceTreeToPsiMap.psiElementToTree(mirrorClasses[i])); + // Can happen for package-info.class, or classes compiled from languages, that support different class naming scheme, like Scala. + if (classes.length != 1 || JavaPsiFacade.getInstance(getProject()).getNameHelper().isIdentifier(classes[0].getName())) { + PsiClass[] mirrorClasses = ((PsiJavaFile)mirrorFile).getClasses(); + LOG.assertTrue(classes.length == mirrorClasses.length); + if (classes.length == mirrorClasses.length) { + for (int i = 0; i < classes.length; i++) { + ((ClsElementImpl)classes[i]).setMirror((TreeElement)SourceTreeToPsiMap.psiElementToTree(mirrorClasses[i])); + } } } } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FilePathReferenceProvider.java b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FilePathReferenceProvider.java index 24a264bc7b08..c01e91f944b5 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FilePathReferenceProvider.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FilePathReferenceProvider.java @@ -22,9 +22,7 @@ import com.intellij.openapi.roots.OrderRootType; import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.TextRange; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.psi.*; -import com.intellij.psi.PsiReferenceProvider; import com.intellij.util.ProcessingContext; import org.jetbrains.annotations.NotNull; @@ -112,14 +110,11 @@ public class FilePathReferenceProvider extends PsiReferenceProvider { List result = new ArrayList(); final PsiManager psiManager = PsiManager.getInstance(thisModule.getProject()); if (includingClasses) { - String[] libraryUrls = moduleRootManager.getUrls(OrderRootType.CLASSES); - for (String libraryUrl : libraryUrls) { - VirtualFile libFile = VirtualFileManager.getInstance().findFileByUrl(libraryUrl); - if (libFile != null) { - PsiDirectory directory = psiManager.findDirectory(libFile); - if (directory != null) { - result.add(directory); - } + VirtualFile[] libraryUrls = moduleRootManager.getFiles(OrderRootType.CLASSES); + for (VirtualFile file : libraryUrls) { + PsiDirectory directory = psiManager.findDirectory(file); + if (directory != null) { + result.add(directory); } } } diff --git a/lib/org.eclipse.jdt.core_3.4.4.v_894_R34x.jar b/lib/org.eclipse.jdt.core_3.4.4.v_894_R34x.jar deleted file mode 100644 index 1cd6ea2c2ba4..000000000000 Binary files a/lib/org.eclipse.jdt.core_3.4.4.v_894_R34x.jar and /dev/null differ diff --git a/lib/org.eclipse.jdt.core_3.5.2.v_981_R35x.jar b/lib/org.eclipse.jdt.core_3.5.2.v_981_R35x.jar new file mode 100644 index 000000000000..2a0df2b2c68e Binary files /dev/null and b/lib/org.eclipse.jdt.core_3.5.2.v_981_R35x.jar differ diff --git a/lib/required_for_dist.txt b/lib/required_for_dist.txt index 358ef44e8b4c..46f2f1505ef0 100644 --- a/lib/required_for_dist.txt +++ b/lib/required_for_dist.txt @@ -26,7 +26,7 @@ junit-4.6.jar log4j.jar microba.jar nanoxml-2.2.3.jar -org.eclipse.jdt.core_3.4.4.v_894_R34x.jar +org.eclipse.jdt.core_3.5.2.v_981_R35x.jar oromatcher.jar picocontainer.jar resolver.jar diff --git a/lib/src/org.eclipse.jdt.core.source_3.4.4.v_894_R34x.jar b/lib/src/org.eclipse.jdt.core.source_3.4.4.v_894_R34x.jar deleted file mode 100644 index 39669a4ee8a8..000000000000 Binary files a/lib/src/org.eclipse.jdt.core.source_3.4.4.v_894_R34x.jar and /dev/null differ diff --git a/lib/src/org.eclipse.jdt.core.source_3.5.2.v_981_R35x.jar b/lib/src/org.eclipse.jdt.core.source_3.5.2.v_981_R35x.jar new file mode 100644 index 000000000000..dc46492e7bd4 Binary files /dev/null and b/lib/src/org.eclipse.jdt.core.source_3.5.2.v_981_R35x.jar differ diff --git a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUpdate.java b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUpdate.java index a194063ab648..266cf04b32fd 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUpdate.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUpdate.java @@ -68,7 +68,7 @@ public class FoldingUpdate { return CachedValuesManager.getManager(project).getCachedValue(editor, CODE_FOLDING_KEY, new CachedValueProvider() { public Result compute() { - + PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); return getUpdateResult(file, document, quick, project, editor, applyDefaultState); } }, false); diff --git a/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java b/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java index b81b574e84ac..c299ce3522a3 100644 --- a/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java @@ -34,10 +34,7 @@ import com.intellij.openapi.editor.highlighter.HighlighterIterator; import com.intellij.openapi.editor.impl.DocumentImpl; import com.intellij.openapi.editor.impl.EditorFactoryImpl; import com.intellij.openapi.editor.impl.EditorImpl; -import com.intellij.openapi.editor.markup.HighlighterLayer; -import com.intellij.openapi.editor.markup.HighlighterTargetArea; -import com.intellij.openapi.editor.markup.MarkupModel; -import com.intellij.openapi.editor.markup.RangeHighlighter; +import com.intellij.openapi.editor.markup.*; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.OpenFileDescriptor; @@ -258,19 +255,18 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider { this.myTitle = title; } - public void addToHistory(final String text, final ConsoleViewContentType contentType) { - final boolean scrollToEnd = shouldScrollHistoryToEnd(); + public void addToHistory(final String text, final TextAttributes attributes) { final Document history = myHistoryViewer.getDocument(); final MarkupModel markupModel = history.getMarkupModel(myProject); final int offset = history.getTextLength(); history.insertString(offset, text); - if (!text.endsWith("\n")) history.insertString(history.getTextLength(), "\n"); - markupModel.addRangeHighlighter(offset, history.getTextLength(), HighlighterLayer.SYNTAX, contentType.getAttributes(), + markupModel.addRangeHighlighter(offset, + history.getTextLength(), + HighlighterLayer.SYNTAX, + attributes, HighlighterTargetArea.EXACT_RANGE); - queueUiUpdate(scrollToEnd); } - public String addCurrentToHistory(final TextRange textRange, final boolean erase) { final Ref ref = Ref.create(""); final boolean scrollToEnd = shouldScrollHistoryToEnd(); @@ -286,7 +282,7 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider { return ref.get(); } - private boolean shouldScrollHistoryToEnd() { + public boolean shouldScrollHistoryToEnd() { final Rectangle visibleArea = myHistoryViewer.getScrollingModel().getVisibleArea(); final int lineNum = (visibleArea.y + visibleArea.height + myHistoryViewer.getLineHeight()) / myHistoryViewer.getLineHeight(); final int lineCount = myHistoryViewer.getDocument().getLineCount(); @@ -344,7 +340,7 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider { return myPanel; } - private void queueUiUpdate(final boolean forceScrollToEnd) { + public void queueUiUpdate(final boolean forceScrollToEnd) { myForceScrollToEnd.compareAndSet(false, forceScrollToEnd); myUpdateQueue.queue(new Update("UpdateUi") { public void run() { diff --git a/platform/lang-impl/src/com/intellij/util/fileIndex/AbstractFileIndex.java b/platform/lang-impl/src/com/intellij/util/fileIndex/AbstractFileIndex.java index ab91bfbb14c4..c6d83e13535e 100644 --- a/platform/lang-impl/src/com/intellij/util/fileIndex/AbstractFileIndex.java +++ b/platform/lang-impl/src/com/intellij/util/fileIndex/AbstractFileIndex.java @@ -344,6 +344,10 @@ public abstract class AbstractFileIndex imple return AbstractFileIndex.this.queryNeededFiles(myIncludeChangedFiles, myFileTypesToRefresh); } + public int getNumberOfPendingUpdateJobs() { + return 0; + } + public void processFile(FileContent fileContent) { updateIndexEntry(fileContent.getVirtualFile()); } diff --git a/platform/lang-impl/src/com/intellij/util/fileIndex/FileIndexRefreshCacheUpdater.java b/platform/lang-impl/src/com/intellij/util/fileIndex/FileIndexRefreshCacheUpdater.java index e9c5350a9c80..a535a7b86742 100644 --- a/platform/lang-impl/src/com/intellij/util/fileIndex/FileIndexRefreshCacheUpdater.java +++ b/platform/lang-impl/src/com/intellij/util/fileIndex/FileIndexRefreshCacheUpdater.java @@ -66,6 +66,10 @@ public class FileIndexRefreshCacheUpdater extends VirtualFileAdapter implements } } + public int getNumberOfPendingUpdateJobs() { + return 0; + } + public VirtualFile[] queryNeededFiles() { return VfsUtil.toVirtualFileArray(myChangedFiles); } diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java index 6474a292f85a..61dbf0e63879 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java @@ -1190,6 +1190,10 @@ private boolean indexUnsavedDocument(final Document document, final ID req return pair != null? pair.getSecond() : null; } + public int getNumberOfPendingInvalidations() { + return myChangedFilesCollector.getNumberOfPendingInvalidations(); + } + public Collection getFilesToUpdate(final Project project) { final ProjectFileIndex projectIndex = ProjectRootManager.getInstance(project).getFileIndex(); return ContainerUtil.findAll(myChangedFilesCollector.getAllFilesToUpdate(), new Condition() { @@ -1533,6 +1537,16 @@ private boolean indexUnsavedDocument(final Document document, final ID req } } + public int getNumberOfPendingInvalidations() { + r.lock(); + try { + return myFutureInvalidations.size(); + } + finally { + r.unlock(); + } + } + public void ensureAllInvalidateTasksCompleted() { final int size; r.lock(); diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexProjectHandler.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexProjectHandler.java index ef34fb6b0ce6..4dcee4416e01 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexProjectHandler.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexProjectHandler.java @@ -97,6 +97,10 @@ public class FileBasedIndexProjectHandler extends AbstractProjectComponent imple } private class RefreshCacheUpdater implements CacheUpdater { + public int getNumberOfPendingUpdateJobs() { + return myIndex.getNumberOfPendingInvalidations(); + } + public VirtualFile[] queryNeededFiles() { Collection files = myIndex.getFilesToUpdate(myProject); return VfsUtil.toVirtualFileArray(files); diff --git a/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java b/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java index 27077909ab54..5bfa6425d65b 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/UnindexedFilesUpdater.java @@ -19,7 +19,7 @@ package com.intellij.util.indexing; import com.intellij.ide.caches.CacheUpdater; import com.intellij.ide.caches.FileContent; import com.intellij.openapi.project.Project; -import com.intellij.openapi.roots.*; +import com.intellij.openapi.roots.CollectingContentIterator; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; @@ -38,6 +38,10 @@ public class UnindexedFilesUpdater implements CacheUpdater { myProject = project; } + public int getNumberOfPendingUpdateJobs() { + return myIndex.getNumberOfPendingInvalidations(); + } + public VirtualFile[] queryNeededFiles() { CollectingContentIterator finder = myIndex.createContentIterator(); FileBasedIndex.iterateIndexableFiles(finder, myProject); diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/EventDispatcher.java b/platform/lvcs-impl/src/com/intellij/history/integration/EventDispatcher.java index 6e44cd76cf78..f0d596c800a6 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/EventDispatcher.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/EventDispatcher.java @@ -20,8 +20,8 @@ import com.intellij.history.core.LocalVcs; import com.intellij.history.core.Paths; import com.intellij.history.core.tree.Entry; import com.intellij.history.utils.LocalHistoryLog; -import com.intellij.ide.caches.FileContent; import com.intellij.ide.caches.CacheUpdater; +import com.intellij.ide.caches.FileContent; import com.intellij.openapi.command.CommandEvent; import com.intellij.openapi.command.CommandListener; import com.intellij.openapi.vfs.*; @@ -59,6 +59,10 @@ public class EventDispatcher extends VirtualFileAdapter implements VirtualFileMa return myRefreshDepth > 0; } + public int getNumberOfPendingUpdateJobs() { + return 0; + } + public VirtualFile[] queryNeededFiles() { return getOrInitProcessor().queryNeededFiles(); } diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryCacheUpdater.java b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryCacheUpdater.java index 41e15a368b47..63266d6e6bea 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryCacheUpdater.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryCacheUpdater.java @@ -26,7 +26,10 @@ import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.containers.ContainerUtil; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; public class LocalHistoryCacheUpdater implements CacheUpdater { private final LocalVcs myVcs; @@ -82,6 +85,10 @@ public class LocalHistoryCacheUpdater implements CacheUpdater { myProcessor.processFile(c); } + public int getNumberOfPendingUpdateJobs() { + return 0; + } + public void updatingDone() { myVcs.endChangeSet(myChangeSetName); myVfsRoots = null; diff --git a/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundle.java b/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundle.java index 7b9be9667ce2..ec2ea0b7fe58 100644 --- a/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundle.java +++ b/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundle.java @@ -35,10 +35,19 @@ public class FeatureStatisticsBundle { } public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); + return CommonBundle.message(getBundle(key), key, params); } - private static ResourceBundle getBundle() { + private static ResourceBundle getBundle(final String key) { + // bundles provided by plugins + for (FeatureStatisticsBundleProvider provider : FeatureStatisticsBundleProvider.EP_NAME.getExtensions()) { + final ResourceBundle bundle = provider.getBundleFor(key); + if (bundle != null) { + return bundle; + } + } + + // default bundle ResourceBundle bundle = null; if (ourBundle != null) bundle = ourBundle.get(); if (bundle == null) { diff --git a/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundleProvider.java b/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundleProvider.java new file mode 100644 index 000000000000..a8e53b1e6fe7 --- /dev/null +++ b/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundleProvider.java @@ -0,0 +1,31 @@ +/* + * Copyright 2000-2010 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.featureStatistics; + +import com.intellij.openapi.extensions.ExtensionPointName; +import org.jetbrains.annotations.Nullable; + +import java.util.ResourceBundle; + +/** + * @author Roman.Chernyatchik + */ +public interface FeatureStatisticsBundleProvider { + ExtensionPointName EP_NAME = new ExtensionPointName("com.intellij.featureStatBundle"); + + @Nullable + ResourceBundle getBundleFor(String key); +} diff --git a/platform/platform-api/src/com/intellij/ide/caches/CacheUpdater.java b/platform/platform-api/src/com/intellij/ide/caches/CacheUpdater.java index 8fd1aae440f5..68cece670ad2 100644 --- a/platform/platform-api/src/com/intellij/ide/caches/CacheUpdater.java +++ b/platform/platform-api/src/com/intellij/ide/caches/CacheUpdater.java @@ -19,8 +19,13 @@ package com.intellij.ide.caches; import com.intellij.openapi.vfs.VirtualFile; public interface CacheUpdater { + int getNumberOfPendingUpdateJobs(); + VirtualFile[] queryNeededFiles(); + void processFile(FileContent fileContent); + void updatingDone(); + void canceled(); } diff --git a/platform/platform-impl/src/com/intellij/internal/ToggleDumbModeAction.java b/platform/platform-impl/src/com/intellij/internal/ToggleDumbModeAction.java index 7ab71dad9980..51c59a3eb1cc 100644 --- a/platform/platform-impl/src/com/intellij/internal/ToggleDumbModeAction.java +++ b/platform/platform-impl/src/com/intellij/internal/ToggleDumbModeAction.java @@ -44,6 +44,10 @@ public class ToggleDumbModeAction extends AnAction implements DumbAware { if (project == null) return; CacheUpdater updater = new CacheUpdater() { + public int getNumberOfPendingUpdateJobs() { + return 0; + } + public VirtualFile[] queryNeededFiles() { while (myDumb) { try { diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java index c68bc2655ecc..097b2800a0d4 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java @@ -107,6 +107,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat @NonNls public static final String RELATIVE_TO_ACTION_ATTR_NAME = "relative-to-action"; @NonNls public static final String FIRST_KEYSTROKE_ATTR_NAME = "first-keystroke"; @NonNls public static final String SECOND_KEYSTROKE_ATTR_NAME = "second-keystroke"; + @NonNls public static final String REMOVE_SHORTCUT_ATTR_NAME = "remove"; @NonNls public static final String KEYMAP_ATTR_NAME = "keymap"; @NonNls public static final String KEYSTROKE_ATTR_NAME = "keystroke"; @NonNls public static final String REF_ATTR_NAME = "ref"; @@ -739,8 +740,13 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat reportActionError(pluginId, "keymap \"" + keymapName + "\" not found"); return; } - - keymap.addShortcut(actionId, new KeyboardShortcut(firstKeyStroke, secondKeyStroke)); + final String removeOption = element.getAttributeValue(REMOVE_SHORTCUT_ATTR_NAME); + final KeyboardShortcut shortcut = new KeyboardShortcut(firstKeyStroke, secondKeyStroke); + if (Boolean.valueOf(removeOption)) { + keymap.removeShortcut(actionId, shortcut); + } else { + keymap.addShortcut(actionId, shortcut); + } } private static void processMouseShortcutNode(Element element, String actionId, PluginId pluginId) { @@ -769,7 +775,12 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat return; } - keymap.addShortcut(actionId, shortcut); + final String removeOption = element.getAttributeValue(REMOVE_SHORTCUT_ATTR_NAME); + if (Boolean.valueOf(removeOption)) { + keymap.removeShortcut(actionId, shortcut); + } else { + keymap.addShortcut(actionId, shortcut); + } } @Nullable diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 9e534f14beec..3a8cdaeda71a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -2300,7 +2300,9 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi CharSequence chars = myDocument.getCharsNoThreadCheck(); int nonWhitespaceOffset = CharArrayUtil.shiftForward(chars, lineStart, " \t"); if (nonWhitespaceOffset < lineEnd) { - return calcColumnNumber(nonWhitespaceOffset, line) / getIndentSize(); + final int columnNumber = calcColumnNumber(nonWhitespaceOffset, line); + final int indentSize = getIndentSize(); + return indentSize != 0 ? columnNumber / indentSize : columnNumber; } else { int upIndent = goUp ? getIndents(line - 1, true, false) : 100; diff --git a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java index cf9747ebd39f..9c388e9bbe0e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java @@ -49,6 +49,13 @@ class CacheUpdateRunner { return mySession.getFilesToUpdate().size(); } + public int getNumberOfPendingUpdateJobs(ProgressIndicator indicator) { + if (mySession == null) { + mySession = new CacheUpdateSession(myUpdaters, indicator); + } + return mySession.getNumberOfPendingUpdateJobs(); + } + public void processFiles(final ProgressIndicator indicator, boolean processInReadAction) { try { indicator.checkCanceled(); diff --git a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateSession.java b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateSession.java index 7c48de132107..565cc27e79e0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateSession.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateSession.java @@ -31,6 +31,7 @@ public class CacheUpdateSession { private static final Logger LOG = Logger.getInstance("#" + CacheUpdateSession.class.getName()); private static final Key FAILED_TO_INDEX = Key.create(CacheUpdateSession.class.getSimpleName() + ".FAILED_TO_INDEX"); private final Collection myFilesToUpdate; + private final int myJobsToDo; private final List>> myUpdatersWithFiles = new ArrayList>>(); @@ -39,9 +40,11 @@ public class CacheUpdateSession { myFilesToUpdate = new LinkedHashSet(); try { + int jobsCount = 0; for (CacheUpdater each : updaters) { indicator.checkCanceled(); try { + jobsCount += each.getNumberOfPendingUpdateJobs(); List updaterFiles = Arrays.asList(each.queryNeededFiles()); processedUpdaters.add(each); myFilesToUpdate.addAll(updaterFiles); @@ -54,6 +57,7 @@ public class CacheUpdateSession { LOG.error(e); } } + myJobsToDo = jobsCount; } catch (ProcessCanceledException e) { for (CacheUpdater each : processedUpdaters) { @@ -63,6 +67,10 @@ public class CacheUpdateSession { } } + public int getNumberOfPendingUpdateJobs() { + return myJobsToDo; + } + public Collection getFilesToUpdate() { return myFilesToUpdate; } 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 b2b1c86543bc..1d6fb06e5439 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java @@ -111,8 +111,9 @@ public class DumbServiceImpl extends DumbService { } try { final int size = runner.queryNeededFiles(indicator); - if (size < 50) { - // if not that many files found, process them on the spot, avoiding entering dumb mode + if ((size + runner.getNumberOfPendingUpdateJobs(indicator)) < 50) { + // If not that many files found, process them on the spot, avoiding entering dumb mode + // Consider number of pending tasks as well, becase they may take noticeable time to process even if the number of files is small if (size > 0) { runner.processFiles(indicator, false); } diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index 760d9d8a0a3a..e45a14fc682f 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -304,11 +304,15 @@ error.saving.license.data=Error saving license data.\n{0} title.unable.to.save.data=Unable to Save Data link.click.here.to.license.server.info=More info link.purchase.commercial.license=To purchase a commercial license, please visit +license.panel.current.license.description=The license will expire on {0,date,MMMM dd, yyyy} +license.panel.autodescovered.license.server.tile=Default license server +license.panel.buildit.evaluation.expires.in=Remains {0} day(s) editbox.license.user.name=User name: editbox.license.license.key=License key: radio.license.server.address=Enter license &server address radio.license.data=Enter license &data radio.evaluate=&Evaluate for free for 30 days +radio.default.license.server=&Default License Server action.activate.tool.window=Activate {0} window action.change.splitter.orientations=Change Splitter O_rientations error.checkforupdates.connection.failed=Connection failed. Please check your network connection and try again. diff --git a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml index 13eb178f6310..164d627090bb 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml @@ -104,4 +104,5 @@ + diff --git a/platform/platform-resources/src/idea/Keymap_Default.xml b/platform/platform-resources/src/idea/Keymap_Default.xml index 3451eaea818c..da2b2722d684 100644 --- a/platform/platform-resources/src/idea/Keymap_Default.xml +++ b/platform/platform-resources/src/idea/Keymap_Default.xml @@ -941,5 +941,7 @@ + + diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointManager.java b/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointManager.java index 116e6bf01ce3..75b8e47bf94b 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointManager.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointManager.java @@ -21,6 +21,7 @@ import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import javax.swing.*; import java.util.Collection; /** @@ -62,4 +63,6 @@ public interface XBreakpointManager { void addBreakpointListener(@NotNull XBreakpointListener> listener); void removeBreakpointListener(@NotNull XBreakpointListener> listener); void addBreakpointListener(@NotNull XBreakpointListener> listener, @NotNull Disposable parentDisposable); + + void updateBreakpointPresentation(@NotNull XLineBreakpoint breakpoint, @Nullable Icon icon, @Nullable String errorMessage); } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointManagerImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointManagerImpl.java index c1c257f9307d..ccae800efd12 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointManagerImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointManagerImpl.java @@ -34,6 +34,7 @@ import com.intellij.xdebugger.impl.XDebuggerManagerImpl; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import javax.swing.*; import java.util.*; /** @@ -230,6 +231,14 @@ public class XBreakpointManagerImpl implements XBreakpointManager, PersistentSta myAllBreakpointsDispatcher.addListener(listener, parentDisposable); } + public void updateBreakpointPresentation(@NotNull XLineBreakpoint breakpoint, @Nullable Icon icon, @Nullable String errorMessage) { + final CustomizedBreakpointPresentation presentation = new CustomizedBreakpointPresentation(); + presentation.setErrorMessage(errorMessage); + presentation.setIcon(icon); + ((XLineBreakpointImpl)breakpoint).setCustomizedPresentation(presentation); + myLineBreakpointManager.queueBreakpointUpdate(breakpoint); + } + public BreakpointManagerState getState() { myDependentBreakpointManager.saveState(); BreakpointManagerState state = new BreakpointManagerState(); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java index c22575755bfc..72460c7fff04 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java @@ -58,6 +58,7 @@ public class XLineBreakpointImpl

extends XBreak private XSourcePosition mySourcePosition; @NonNls private static final String BR_NBSP = "
 "; private boolean myDisposed; + private CustomizedBreakpointPresentation myCustomizedPresentation; public XLineBreakpointImpl(final XLineBreakpointType

type, XBreakpointManagerImpl breakpointManager, String url, int line, final @Nullable P properties) { super(type, breakpointManager, properties, new LineBreakpointState

(true, type.getId(), url, line)); @@ -141,15 +142,15 @@ public class XLineBreakpointImpl

extends XBreak } } } + if (myCustomizedPresentation != null) { + final Icon icon = myCustomizedPresentation.getIcon(); + if (icon != null) { + return icon; + } + } return myType.getEnabledIcon(); } - @Nullable - private CustomizedBreakpointPresentation getCustomizedPresentation() { - final XDebugSessionImpl currentSession = getBreakpointManager().getDebuggerManager().getCurrentSession(); - return currentSession != null ? currentSession.getBreakpointPresentation(this) : null; - } - public int getLine() { return myState.getLine(); } @@ -270,8 +271,15 @@ public class XLineBreakpointImpl

extends XBreak @Nullable private String getErrorMessage() { - CustomizedBreakpointPresentation presentation = getCustomizedPresentation(); - return presentation != null ? presentation.getErrorMessage() : null; + final XDebugSessionImpl currentSession = getBreakpointManager().getDebuggerManager().getCurrentSession(); + if (currentSession != null) { + CustomizedBreakpointPresentation presentation = currentSession.getBreakpointPresentation(this); + if (presentation != null) { + final String message = presentation.getErrorMessage(); + if (message != null) return message; + } + } + return myCustomizedPresentation != null ? myCustomizedPresentation.getErrorMessage() : null; } public void updatePosition() { @@ -289,6 +297,10 @@ public class XLineBreakpointImpl

extends XBreak } } + public void setCustomizedPresentation(CustomizedBreakpointPresentation presentation) { + myCustomizedPresentation = presentation; + } + @Tag("line-breakpoint") public static class LineBreakpointState

extends XBreakpointBase.BreakpointState, P, XLineBreakpointType

> { private String myFileUrl; diff --git a/plugins/devkit/src/dom/KeyboardShortcut.java b/plugins/devkit/src/dom/KeyboardShortcut.java index 4034a113ce07..71829d0b011a 100644 --- a/plugins/devkit/src/dom/KeyboardShortcut.java +++ b/plugins/devkit/src/dom/KeyboardShortcut.java @@ -67,4 +67,13 @@ public interface KeyboardShortcut extends DomElement { GenericAttributeValue getSecondKeystroke(); + /** + * Returns the value of the remove child. + * Attribute remove option + * @return the value of the remove child. + */ + @NotNull + GenericAttributeValue getRemove(); + + } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java index fd9960457e28..8a211acfc8ee 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java @@ -68,6 +68,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.*; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrMethodCallExpression; import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.*; +import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrAccessorMethod; import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMember; import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod; import org.jetbrains.plugins.groovy.lang.psi.api.toplevel.imports.GrImportStatement; @@ -1124,7 +1125,7 @@ public class GroovyAnnotator extends GroovyElementVisitor implements Annotator { boolean isStatic = member.hasModifierProperty(GrModifier.STATIC); Annotation annotation = holder.createInfoAnnotation(refExpr.getReferenceNameElement(), null); - if (member instanceof PsiField ) { + if (member instanceof PsiField || member instanceof GrAccessorMethod) { annotation.setTextAttributes(isStatic ? DefaultHighlighter.STATIC_FIELD : DefaultHighlighter.INSTANCE_FIELD); return; }