From 21c363c621b03045d49642e72aa008eff4649bd4 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Thu, 29 Mar 2012 15:09:09 +0400 Subject: [PATCH 01/27] showing Inspection Results toolwindow restored --- .../codeInspection/ex/GlobalInspectionContextImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java index d6febddfd9e2..1f6f52be9fb4 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -206,6 +206,10 @@ public class GlobalInspectionContextImpl extends UserDataHolderBase implements G myContent.setDisposer(myView); + ContentManager contentManager = getContentManager(); + contentManager.addContent(myContent); + contentManager.setSelectedContent(myContent); + ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.INSPECTION).activate(null); } From db15b10b5b24339c081ae1e2264c1798f31755cc Mon Sep 17 00:00:00 2001 From: Alexander Lobas Date: Thu, 29 Mar 2012 15:15:26 +0400 Subject: [PATCH 02/27] FrameLayout --- .../android/designer/icons/FrameLayout.png | Bin 0 -> 1068 bytes .../designer/model/PropertyParser.java | 109 +++++++++++++++++- .../designer/model/RadFrameLayout.java | 56 +++++++++ .../designer/model/RadLinearLayout.java | 9 +- .../designer/model/RadViewGroupComponent.java | 36 ++++++ .../designer/model/RadViewLayoutWithData.java | 23 ++++ .../designer/model/views-meta-model.xml | 23 +++- 7 files changed, 249 insertions(+), 7 deletions(-) create mode 100644 plugins/android-designer/src/com/intellij/android/designer/icons/FrameLayout.png create mode 100644 plugins/android-designer/src/com/intellij/android/designer/model/RadFrameLayout.java create mode 100644 plugins/android-designer/src/com/intellij/android/designer/model/RadViewGroupComponent.java create mode 100644 plugins/android-designer/src/com/intellij/android/designer/model/RadViewLayoutWithData.java diff --git a/plugins/android-designer/src/com/intellij/android/designer/icons/FrameLayout.png b/plugins/android-designer/src/com/intellij/android/designer/icons/FrameLayout.png new file mode 100644 index 0000000000000000000000000000000000000000..66bd0421cb0c2c4bb0cddfaa78506607936693e7 GIT binary patch literal 1068 zcmbVLJ8aWH7&VxrZ{mzBQ>E)gQz;yv9FCu>~rlaamvJ_ z15`+KFYp&ulHtp8hE}rJN<29$UNEeH9 zszqGEj4?vw`i#wS(=(B8T6Ii86|Xv;#{YQpmIscl@mHlHEc#hob7nUJys%NKSQ~Xq zvH6(`U^-HnfQzXKBDdj%YNYWUU6t+QYmo;X2(4@UzEg|Ed5|Rm29f|17EB|MP6;Rl zm6S3Lk`O@=B}FJF5L6{ug$Q&Xo>>d*6}4>SySCU#<7<@qswg&_O`$mR5G$HhvQ9OgdAc8h>lcd$!d}=-6ib;HnZAew zD7tPOR|g%^GXCSnq3E#E^08RPAz2SBR*#jj9+~CtXhSiOd81wq999&wVGwKG#U3pf z8qfX+wqvstO+tj^6qJ)NJ&BN#n$Y#Up=1rHD>_W~G!Ek;DV52j4P8=X8KE4Sl#-bY zlAxp*`MhrAdfb8+Qq!|=&#uGlcDc%tTs0eDlaio9NTb&Q^EECPUk?R>bo1K7ZSvO>)8#>?R+W(U^kvSvA?eSN; z^sZPB#@mDDXNQCF!5*8LfDOmeuWCG)O9ex(L|>}k_V$*+z-w-;)l#-!PEAccJUiPz zKJxw3vzZg8&cA!{acAe|=H|fjzIN5@yH~w(zj0=_H2V2srmcVVK0Vdi*SPnOwzf`w gc+x+2yIto7Avbp8v=`lZ{4<{4Lat=I$}Hdd4enG properties = loadLayoutProperties(layoutParams, 0); + + if (!properties.isEmpty()) { + properties = new ArrayList(properties); + properties.addAll(component.getProperties()); + component.setProperties(properties); + } + } + } } - private List load(Class componentClass, MetaModel model) throws Exception { + private List loadWidgetProperties(Class componentClass, MetaModel model) throws Exception { String component = componentClass.getSimpleName(); List properties = myCachedProperties.get(component); if (properties == null) { properties = new ArrayList(); + myCachedProperties.put(component, properties); StyleableDefinition definitions = myDefinitions.getStyleableByName(component); if (definitions != null) { @@ -153,7 +180,8 @@ public class PropertyParser { superComponentClass = myClassLoader.loadClass("android.view.View"); } - List superProperties = load(superComponentClass, myMetaManager.getModelByTarget(superComponentClass.getName())); + List superProperties = loadWidgetProperties(superComponentClass, + myMetaManager.getModelByTarget(superComponentClass.getName())); for (Property superProperty : superProperties) { if (PropertyTable.findProperty(properties, superProperty) == -1) { if (model == null) { @@ -192,8 +220,79 @@ public class PropertyParser { } }); } + } + return properties; + } + + private List loadLayoutProperties(String[] components, int index) throws Exception { + String component = components[index]; + + List properties = myCachedProperties.get(component); + + if (properties == null) { + properties = new ArrayList(); myCachedProperties.put(component, properties); + + StyleableDefinition definitions = myDefinitions.getStyleableByName(component); + if (definitions != null) { + Property margin = null; + + for (AttributeDefinition definition : definitions.getAttributes()) { + String name = definition.getName(); + boolean important = true; + Set formats = definition.getFormats(); + Property property; + + if (name.startsWith(LAYOUT_MARGIN_PREFIX) && name.length() > LAYOUT_MARGIN_PREFIX.length()) { + name = name.substring(LAYOUT_PREFIX.length()); + important = false; + } + else if (name.startsWith(LAYOUT_PREFIX)) { + name = "layout:" + name.substring(LAYOUT_PREFIX.length()); + } + + if ("layout:margin".equals(name) && "ViewGroup_MarginLayout".equals(component)) { + property = margin = new CompoundProperty(name, definition); + } + else if (formats.contains(AttributeFormat.Flag)) { + property = new FlagProperty(name, definition); + } + else { + property = new AttributeProperty(name, definition); + } + + property.setImportant(important); + properties.add(property); + } + + if (margin != null) { + List children = margin.getChildren(null); + children.add(PropertyTable.extractProperty(properties, "marginLeft")); + children.add(PropertyTable.extractProperty(properties, "marginTop")); + children.add(PropertyTable.extractProperty(properties, "marginRight")); + children.add(PropertyTable.extractProperty(properties, "marginBottom")); + children.add(PropertyTable.extractProperty(properties, "marginStart")); + children.add(PropertyTable.extractProperty(properties, "marginEnd")); + } + } + + if (++index < components.length) { + for (Property property : loadLayoutProperties(components, index)) { + if (PropertyTable.findProperty(properties, property) == -1) { + properties.add(property); + } + } + } + + if (!properties.isEmpty()) { + Collections.sort(properties, new Comparator() { + @Override + public int compare(Property p1, Property p2) { + return p1.getName().compareTo(p2.getName()); + } + }); + } } return properties; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/RadFrameLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/RadFrameLayout.java new file mode 100644 index 000000000000..1f97e251d2b7 --- /dev/null +++ b/plugins/android-designer/src/com/intellij/android/designer/model/RadFrameLayout.java @@ -0,0 +1,56 @@ +/* + * Copyright 2000-2012 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.android.designer.model; + +import com.intellij.designer.designSurface.ComponentDecorator; +import com.intellij.designer.designSurface.DesignerEditorPanel; +import com.intellij.designer.designSurface.EditOperation; +import com.intellij.designer.designSurface.OperationContext; +import com.intellij.designer.model.RadComponent; +import com.intellij.openapi.actionSystem.DefaultActionGroup; + +import javax.swing.*; +import java.util.List; + +/** + * @author Alexander Lobas + */ +public class RadFrameLayout extends RadViewLayoutWithData { + private static final String[] LAYOUT_PARAMS = {"FrameLayout_Layout", "ViewGroup_MarginLayout"}; + + @Override + public String[] getLayoutParams() { + return LAYOUT_PARAMS; + } + + @Override + public ComponentDecorator getChildSelectionDecorator(RadComponent component, List selection) { + return super.getChildSelectionDecorator(component, selection); // TODO: Auto-generated method stub + } + + @Override + public EditOperation processChildOperation(OperationContext context) { + return super.processChildOperation(context); // TODO: Auto-generated method stub + } + + @Override + public void addSelectionActions(DesignerEditorPanel designer, + DefaultActionGroup actionGroup, + JComponent shortcuts, + List selection) { + super.addSelectionActions(designer, actionGroup, shortcuts, selection); // TODO: Auto-generated method stub + } +} \ No newline at end of file diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/RadLinearLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/RadLinearLayout.java index e6cbf4533c44..19e04a31053a 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/RadLinearLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/RadLinearLayout.java @@ -30,7 +30,14 @@ import java.util.List; /** * @author Alexander Lobas */ -public class RadLinearLayout extends RadViewLayout { +public class RadLinearLayout extends RadViewLayoutWithData { + private static final String[] LAYOUT_PARAMS = {"LinearLayout_Layout", "ViewGroup_MarginLayout"}; + + @Override + public String[] getLayoutParams() { + return LAYOUT_PARAMS; + } + @Override public EditOperation processChildOperation(OperationContext context) { if (context.isCreate()) { diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/RadViewGroupComponent.java b/plugins/android-designer/src/com/intellij/android/designer/model/RadViewGroupComponent.java new file mode 100644 index 000000000000..af4d30984129 --- /dev/null +++ b/plugins/android-designer/src/com/intellij/android/designer/model/RadViewGroupComponent.java @@ -0,0 +1,36 @@ +/* + * Copyright 2000-2012 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.android.designer.model; + +import com.intellij.designer.designSurface.DesignerEditorPanel; +import com.intellij.designer.model.RadComponent; +import com.intellij.openapi.actionSystem.DefaultActionGroup; + +import javax.swing.*; +import java.util.List; + +/** + * @author Alexander Lobas + */ +public class RadViewGroupComponent extends RadViewComponent { + @Override + public void addSelectionActions(DesignerEditorPanel designer, + DefaultActionGroup actionGroup, + JComponent shortcuts, + List selection) { + super.addSelectionActions(designer, actionGroup, shortcuts, selection); // TODO: Auto-generated method stub + } +} \ No newline at end of file diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/RadViewLayoutWithData.java b/plugins/android-designer/src/com/intellij/android/designer/model/RadViewLayoutWithData.java new file mode 100644 index 000000000000..ca1af9c2692d --- /dev/null +++ b/plugins/android-designer/src/com/intellij/android/designer/model/RadViewLayoutWithData.java @@ -0,0 +1,23 @@ +/* + * Copyright 2000-2012 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.android.designer.model; + +/** + * @author Alexander Lobas + */ +public abstract class RadViewLayoutWithData extends RadViewLayout { + public abstract String[] getLayoutParams(); +} \ No newline at end of file diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml b/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml index 0d9f8e077767..a91e9ba6d1cd 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml +++ b/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml @@ -983,7 +983,7 @@ - @@ -1004,6 +1004,26 @@ + + + + + + + + + + ]]> + + + @@ -1061,6 +1081,7 @@ + From 4a3e957120eea961d81ddbe3d783e3cdc89a6384 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 29 Mar 2012 12:31:11 +0200 Subject: [PATCH 03/27] a test for no folding when editing groovy imports --- .../groovy/lang/GroovyFoldingTest.groovy | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyFoldingTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyFoldingTest.groovy index 04ee1eab49e1..7df5c8c1830e 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyFoldingTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyFoldingTest.groovy @@ -47,6 +47,25 @@ class GroovyFoldingTest extends LightCodeInsightFixtureTestCase { assert assertNoFolding(myFixture.file.text.indexOf(marker)), marker } + public void testEditingImports() { + configure """ +import java.util.List +import java.util.Map + + +println 'hello' + +class Foo { List a; Map b; } +""" + + assert myFixture.editor.foldingModel.getCollapsedRegionAtOffset(10) + + myFixture.type 'import ' + myFixture.doHighlighting() + assert !myFixture.editor.foldingModel.getCollapsedRegionAtOffset(10) + } + + void testOpenBlock() { configure '''def foo() {print 'a'} def bar() { From 8c2dc396709dff11a39a5abe79f76692646828b0 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 29 Mar 2012 13:10:42 +0200 Subject: [PATCH 04/27] don't expand single-line closure foldings when editing inside them --- .../folding/impl/JavaFoldingBuilder.java | 20 ++++++++++++-- .../folding/JavaFoldingTest.groovy | 26 +++++++++++++++++++ .../moveUpDown/MoverWrapper.java | 1 - .../folding/CodeFoldingManager.java | 10 ------- .../folding/impl/CodeFoldingManagerImpl.java | 5 ---- .../impl/UpdateFoldRegionsOperation.java | 25 +----------------- .../lang/folding/GroovyFoldingBuilder.java | 3 ++- 7 files changed, 47 insertions(+), 43 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilder.java b/java/java-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilder.java index 34305ef9bc58..6c1f9220644d 100644 --- a/java/java-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilder.java +++ b/java/java-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilder.java @@ -15,6 +15,7 @@ */ package com.intellij.codeInsight.folding.impl; +import com.intellij.codeInsight.daemon.impl.CollectHighlightsUtil; import com.intellij.codeInsight.folding.JavaCodeFoldingSettings; import com.intellij.codeInsight.generation.OverrideImplementUtil; import com.intellij.lang.ASTNode; @@ -47,7 +48,10 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.*; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; public class JavaFoldingBuilder extends CustomFoldingBuilder implements DumbAware { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.folding.impl.JavaFoldingBuilder"); @@ -312,7 +316,9 @@ public class JavaFoldingBuilder extends CustomFoldingBuilder implements DumbAwar if (importKeyword == null) return null; int startOffset = importKeyword.getTextRange().getEndOffset() + 1; int endOffset = statements[statements.length - 1].getTextRange().getEndOffset(); - return new TextRange(startOffset, endOffset); + if (!hasErrorElementsNearby(element.getContainingFile(), startOffset, endOffset)) { + return new TextRange(startOffset, endOffset); + } } if (element instanceof PsiDocComment) { return element.getTextRange(); @@ -330,6 +336,16 @@ public class JavaFoldingBuilder extends CustomFoldingBuilder implements DumbAwar return null; } + public static boolean hasErrorElementsNearby(final PsiFile file, int startOffset, int endOffset) { + endOffset = CharArrayUtil.shiftForward(file.getText(), endOffset, " \t\n"); + for (PsiElement element : CollectHighlightsUtil.getElementsInRange(file, startOffset, endOffset)) { + if (element instanceof PsiErrorElement) { + return true; + } + } + return false; + } + @Nullable private static TextRange getFileHeader(PsiJavaFile file) { PsiElement first = file.getFirstChild(); diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/folding/JavaFoldingTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/folding/JavaFoldingTest.groovy index 3b48d5e41fd3..5d13114d3e7f 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/folding/JavaFoldingTest.groovy +++ b/java/java-tests/testSrc/com/intellij/codeInsight/folding/JavaFoldingTest.groovy @@ -167,6 +167,32 @@ class Test { assertEquals(2, closureFolds.size()) } + public void "test closure folding doesn't expand when editing inside"() { + def text = """\ +class Test { + void test() { + new Runnable() { + public void run() { + System.out.println(); + } + }; + } +} +""" + + configure text + def foldingModel = myFixture.editor.foldingModel as FoldingModelImpl + def closureStartFold = foldingModel.getCollapsedRegionAtOffset(text.indexOf("Runnable")) + assertNotNull closureStartFold + assertFalse closureStartFold.expanded + assert text.substring(closureStartFold.endOffset).startsWith('System') //one line closure + + myFixture.type('2') + myFixture.doHighlighting() + closureStartFold = foldingModel.getCollapsedRegionAtOffset(text.indexOf("Runnable")) + assert closureStartFold + } + public void testFindInFolding() { def text = """\ class Test { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoverWrapper.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoverWrapper.java index d87e82a67b38..a233872b8e6c 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoverWrapper.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoverWrapper.java @@ -131,7 +131,6 @@ class MoverWrapper { } }); } - CodeFoldingManager.getInstance(project).allowFoldingOnCaretLine(editor); if (hasSelection) { restoreSelection(editor, selectionStart, selectionEnd, start, myInfo.range2.getStartOffset()); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/folding/CodeFoldingManager.java b/platform/lang-impl/src/com/intellij/codeInsight/folding/CodeFoldingManager.java index be52c03fed31..7c9ed482d819 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/folding/CodeFoldingManager.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/folding/CodeFoldingManager.java @@ -50,14 +50,4 @@ public abstract class CodeFoldingManager { public abstract void releaseFoldings(Editor editor); public abstract void buildInitialFoldings(Editor editor); - - /** - * Asks do not perform automatic expansion of fold region that is located on the caret line during the next fold regions update. - *

- * This method is necessary because fold regions that are located on caret line are automatically expanded to prevent problem - * from IDEA-64687. However, we don't want such an expansion when we, for example, move method up or down. - * - * @param editor target editor - */ - public abstract void allowFoldingOnCaretLine(@NotNull Editor editor); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/CodeFoldingManagerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/CodeFoldingManagerImpl.java index f2008c380b8f..74c83d50d8cb 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/CodeFoldingManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/CodeFoldingManagerImpl.java @@ -331,9 +331,4 @@ public class CodeFoldingManagerImpl extends CodeFoldingManager implements Projec document.putUserData(FOLDING_STATE_INFO_IN_DOCUMENT_KEY, null); } } - - @Override - public void allowFoldingOnCaretLine(@NotNull Editor editor) { - editor.putUserData(UpdateFoldRegionsOperation.ALLOW_FOLDING_ON_CARET_LINE_KEY, true); - } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/UpdateFoldRegionsOperation.java b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/UpdateFoldRegionsOperation.java index e2e051772a6c..3ad2f94584a3 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/UpdateFoldRegionsOperation.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/UpdateFoldRegionsOperation.java @@ -18,14 +18,12 @@ package com.intellij.codeInsight.folding.impl; import com.intellij.lang.folding.FoldingDescriptor; import com.intellij.lang.injection.InjectedLanguageManager; -import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.FoldRegion; import com.intellij.openapi.editor.FoldingGroup; import com.intellij.openapi.editor.ex.FoldingModelEx; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Key; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; @@ -43,9 +41,6 @@ import static com.intellij.util.containers.CollectionFactory.newTroveMap; * @author cdr */ class UpdateFoldRegionsOperation implements Runnable { - - static final Key ALLOW_FOLDING_ON_CARET_LINE_KEY = Key.create("AllowFoldingOnCaretLine.KEY"); - private final Project myProject; private final Editor myEditor; private final PsiFile myFile; @@ -80,9 +75,6 @@ class UpdateFoldRegionsOperation implements Runnable { List newRegions = addNewRegions(info, foldingModel, rangeToExpandStatusMap, shouldExpand, groupExpand); applyExpandStatus(newRegions, shouldExpand, groupExpand); - - // Reset the key. - myEditor.putUserData(ALLOW_FOLDING_ON_CARET_LINE_KEY, false); } private static void applyExpandStatus(@NotNull List newRegions, @@ -147,24 +139,9 @@ class UpdateFoldRegionsOperation implements Runnable { // Considering that this code is executed only on initial fold regions construction on editor opening. return !FoldingPolicy.isCollapseByDefault(element); } - boolean caretInside; - if (myEditor.getUserData(ALLOW_FOLDING_ON_CARET_LINE_KEY) == Boolean.TRUE) { - caretInside = FoldingUtil.caretInsideRange(myEditor, range); - } - else { - final Document document = myEditor.getDocument(); - final int firstLine = document.getLineNumber(range.getStartOffset()); - final int lastLine = document.getLineNumber(range.getEndOffset()); - int caretOffset = myEditor.getCaretModel().getOffset(); - if (caretOffset > myEditor.getDocument().getTextLength()) { - return false; - } - final int currentLine = document.getLineNumber(caretOffset); - caretInside = firstLine <= currentLine && currentLine <= lastLine; - } final Boolean oldStatus = rangeToExpandStatusMap.get(range); - return oldStatus == null || caretInside || oldStatus.booleanValue(); + return oldStatus == null || FoldingUtil.caretInsideRange(myEditor, range) || oldStatus.booleanValue(); } private void removeInvalidRegions(@NotNull EditorFoldingInfo info, diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/folding/GroovyFoldingBuilder.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/folding/GroovyFoldingBuilder.java index f695d0ebe0d8..b77bd7c933fc 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/folding/GroovyFoldingBuilder.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/folding/GroovyFoldingBuilder.java @@ -17,6 +17,7 @@ package org.jetbrains.plugins.groovy.lang.folding; import com.intellij.codeInsight.folding.JavaCodeFoldingSettings; +import com.intellij.codeInsight.folding.impl.JavaFoldingBuilder; import com.intellij.lang.ASTNode; import com.intellij.lang.folding.CustomFoldingBuilder; import com.intellij.lang.folding.FoldingDescriptor; @@ -194,7 +195,7 @@ public class GroovyFoldingBuilder extends CustomFoldingBuilder implements Groovy int start = first.getTextRange().getStartOffset(); int end = marker.getTextRange().getEndOffset(); int tail = "import ".length(); - if (start + tail < end) { + if (start + tail < end && !JavaFoldingBuilder.hasErrorElementsNearby(first.getContainingFile(), start, end)) { descriptors.add(new FoldingDescriptor(first.getNode(), new TextRange(start + tail, end))); } } From 9b6a24b86a033c48b7889b3efe070e065a7a70ac Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 29 Mar 2012 13:13:00 +0200 Subject: [PATCH 05/27] turn on light xi:includes --- .../src/com/intellij/xml/util/InclusionProvider.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/xml/impl/src/com/intellij/xml/util/InclusionProvider.java b/xml/impl/src/com/intellij/xml/util/InclusionProvider.java index d53f251bd356..9f637d59a193 100644 --- a/xml/impl/src/com/intellij/xml/util/InclusionProvider.java +++ b/xml/impl/src/com/intellij/xml/util/InclusionProvider.java @@ -17,13 +17,11 @@ package com.intellij.xml.util; import com.intellij.openapi.util.NullableComputable; import com.intellij.openapi.util.RecursionManager; -import com.intellij.psi.PsiAnchor; import com.intellij.psi.PsiElement; import com.intellij.psi.util.CachedValueProvider; import com.intellij.psi.util.CachedValuesManager; import com.intellij.psi.util.PsiModificationTracker; import com.intellij.psi.xml.XmlDocument; -import com.intellij.psi.xml.XmlElement; import com.intellij.psi.xml.XmlFile; import com.intellij.psi.xml.XmlTag; import com.intellij.util.xmlb.JDOMXIncluder; @@ -82,12 +80,7 @@ class InclusionProvider implements CachedValueProvider { final XmlTag[] includeTag = extractXpointer(rootTag, xpointer); PsiElement[] result = new PsiElement[includeTag.length]; for (int i = 0; i < includeTag.length; i++) { - XmlTag xmlTag = includeTag[i]; - final PsiElement psiElement = xmlTag.copy(); - psiElement.putUserData(XmlElement.INCLUDING_ELEMENT, xincludeTag.getParentTag()); - psiElement.putUserData(XmlUtil.ORIGINAL_ELEMENT, PsiAnchor.create(xmlTag)); - result[i] = psiElement; - //result[i] = new IncludedXmlTag(includeTag[i], xincludeTag.getParentTag()); + result[i] = new IncludedXmlTag(includeTag[i], xincludeTag.getParentTag()); } return result; } From c588cea67406dcc0c7e0829f2bcf0d00bac6cb5d Mon Sep 17 00:00:00 2001 From: Sergey Evdokimov Date: Thu, 29 Mar 2012 15:44:47 +0400 Subject: [PATCH 06/27] Add additional loggining to understand cause of maven test fail --- .../maven/dom/MavenExtensionCompletionAndResolutionTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java index aa34ea474344..95f5341069c4 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java @@ -74,6 +74,7 @@ public class MavenExtensionCompletionAndResolutionTest extends MavenDomWithIndic MavenProjectIndicesManager instance = MavenProjectIndicesManager.getInstance(myProject); System.out.println("GetArtifacts: " + instance.getArtifactIds("org.apache.maven.plugins")); System.out.println("Indexes: " + instance.getIndices()); + throw new AssertionError("GetArtifacts: " + instance.getArtifactIds("org.apache.maven.plugins") + "Indexes: " + instance.getIndices()); } assertUnorderedElementsAreEqual(actual, "maven-compiler-plugin", "maven-war-plugin", "maven-eclipse-plugin", "maven-surefire-plugin"); From ea56fe5b0236f944d872a17418e6a684ccc87993 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 29 Mar 2012 09:35:02 +0400 Subject: [PATCH 07/27] library editor: attach files actions works in dumb mode --- .../ui/configuration/libraryEditor/LibraryRootsComponent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/LibraryRootsComponent.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/LibraryRootsComponent.java index 4a6ea36e7de0..be3f59f985d2 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/LibraryRootsComponent.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/LibraryRootsComponent.java @@ -27,6 +27,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.fileChooser.FileChooser; import com.intellij.openapi.fileChooser.FileChooserDescriptor; import com.intellij.openapi.module.Module; +import com.intellij.openapi.project.DumbAwareAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectBundle; import com.intellij.openapi.roots.OrderRootType; @@ -371,7 +372,7 @@ public class LibraryRootsComponent implements Disposable, LibraryEditorComponent } } - public abstract class AttachItemActionBase extends AnAction { + public abstract class AttachItemActionBase extends DumbAwareAction { private VirtualFile myLastChosen = null; protected AttachItemActionBase(String text) { From e5ca397cf685dcb49ea795974655495dbe165cb8 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 29 Mar 2012 12:31:39 +0400 Subject: [PATCH 08/27] update gutter icon for related file when related items are changed --- .../codeInsight/daemon/LineMarkerInfo.java | 4 ++-- .../daemon/RelatedItemLineMarkerInfo.java | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/platform/lang-api/src/com/intellij/codeInsight/daemon/LineMarkerInfo.java b/platform/lang-api/src/com/intellij/codeInsight/daemon/LineMarkerInfo.java index c944eec2ffb4..454e396c268a 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/daemon/LineMarkerInfo.java +++ b/platform/lang-api/src/com/intellij/codeInsight/daemon/LineMarkerInfo.java @@ -35,7 +35,7 @@ import java.awt.event.MouseEvent; import java.lang.ref.WeakReference; public class LineMarkerInfo { - private final Icon myIcon; + protected final Icon myIcon; private final WeakReference elementRef; public final int startOffset; public final int endOffset; @@ -157,7 +157,7 @@ public class LineMarkerInfo { return myInfo.myIconAlignment; } - private boolean looksTheSameAs(@NotNull LineMarkerGutterIconRenderer renderer) { + protected boolean looksTheSameAs(@NotNull LineMarkerGutterIconRenderer renderer) { return myInfo.getElement() != null && renderer.myInfo.getElement() != null && diff --git a/platform/lang-api/src/com/intellij/codeInsight/daemon/RelatedItemLineMarkerInfo.java b/platform/lang-api/src/com/intellij/codeInsight/daemon/RelatedItemLineMarkerInfo.java index 9889bdf263a8..55ce601e8943 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/daemon/RelatedItemLineMarkerInfo.java +++ b/platform/lang-api/src/com/intellij/codeInsight/daemon/RelatedItemLineMarkerInfo.java @@ -60,4 +60,27 @@ public class RelatedItemLineMarkerInfo extends LineMarkerI public Collection createGotoRelatedItems() { return myTargets.getValue(); } + + @Override + public GutterIconRenderer createGutterRenderer() { + if (myIcon == null) return null; + return new RelatedItemLineMarkerGutterIconRenderer(this); + } + + private static class RelatedItemLineMarkerGutterIconRenderer extends LineMarkerGutterIconRenderer { + public RelatedItemLineMarkerGutterIconRenderer(final RelatedItemLineMarkerInfo markerInfo) { + super(markerInfo); + } + + @Override + protected boolean looksTheSameAs(@NotNull LineMarkerGutterIconRenderer renderer) { + if (!(renderer instanceof RelatedItemLineMarkerGutterIconRenderer) || !super.looksTheSameAs(renderer)) { + return false; + } + + final RelatedItemLineMarkerInfo markerInfo = (RelatedItemLineMarkerInfo)getLineMarkerInfo(); + final RelatedItemLineMarkerInfo otherInfo = (RelatedItemLineMarkerInfo)renderer.getLineMarkerInfo(); + return markerInfo.myTargets.equals(otherInfo.myTargets); + } + } } From 20ba32493ab25914e6d3cec21366864f9a88b0c7 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 29 Mar 2012 15:51:12 +0400 Subject: [PATCH 09/27] do not terminate hotswap if not all versions of class were reloaded (IDEA-68746) --- .../debugger/impl/ReloadClassesWorker.java | 129 +++++++++++++----- .../src/messages/DebuggerBundle.properties | 1 + 2 files changed, 98 insertions(+), 32 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java b/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java index 3cfdb3a8979f..f2459aadff39 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java +++ b/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java @@ -32,20 +32,13 @@ import com.sun.jdi.ReferenceType; import org.jetbrains.annotations.Nullable; import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @author lex */ class ReloadClassesWorker { private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.impl.ReloadClassesWorker"); - /** - * number of clasess that will be reloaded in one go. - * Such restriction is needed to deal with big number of classes being reloaded - */ - private static final int CLASSES_CHUNK_SIZE = 100; private final DebuggerSession myDebuggerSession; private final HotSwapProgress myProgress; @@ -111,11 +104,12 @@ class ReloadClassesWorker { final Project project = debugProcess.getProject(); final BreakpointManager breakpointManager = (DebuggerManagerEx.getInstanceEx(project)).getBreakpointManager(); breakpointManager.disableBreakpoints(debugProcess); - + //virtualMachineProxy.suspend(); - + try { - final Map redefineMap = new HashMap(); + RedefineProcessor redefineProcessor = new RedefineProcessor(virtualMachineProxy); + int processedClassesCount = 0; for (final String qualifiedName : modifiedClasses.keySet()) { processedClassesCount++; @@ -124,32 +118,30 @@ class ReloadClassesWorker { myProgress.setFraction(processedClassesCount / (double)modifiedClasses.size()); } final HotSwapFile fileDescr = modifiedClasses.get(qualifiedName); + final byte[] content; try { - final byte[] buffer = FileUtil.loadFileBytes(fileDescr.file); - final List classes = virtualMachineProxy.classesByName(qualifiedName); - for (final ReferenceType reference : classes) { - redefineMap.put(reference, buffer); - } + content = FileUtil.loadFileBytes(fileDescr.file); } catch (IOException e) { reportProblem(qualifiedName, e); + continue; } - if (redefineMap.size() >= CLASSES_CHUNK_SIZE) { - // reload this portion of clasess and clear the map to free memory - try { - virtualMachineProxy.redefineClasses(redefineMap); - } - finally { - redefineMap.clear(); - } - } - } - if (redefineMap.size() > 0) { - virtualMachineProxy.redefineClasses(redefineMap); + redefineProcessor.processClass(qualifiedName, content); } + redefineProcessor.processPending(); myProgress.setFraction(1); - - myProgress.addMessage(myDebuggerSession, MessageCategory.INFORMATION, DebuggerBundle.message("status.classes.reloaded", modifiedClasses.size())); + + final int partiallyRedefinedClassesCount = redefineProcessor.getPartiallyRedefinedClassesCount(); + if (partiallyRedefinedClassesCount == 0) { + myProgress.addMessage(myDebuggerSession, MessageCategory.INFORMATION, + DebuggerBundle.message("status.classes.reloaded", redefineProcessor.getProcessedClassesCount())); + } + else { + final String message = DebuggerBundle.message("status.classes.not.all.versions.reloaded", partiallyRedefinedClassesCount, + redefineProcessor.getProcessedClassesCount()); + myProgress.addMessage(myDebuggerSession, MessageCategory.WARNING, message); + } + if (LOG.isDebugEnabled()) { LOG.debug("classes reloaded"); } @@ -203,11 +195,10 @@ class ReloadClassesWorker { catch (Exception e) { processException(e); } - } private void reportProblem(final String qualifiedName, @Nullable Exception ex) { - String reason = null; + String reason = null; if (ex != null) { reason = ex.getLocalizedMessage(); } @@ -223,4 +214,78 @@ class ReloadClassesWorker { StringBuilderSpinAllocator.dispose(buf); } } + + private static class RedefineProcessor { + /** + * number of classes that will be reloaded in one go. + * Such restriction is needed to deal with big number of classes being reloaded + */ + private static final int CLASSES_CHUNK_SIZE = 100; + private final VirtualMachineProxyImpl myVirtualMachineProxy; + private final Map myRedefineMap = new HashMap(); + private int myProcessedClassesCount; + private int myPartiallyRedefinedClassesCount; + + public RedefineProcessor(VirtualMachineProxyImpl virtualMachineProxy) { + myVirtualMachineProxy = virtualMachineProxy; + } + + public void processClass(String qualifiedName, byte[] content) throws Throwable { + final List vmClasses = myVirtualMachineProxy.classesByName(qualifiedName); + if (vmClasses.isEmpty()) return; + + if (vmClasses.size() == 1) { + myRedefineMap.put(vmClasses.get(0), content); + if (myRedefineMap.size() >= CLASSES_CHUNK_SIZE) { + processChunk(); + } + return; + } + + int redefinedVersionsCount = 0; + Throwable error = null; + for (ReferenceType vmClass : vmClasses) { + try { + myVirtualMachineProxy.redefineClasses(Collections.singletonMap(vmClass, content)); + redefinedVersionsCount++; + } + catch (Throwable t) { + error = t; + } + } + if (redefinedVersionsCount == 0) { + throw error; + } + + if (redefinedVersionsCount < vmClasses.size()) { + myPartiallyRedefinedClassesCount++; + } + myProcessedClassesCount++; + } + + private void processChunk() throws Throwable { + // reload this portion of classes and clear the map to free memory + try { + myVirtualMachineProxy.redefineClasses(myRedefineMap); + myProcessedClassesCount += myRedefineMap.size(); + } + finally { + myRedefineMap.clear(); + } + } + + public void processPending() throws Throwable { + if (myRedefineMap.size() > 0) { + processChunk(); + } + } + + public int getProcessedClassesCount() { + return myProcessedClassesCount; + } + + public int getPartiallyRedefinedClassesCount() { + return myPartiallyRedefinedClassesCount; + } + } } diff --git a/resources-en/src/messages/DebuggerBundle.properties b/resources-en/src/messages/DebuggerBundle.properties index 1a51ab4d3574..508ae6ee32c8 100644 --- a/resources-en/src/messages/DebuggerBundle.properties +++ b/resources-en/src/messages/DebuggerBundle.properties @@ -164,6 +164,7 @@ error.exception.while.reloading=Exception while reloading classes : {0} : {1} status.hotswap.loaded.classes.up.to.date=Loaded classes are up to date. Nothing to reload error.io.error=I/O error status.classes.reloaded={0,number} {0,choice, 0#classes|1#class|2#classes} reloaded +status.classes.not.all.versions.reloaded=For {0} of {1} {1,choice, 1#class|2#classes} not all versions were reloaded error.cannot.create.void.value=Cannot create void value warning.range.too.big=Range specified is too big. {0} needs too much resources to perform requested operation. Are you sure you want to continue? title.range.too.big=Range is Too Big From 477dd80b8375d120edc6e83fb59c8cdd9245d0ff Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 29 Mar 2012 14:03:04 +0200 Subject: [PATCH 10/27] + recent files separator --- .../src/com/intellij/ide/actions/Switcher.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java index 5c633a0048b6..c439f4bc4b08 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java @@ -285,6 +285,7 @@ public class Switcher extends AnAction implements DumbAware { final VirtualFile[] recentFiles = ArrayUtil.reverseArray(EditorHistoryManager.getInstance(project).getFiles()); final int maxFiles = Math.max(editors.size(), recentFiles.length); final int len = isPinnedMode() ? maxFiles : Math.min(toolWindows.getModel().getSize(), maxFiles); + boolean firstRecentMarked = false; for (int i = 0; i < len; i++) { final FileInfo info = new FileInfo(recentFiles[i], null); boolean add = true; @@ -298,6 +299,10 @@ public class Switcher extends AnAction implements DumbAware { } if (add) { filesData.add(info); + if (!firstRecentMarked) { + firstRecentMarked = true; + info.isSeparator = true; + } } } if (editors.size() == 1 && (filesData.isEmpty() || !editors.get(0).getFirst().equals(filesData.get(0).getFirst()))) { @@ -805,6 +810,7 @@ public class Switcher extends AnAction implements DumbAware { private final Project myProject; private final SpeedSearchBase mySearch; private boolean hide = false; + private boolean separator = false; public VirtualFilesRenderer(Project project, SpeedSearchBase search) { myProject = project; @@ -817,10 +823,12 @@ public class Switcher extends AnAction implements DumbAware { final VirtualFile virtualFile = ((FileInfo)value).first; final String name = virtualFile.getPresentableName(); setIcon(IconUtil.getIcon(virtualFile, Iconable.ICON_FLAG_READ_STATUS, myProject)); + separator = ((FileInfo)value).isSeparator; if ( mySearch != null && mySearch.isPopupActive()) { hide = mySearch.matchingFragments(name) == null && !StringUtil.isEmpty(mySearch.getEnteredPrefix()); } + final FileStatus fileStatus = FileStatusManager.getInstance(myProject).getStatus(virtualFile); final TextAttributes attributes = new TextAttributes(fileStatus.getColor(), null, null, EffectType.LINE_UNDERSCORE, Font.PLAIN); append(name, SimpleTextAttributes.fromTextAttributes(attributes)); @@ -835,10 +843,14 @@ public class Switcher extends AnAction implements DumbAware { } super.doPaint(g); config.restore(); + if (separator) { + UIUtil.drawDottedLine(g, 0, 0, getWidth(), 0, Color.WHITE, Color.BLACK); + } } } private static class FileInfo extends Pair { + boolean isSeparator = false; public FileInfo(VirtualFile first, EditorWindow second) { super(first, second); } From 20695de4fd9117adce883f4c89b275cff2c3179c Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Thu, 29 Mar 2012 14:20:12 +0200 Subject: [PATCH 11/27] compile server: support classpath index generation --- .../compiler/CompileServerManager.java | 7 +- .../org/jetbrains/jps/api/GlobalOptions.java | 1 + .../jetbrains/jps/api/SharedThreadPool.java | 18 +++++ .../jps/incremental/IncProjectBuilder.java | 80 ++++++++++++++++++- .../jps/incremental/ModuleLevelBuilder.java | 2 +- .../jps/incremental/java/JavaBuilder.java | 6 +- .../resources/ResourcesBuilder.java | 5 +- .../jps/javac/JavacServerClient.java | 13 +-- .../AndroidLibraryPackagingBuilder.java | 9 ++- .../AndroidSourceGeneratingBuilder.java | 2 +- .../jps/incremental/groovy/GroovyBuilder.java | 2 +- 11 files changed, 117 insertions(+), 28 deletions(-) create mode 100644 jps/jps-builders/src/org/jetbrains/jps/api/SharedThreadPool.java diff --git a/java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java b/java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java index fc7c7d7b7eb8..3aef0d599083 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java +++ b/java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java @@ -70,8 +70,7 @@ import org.jetbrains.jps.client.CompileServerClient; import org.jetbrains.jps.server.ClasspathBootstrap; import org.jetbrains.jps.server.Server; -import javax.tools.JavaCompiler; -import javax.tools.ToolProvider; +import javax.tools.*; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -586,6 +585,10 @@ public class CompileServerManager implements ApplicationComponent{ cmdLine.addParameter("-XX:ReservedCodeCacheSize=64m"); cmdLine.addParameter("-Xmx" + Registry.intValue("compiler.server.heap.size") + "m"); cmdLine.addParameter("-Djava.awt.headless=true"); + final String shouldGenerateIndex = System.getProperty(GlobalOptions.GENERATE_CLASSPATH_INDEX_OPTION); + if (shouldGenerateIndex != null) { + cmdLine.addParameter("-D"+ GlobalOptions.GENERATE_CLASSPATH_INDEX_OPTION +"=" + shouldGenerateIndex); + } //noinspection ConstantConditions if (pingInterval > 0L) { cmdLine.addParameter("-D" + GlobalOptions.PING_INTERVAL_MS_OPTION + "=" + pingInterval); diff --git a/jps/jps-builders/src/org/jetbrains/jps/api/GlobalOptions.java b/jps/jps-builders/src/org/jetbrains/jps/api/GlobalOptions.java index f2fdd71e4b0d..febbe3880eb7 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/api/GlobalOptions.java +++ b/jps/jps-builders/src/org/jetbrains/jps/api/GlobalOptions.java @@ -9,4 +9,5 @@ public interface GlobalOptions { String USE_EXTERNAL_JAVAC_OPTION = "use.external.javac.process"; String HOSTNAME_OPTION = "localhost.name"; String PING_INTERVAL_MS_OPTION = "server.ping.interval"; + String GENERATE_CLASSPATH_INDEX_OPTION = "generate.classpath.index"; } diff --git a/jps/jps-builders/src/org/jetbrains/jps/api/SharedThreadPool.java b/jps/jps-builders/src/org/jetbrains/jps/api/SharedThreadPool.java new file mode 100644 index 000000000000..508abe015b3f --- /dev/null +++ b/jps/jps-builders/src/org/jetbrains/jps/api/SharedThreadPool.java @@ -0,0 +1,18 @@ +package org.jetbrains.jps.api; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * @author Eugene Zhuravlev + * Date: 3/29/12 + */ +public class SharedThreadPool { + public static final ExecutorService INSTANCE = Executors.newCachedThreadPool(); + public static final AsyncTaskExecutor ASYNC_EXEC = new AsyncTaskExecutor() { + @Override + public void submit(Runnable runnable) { + INSTANCE.submit(runnable); + } + }; +} diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java index f59e2c6a0da9..5d493a8dca64 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java @@ -9,7 +9,9 @@ import com.intellij.util.io.MappingFailedException; import com.intellij.util.io.PersistentEnumerator; import org.jetbrains.jps.*; import org.jetbrains.jps.api.CanceledStatus; +import org.jetbrains.jps.api.GlobalOptions; import org.jetbrains.jps.api.RequestFuture; +import org.jetbrains.jps.api.SharedThreadPool; import org.jetbrains.jps.incremental.java.ExternalJavacDescriptor; import org.jetbrains.jps.incremental.java.JavaBuilder; import org.jetbrains.jps.incremental.java.JavaBuilderLogger; @@ -21,10 +23,13 @@ import org.jetbrains.jps.incremental.storage.SourceToFormMapping; import org.jetbrains.jps.incremental.storage.SourceToOutputMapping; import org.jetbrains.jps.server.ProjectDescriptor; +import java.io.BufferedWriter; import java.io.File; +import java.io.FileWriter; import java.io.IOException; import java.lang.reflect.Field; import java.util.*; +import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; /** @@ -35,6 +40,8 @@ public class IncProjectBuilder { private static final Logger LOG = Logger.getInstance("#org.jetbrains.jps.incremental.IncProjectBuilder"); public static final String COMPILE_SERVER_NAME = "COMPILE SERVER"; + private static final String CLASSPATH_INDEX_FINE_NAME = "classpath.index"; + private static final boolean GENERATE_CLASSPATH_INDEX = "true".equals(System.getProperty(GlobalOptions.GENERATE_CLASSPATH_INDEX_OPTION)); private final ProjectDescriptor myProjectDescriptor; private final BuilderRegistry myBuilderRegistry; @@ -54,6 +61,7 @@ public class IncProjectBuilder { private float myModulesProcessed = 0.0f; private final float myTotalModulesWork; private final int myTotalModuleLevelBuilderCount; + private final List myAsyncTasks = new ArrayList(); public IncProjectBuilder(ProjectDescriptor pd, BuilderRegistry builderRegistry, Map builderParams, CanceledStatus cs) { myProjectDescriptor = pd; @@ -131,6 +139,15 @@ public class IncProjectBuilder { finally { memWatcher.stop(); flushContext(context); + // wait for the async tasks + for (Future task : myAsyncTasks) { + try { + task.get(); + } + catch (Throwable th) { + LOG.info(th); + } + } } } @@ -309,16 +326,18 @@ public class IncProjectBuilder { } } - private void buildChunk(CompileContext context, ModuleChunk chunk) throws ProjectBuildException { + private void buildChunk(CompileContext context, final ModuleChunk chunk) throws ProjectBuildException { + boolean doneSomething = false; try { context.ensureFSStateInitialized(chunk); if (context.isMake()) { processDeletedPaths(context, chunk); + doneSomething |= context.hasRemovedSources(); } context.onChunkBuildStart(chunk); - runModuleLevelBuilders(context, chunk); + doneSomething = runModuleLevelBuilders(context, chunk); } catch (ProjectBuildException e) { throw e; @@ -343,11 +362,59 @@ public class IncProjectBuilder { } finally { Paths.CHUNK_REMOVED_SOURCES_KEY.set(context, null); + if (doneSomething && GENERATE_CLASSPATH_INDEX) { + final boolean forTests = context.isCompilingTests(); + final Future future = SharedThreadPool.INSTANCE.submit(new Runnable() { + @Override + public void run() { + createClasspathIndex(chunk, forTests); + } + }); + myAsyncTasks.add(future); + } } } } } + private static void createClasspathIndex(final ModuleChunk chunk, boolean forTests) { + final Set outputPaths = new LinkedHashSet(); + for (Module module : chunk.getModules()) { + if (forTests) { + outputPaths.add(new File(module.getTestOutputPath())); + } + else { + outputPaths.add(new File(module.getOutputPath())); + } + } + for (File outputRoot : outputPaths) { + try { + BufferedWriter writer = new BufferedWriter(new FileWriter(new File(outputRoot, CLASSPATH_INDEX_FINE_NAME))); + try { + writeIndex(writer, outputRoot, ""); + } + finally { + writer.close(); + } + } + catch (IOException e) { + // Ignore. Failed to create optional classpath index + } + } + } + + private static void writeIndex(final BufferedWriter writer, final File file, final String path) throws IOException { + writer.write(path); + writer.write('\n'); + final File[] files = file.listFiles(); + if (files != null) { + for (File child : files) { + writeIndex(writer, child, path + "/" + child.getName()); + } + } + } + + private void processDeletedPaths(CompileContext context, ModuleChunk chunk) throws ProjectBuildException { try { // cleanup outputs @@ -420,13 +487,14 @@ public class IncProjectBuilder { } } - private void runModuleLevelBuilders(final CompileContext context, ModuleChunk chunk) throws ProjectBuildException { + // return true if changed something, false otherwise + private boolean runModuleLevelBuilders(final CompileContext context, ModuleChunk chunk) throws ProjectBuildException { + boolean doneSomething = false; boolean rebuildFromScratchRequested = false; float stageCount = myTotalModuleLevelBuilderCount; final int modulesInChunk = chunk.getModules().size(); int buildersPassed = 0; boolean nextPassRequired; - do { nextPassRequired = false; context.beforeCompileRound(chunk); @@ -448,6 +516,8 @@ public class IncProjectBuilder { } final ModuleLevelBuilder.ExitCode buildResult = builder.build(context, chunk); + doneSomething |= (buildResult != ModuleLevelBuilder.ExitCode.NOTHING_DONE); + if (buildResult == ModuleLevelBuilder.ExitCode.ABORT) { throw new ProjectBuildException("Builder " + builder.getDescription() + " requested build stop"); } @@ -492,6 +562,8 @@ public class IncProjectBuilder { } } while (nextPassRequired); + + return doneSomething; } private void runProjectLevelBuilders(CompileContext context) throws ProjectBuildException { diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleLevelBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleLevelBuilder.java index d503e83bff8e..5f442ca56ae0 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleLevelBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleLevelBuilder.java @@ -32,7 +32,7 @@ public abstract class ModuleLevelBuilder extends Builder { } public static enum ExitCode { - OK, ABORT, ADDITIONAL_PASS_REQUIRED, CHUNK_REBUILD_REQUIRED + NOTHING_DONE, OK, ABORT, ADDITIONAL_PASS_REQUIRED, CHUNK_REBUILD_REQUIRED } public abstract ExitCode build(CompileContext context, ModuleChunk chunk) throws ProjectBuildException; diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java index 5378c096312a..58db508502ac 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java @@ -33,8 +33,7 @@ import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Opcodes; import org.objectweb.asm.commons.EmptyVisitor; -import javax.tools.Diagnostic; -import javax.tools.JavaFileObject; +import javax.tools.*; import java.io.*; import java.net.MalformedURLException; import java.net.ServerSocket; @@ -239,7 +238,7 @@ public class JavaBuilder extends ModuleLevelBuilder { private ExitCode compile(final CompileContext context, ModuleChunk chunk, Collection files, Collection forms) throws Exception { - ExitCode exitCode = ExitCode.OK; + ExitCode exitCode = ExitCode.NOTHING_DONE; final boolean hasSourcesToCompile = !files.isEmpty() || !forms.isEmpty(); @@ -264,6 +263,7 @@ public class JavaBuilder extends ModuleLevelBuilder { DELTA_MAPPINGS_CALLBACK_KEY.set(context, delta.getCallback()); try { if (hasSourcesToCompile) { + exitCode = ExitCode.OK; final Set sourcePath = TEMPORARY_SOURCE_ROOTS_KEY.get(context, Collections.emptySet()); final String chunkName = getChunkPresentableName(chunk); diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/resources/ResourcesBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/resources/ResourcesBuilder.java index 06e142335840..21238fa03190 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/resources/ResourcesBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/resources/ResourcesBuilder.java @@ -1,6 +1,7 @@ package org.jetbrains.jps.incremental.resources; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.io.FileUtil; import org.jetbrains.jps.Module; import org.jetbrains.jps.ModuleChunk; @@ -38,12 +39,14 @@ public class ResourcesBuilder extends ModuleLevelBuilder { } try { final ResourcePatterns finalPatterns = patterns; + final Ref doneSomething = new Ref(false); context.processFilesToRecompile(chunk, new FileProcessor() { public boolean apply(final Module module, final File file, final String sourceRoot) throws IOException { if (finalPatterns.isResourceFile(file, sourceRoot)) { try { context.processMessage(new ProgressMessage("Copying " + file.getPath())); final String moduleName = module.getName().toLowerCase(Locale.US); + doneSomething.set(true); copyResource(context, module, file, sourceRoot, context.getDataManager().getSourceToOutputMap(moduleName, context.isCompilingTests())); } catch (IOException e) { @@ -56,7 +59,7 @@ public class ResourcesBuilder extends ModuleLevelBuilder { } }); - return ExitCode.OK; + return doneSomething.get()? ExitCode.OK : ExitCode.NOTHING_DONE; } catch (Exception e) { throw new ProjectBuildException(e.getMessage(), e); diff --git a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServerClient.java b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServerClient.java index 75a3e7cb6e1d..136f07ce4798 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServerClient.java +++ b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServerClient.java @@ -2,31 +2,22 @@ package org.jetbrains.jps.javac; import org.jboss.netty.channel.MessageEvent; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jps.api.AsyncTaskExecutor; import org.jetbrains.jps.api.RequestFuture; +import org.jetbrains.jps.api.SharedThreadPool; import org.jetbrains.jps.client.SimpleProtobufClient; import org.jetbrains.jps.client.UUIDGetter; import java.io.File; import java.util.*; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; /** * @author Eugene Zhuravlev * Date: 1/22/12 */ public class JavacServerClient extends SimpleProtobufClient{ - private static final ExecutorService ourExecutors = Executors.newCachedThreadPool(); - private static final AsyncTaskExecutor ASYNC_EXEC = new AsyncTaskExecutor() { - @Override - public void submit(Runnable runnable) { - ourExecutors.submit(runnable); - } - }; public JavacServerClient() { - super(JavacRemoteProto.Message.getDefaultInstance(), ASYNC_EXEC, new UUIDGetter() { + super(JavacRemoteProto.Message.getDefaultInstance(), SharedThreadPool.ASYNC_EXEC, new UUIDGetter() { @NotNull public UUID getSessionUUID(@NotNull MessageEvent e) { final JavacRemoteProto.Message message = (JavacRemoteProto.Message)e.getMessage(); diff --git a/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidLibraryPackagingBuilder.java b/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidLibraryPackagingBuilder.java index 0720446f5288..827e177c5930 100644 --- a/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidLibraryPackagingBuilder.java +++ b/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidLibraryPackagingBuilder.java @@ -30,9 +30,9 @@ public class AndroidLibraryPackagingBuilder extends ModuleLevelBuilder { } @Override - public ModuleLevelBuilder.ExitCode build(CompileContext context, ModuleChunk chunk) throws ProjectBuildException { + public ExitCode build(CompileContext context, ModuleChunk chunk) throws ProjectBuildException { if (context.isCompilingTests() || !AndroidJpsUtil.containsAndroidFacet(chunk) || AndroidJpsUtil.isLightBuild(context)) { - return ModuleLevelBuilder.ExitCode.OK; + return ExitCode.NOTHING_DONE; } try { @@ -48,6 +48,7 @@ public class AndroidLibraryPackagingBuilder extends ModuleLevelBuilder { final AndroidFileSetStorage storage = new AndroidFileSetStorage(context.getDataManager().getDataStorageRoot(), "libs_packaging"); try { + boolean doneSomething = false; for (Module module : chunk.getModules()) { final AndroidFacet facet = AndroidJpsUtil.getFacet(module); if (facet == null || !facet.isLibrary()) { @@ -82,7 +83,7 @@ public class AndroidLibraryPackagingBuilder extends ModuleLevelBuilder { if (subdirs.size() > 0) { context.processMessage(new ProgressMessage(AndroidJpsBundle.message("android.jps.progress.library.packaging", module.getName()))); final File outputJarFile = new File(outputDirectoryForPackagedFiles, AndroidCommonUtils.CLASSES_JAR_FILE_NAME); - + doneSomething = true; try { AndroidCommonUtils.packClassFilesIntoJar(ArrayUtil.EMPTY_STRING_ARRAY, ArrayUtil.toStringArray(subdirs), outputJarFile); storage.update(module.getName(), newState); @@ -94,7 +95,7 @@ public class AndroidLibraryPackagingBuilder extends ModuleLevelBuilder { } } } - return success ? ModuleLevelBuilder.ExitCode.OK : ModuleLevelBuilder.ExitCode.ABORT; + return success ? (doneSomething? ExitCode.OK : ExitCode.NOTHING_DONE) : ExitCode.ABORT; } finally { storage.close(); diff --git a/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidSourceGeneratingBuilder.java b/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidSourceGeneratingBuilder.java index c3f8d80ef2cd..e9ef804f1eef 100644 --- a/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidSourceGeneratingBuilder.java +++ b/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidSourceGeneratingBuilder.java @@ -61,7 +61,7 @@ public class AndroidSourceGeneratingBuilder extends ModuleLevelBuilder { @Override public ModuleLevelBuilder.ExitCode build(CompileContext context, ModuleChunk chunk) throws ProjectBuildException { if (context.isCompilingTests() || !AndroidJpsUtil.containsAndroidFacet(chunk)) { - return ModuleLevelBuilder.ExitCode.OK; + return ExitCode.NOTHING_DONE; } try { diff --git a/plugins/groovy/rt/src/org/jetbrains/jps/incremental/groovy/GroovyBuilder.java b/plugins/groovy/rt/src/org/jetbrains/jps/incremental/groovy/GroovyBuilder.java index 2c6a41287403..0852f2e8fdfe 100644 --- a/plugins/groovy/rt/src/org/jetbrains/jps/incremental/groovy/GroovyBuilder.java +++ b/plugins/groovy/rt/src/org/jetbrains/jps/incremental/groovy/GroovyBuilder.java @@ -49,7 +49,7 @@ public class GroovyBuilder extends ModuleLevelBuilder { try { final List toCompile = collectChangedFiles(context, chunk); if (toCompile.isEmpty()) { - return ExitCode.OK; + return ExitCode.NOTHING_DONE; } String moduleOutput = getModuleOutput(context, chunk); From d62313da175b2ad454492dde8f1339270ec03518 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 29 Mar 2012 14:29:17 +0200 Subject: [PATCH 12/27] pin / unpin --- .../com/intellij/ide/actions/Switcher.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java index c439f4bc4b08..158d0ecf6061 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java @@ -32,6 +32,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.popup.JBPopup; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.util.Computable; +import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.Iconable; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; @@ -75,6 +76,8 @@ import static java.awt.event.KeyEvent.*; @SuppressWarnings({"AssignmentToStaticFieldFromInstanceMethod", "SSBasedInspection"}) public class Switcher extends AnAction implements DumbAware { private static volatile SwitcherPanel SWITCHER = null; + private static final Icon PIN_ON = IconLoader.getIcon("/general/autohideOn.png"); + private static final Icon PIN_OFF = IconLoader.getIcon("/general/autohideOff.png"); private static final Color BORDER_COLOR = Gray._135; private static final Color SEPARATOR_COLOR = BORDER_COLOR.brighter(); @NonNls private static final String SWITCHER_FEATURE_ID = "switcher"; @@ -189,7 +192,7 @@ public class Switcher extends AnAction implements DumbAware { addKeyListener(this); setBorder(new EmptyBorder(0, 0, 0, 0)); setBackground(Color.WHITE); - pathLabel.setHorizontalAlignment(SwingConstants.RIGHT); + pathLabel.setHorizontalAlignment(SwingConstants.LEFT); final Font font = pathLabel.getFont(); pathLabel.setFont(font.deriveFont((float)10)); @@ -204,7 +207,19 @@ public class Switcher extends AnAction implements DumbAware { }; descriptions.setBorder(BorderFactory.createEmptyBorder(1, 4, 1, 4)); - descriptions.add(pathLabel); + descriptions.add(pathLabel, BorderLayout.CENTER); + final JLabel pinLabel = new JLabel(isPinnedMode() ? PIN_ON : PIN_OFF); + pinLabel.setToolTipText(isPinnedMode() ? "Pinned mode" : "Floating mode"); + pinLabel.setBorder(IdeBorderFactory.createEmptyBorder(0, 10, 0, 0)); + descriptions.add(pinLabel, BorderLayout.EAST); + pinLabel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + UISettings.getInstance().HIDE_SWITCHER_ON_CONTROL_RELEASE = !UISettings.getInstance().HIDE_SWITCHER_ON_CONTROL_RELEASE; + pinLabel.setIcon(isPinnedMode() ? PIN_ON : PIN_OFF); + pinLabel.setToolTipText(isPinnedMode() ? "Pinned mode" : "Floating mode"); + } + }); twManager = ToolWindowManager.getInstance(project); final DefaultListModel twModel = new DefaultListModel(); for (String id : twManager.getToolWindowIds()) { From cfbdc39e46263bfb6edc57f3260725e1714fa214 Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Thu, 29 Mar 2012 16:35:21 +0400 Subject: [PATCH 13/27] NPE on null prompt --- .../execution/console/LanguageConsoleImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 1be5c6ccf3c9..71b22aef2b5c 100644 --- a/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java @@ -95,6 +95,7 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider { private final JPanel myPanel = new JPanel(new MyLayout()); private String myTitle; + @Nullable private String myPrompt = "> "; private final LightVirtualFile myHistoryFile; private Editor myCurrentEditor; @@ -316,11 +317,12 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider { return myHistoryFile; } + @Nullable public String getPrompt() { return myPrompt; } - public void setPrompt(String prompt) { + public void setPrompt(@Nullable String prompt) { // always add space to the prompt otherwise it may look ugly myPrompt = prompt != null && !prompt.endsWith(" ") ? prompt + " " : prompt; setPromptInner(myPrompt); @@ -435,8 +437,10 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider { protected String addTextRangeToHistory(TextRange textRange, final EditorEx consoleEditor, boolean preserveMarkup) { final Document history = myHistoryViewer.getDocument(); final MarkupModel markupModel = DocumentMarkupModel.forDocument(history, myProject, true); - appendToHistoryDocument(history, myPrompt); - markupModel.addRangeHighlighter(history.getTextLength() - myPrompt.length(), history.getTextLength(), HighlighterLayer.SYNTAX, + if (myPrompt != null) { + appendToHistoryDocument(history, myPrompt); + } + markupModel.addRangeHighlighter(history.getTextLength() - StringUtil.length(myPrompt), history.getTextLength(), HighlighterLayer.SYNTAX, ConsoleViewContentType.USER_INPUT.getAttributes(), HighlighterTargetArea.EXACT_RANGE); From 1563df17f1fc1f08f8f4a90843c453aa4faa0910 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Mar 2012 15:15:23 +0200 Subject: [PATCH 14/27] red code is green wildcard problems ++(IDEA-66750;IDEA-75178;IDEA-73377) --- .../impl/analysis/GenericsHighlightUtil.java | 44 +------------------ .../intellij/psi/util/TypeConversionUtil.java | 6 +-- .../psi/util/TypesDistinctProver.java | 9 ++-- .../genericsHighlighting/WildcardTypes.java | 44 +++++++++++++++++++ 4 files changed, 54 insertions(+), 49 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java index be5894779a33..d2a350e0d918 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java @@ -688,7 +688,7 @@ public class GenericsHighlightUtil { return true; } } - if (isUncheckedTypeArgumentConversion(lTypeArg, rTypeArg)) return true; + if (!TypeConversionUtil.typesAgree(lTypeArg, rTypeArg, false)) return true; } return false; } @@ -730,48 +730,6 @@ public class GenericsHighlightUtil { return false; } - private static boolean isUncheckedTypeArgumentConversion (PsiType lTypeArg, PsiType rTypeArg) { - if (lTypeArg instanceof PsiPrimitiveType || rTypeArg instanceof PsiPrimitiveType) return false; - if (lTypeArg.equals(rTypeArg)) return false; - if (lTypeArg instanceof PsiCapturedWildcardType) { - //ignore capture conversion - return isUncheckedTypeArgumentConversion(((PsiCapturedWildcardType)lTypeArg).getWildcard(), rTypeArg); - } - if (rTypeArg instanceof PsiCapturedWildcardType) { - //ignore capture conversion - return isUncheckedTypeArgumentConversion(lTypeArg, ((PsiCapturedWildcardType)rTypeArg).getWildcard()); - } - - if (lTypeArg instanceof PsiWildcardType || rTypeArg instanceof PsiWildcardType) { - return !lTypeArg.isAssignableFrom(rTypeArg); - } - - if (lTypeArg instanceof PsiArrayType && rTypeArg instanceof PsiArrayType) { - return isUncheckedTypeArgumentConversion(((PsiArrayType)rTypeArg).getComponentType(), ((PsiArrayType)lTypeArg).getComponentType()); - } - if (lTypeArg instanceof PsiArrayType || rTypeArg instanceof PsiArrayType) return false; - if (lTypeArg instanceof PsiIntersectionType) { - for (PsiType type : ((PsiIntersectionType)lTypeArg).getConjuncts()) { - if (!isUncheckedTypeArgumentConversion(type, rTypeArg)) return false; - } - return true; - } - if (!(lTypeArg instanceof PsiClassType)) { - LOG.error("left: "+lTypeArg + "; "+lTypeArg.getClass()); - } - if (rTypeArg instanceof PsiIntersectionType) { - for (PsiType type : ((PsiIntersectionType)rTypeArg).getConjuncts()) { - if (!isUncheckedTypeArgumentConversion(lTypeArg, type)) return false; - } - return true; - } - if (!(rTypeArg instanceof PsiClassType)) { - LOG.error("right :"+rTypeArg + "; "+rTypeArg.getClass()); - } - return ((PsiClassType)lTypeArg).resolve() instanceof PsiTypeParameter || - ((PsiClassType)rTypeArg).resolve() instanceof PsiTypeParameter; - } - @Nullable public static HighlightInfo checkForeachLoopParameterType(PsiForeachStatement statement) { final PsiParameter parameter = statement.getIterationParameter(); diff --git a/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java b/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java index 7aea5e6cdcdd..557c12198331 100644 --- a/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java @@ -354,7 +354,7 @@ public class TypeConversionUtil { final PsiClass class1 = PsiUtil.resolveClassInType(typeArg1); if (class1 instanceof PsiTypeParameter) { for (PsiType type : class1.getExtendsListTypes()) { - if (TypesDistinctProver.provablyDistinct(type, typeArg2)) return false; + if (TypesDistinctProver.provablyDistinct(type, typeArg2) && !isAssignable(type, typeArg2)) return false; } } } @@ -746,7 +746,7 @@ public class TypeConversionUtil { private static boolean isAssignableToWildcard(PsiWildcardType wildcardType, PsiType right) { if (wildcardType.isSuper()) { - return isAssignable(right, wildcardType.getSuperBound()); + return isAssignable(wildcardType.getSuperBound(), right); } return isAssignable(wildcardType.getExtendsBound(), right); } @@ -859,7 +859,7 @@ public class TypeConversionUtil { return true; } - private static boolean typesAgree(PsiType typeLeft, PsiType typeRight, boolean allowUncheckedConversion) { + public static boolean typesAgree(PsiType typeLeft, PsiType typeRight, boolean allowUncheckedConversion) { if (typeLeft instanceof PsiWildcardType) { final PsiWildcardType leftWildcard = (PsiWildcardType)typeLeft; final PsiType leftBound = leftWildcard.getBound(); diff --git a/java/java-psi-api/src/com/intellij/psi/util/TypesDistinctProver.java b/java/java-psi-api/src/com/intellij/psi/util/TypesDistinctProver.java index 4f86a7039399..4f479fc41c7f 100644 --- a/java/java-psi-api/src/com/intellij/psi/util/TypesDistinctProver.java +++ b/java/java-psi-api/src/com/intellij/psi/util/TypesDistinctProver.java @@ -92,7 +92,10 @@ public class TypesDistinctProver { for (PsiClassType type : parameter.getExtendsListTypes()) { if (!TypeConversionUtil.isAssignable(type, substitutedType1 != null ? substitutedType1 : substitutedType2, false)) return true; } - } else if (provablyDistinct(substitutedType1, substitutedType2)) return true; + } else { + if (provablyDistinct(substitutedType1, substitutedType2)) return true; + if (substitutedType1 instanceof PsiWildcardType && !((PsiWildcardType)substitutedType1).isBounded()) return true; + } } return false; } @@ -100,8 +103,8 @@ public class TypesDistinctProver { final PsiClass boundClass1 = classResolveResult1.getElement(); final PsiClass boundClass2 = classResolveResult2.getElement(); return type2 != null && type1 != null && !type1.equals(type2) && - !InheritanceUtil.isInheritorOrSelf(boundClass1, boundClass2, true) && - !InheritanceUtil.isInheritorOrSelf(boundClass2, boundClass1, true); + (!InheritanceUtil.isInheritorOrSelf(boundClass1, boundClass2, true) || + !InheritanceUtil.isInheritorOrSelf(boundClass2, boundClass1, true)); } public static boolean provablyDistinct(PsiWildcardType type1, PsiWildcardType type2) { diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/WildcardTypes.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/WildcardTypes.java index 5145e806c4b4..1a586323851c 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/WildcardTypes.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/WildcardTypes.java @@ -172,4 +172,48 @@ class My { public void test() { if (getSuperclass() == List.class); } +} + +class IDEA75178 { + void test(Set labels) { + final Matcher empty = isEmpty(); + assertThat(labels, empty); + assertAlsoThat(empty, labels); + } + + public static void assertThat(T actual, Matcher matcher) { throw new AssertionError(actual.toString() + matcher.toString());} + public static void assertAlsoThat(Matcher matcher, T actual) { throw new AssertionError(actual.toString() + matcher.toString());} + + public static Matcher isEmpty() { + return null; + } + + static class Matcher<T>{} + + class Foo {} + void testComment() { + Set foos = Collections.emptySet(); + assertThatComment(foos, hasSize(0)); + } + + Matcher> hasSize(int size) {return size == 0 ? null : null;} + void assertThatComment(T actual, Matcher matcher){ throw new AssertionError(actual.toString() + matcher.toString());} +} + +class IDEA66750 { + public void test() { + List> data = new ArrayList>(); + List> y = (List>)data; + System.out.println(y); + + ArrayList al = (ArrayList) new ArrayList(1); + System.out.println(al); + } +} + +class IDEA73377 { + public Iterator, ?>> iterator(Map map) { + //noinspection unchecked + return (Iterator, ?>>)map.entrySet().iterator(); + } } \ No newline at end of file From c7b47f11253a529c1576f34114145e1f8c0f1dea Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Thu, 29 Mar 2012 17:13:23 +0400 Subject: [PATCH 15/27] IDEA-81205 Indent on paste: Correct processing in case of 'indent block' 1. Corrected processing of the formatter-based 'adjust block on paste' when a pasted block starts with white space symbols; 2. Corresponding test has been added; --- .../BlockIndentOnPasteTest.groovy | 87 +++++++++++++------ .../editorActions/PasteHandler.java | 8 +- 2 files changed, 66 insertions(+), 29 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/editorActions/BlockIndentOnPasteTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/editorActions/BlockIndentOnPasteTest.groovy index 23e2dcadaf3f..2b537de76906 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/editorActions/BlockIndentOnPasteTest.groovy +++ b/java/java-tests/testSrc/com/intellij/codeInsight/editorActions/BlockIndentOnPasteTest.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -618,7 +618,7 @@ class Test { doTest(before, toPaste2, expected) } - def testPlainTextPaste() { + void testPlainTextPaste() { def before = '''\ line1 line2 @@ -628,7 +628,7 @@ class Test { def toPaste = '''\ line to paste #1 - line to paste #2 + line to paste #2\ ''' @@ -641,10 +641,33 @@ line to paste #1 doTest(before, toPaste, expected, StdFileTypes.PLAIN_TEXT) } - def testPlainTextPasteWithCompleteReplacement() { + void "test plain text when pasted string ends by line feed"() { + def before = '''\ + line1 + line2 + +''' + + def toPaste = + '''\ +line to paste #1 +line to paste #2 +''' + + def expected = '''\ + line1 + line2 + line to paste #1 + line to paste #2 + +''' + doTest(before, toPaste, expected, StdFileTypes.PLAIN_TEXT) + } + + void "test plain text when caret is after selection"() { def before = '''\ line1 - line2\ +\ ''' def toPaste = @@ -655,32 +678,14 @@ line to paste #2 def expected = '''\ + line1 line to paste #1 line to paste #2 ''' doTest(before, toPaste, expected, StdFileTypes.PLAIN_TEXT) } - def testPlainTextMultilinePasteWithCaretAfterSelection() { - def before = '''\ - line1\ -''' - - def toPaste = - '''\ -line to paste #1 -line to paste #2 -''' - - - def expected = '''\ -line to paste #1 -line to paste #2 -''' - doTest(before, toPaste, expected, StdFileTypes.PLAIN_TEXT) - } - - def testPlainTextThatStartsByLineFeed() { + void testPlainTextThatStartsByLineFeed() { def before = '''\ line 1 # item1 @@ -715,6 +720,37 @@ line 1 doTest(before, toPaste2, expected2, StdFileTypes.PLAIN_TEXT) } + void "test formatter-based paste that starts with white space"() { + def before = '''\ +class Test { + int i; + int j; + + void test() { + + } +} +''' + + def toPaste = '''\ + int i; + int j;\ +''' + + def expected = '''\ +class Test { + int i; + int j; + + void test() { + int i; + int j; + } +} +''' + doTest(before, toPaste, expected) + } + def doTest(String before, toPaste, expected, FileType fileType = StdFileTypes.JAVA) { myFixture.configureByText(fileType, before) @@ -732,6 +768,7 @@ line 1 finally { settings.REFORMAT_ON_PASTE = old } + myFixture.editor.selectionModel.removeSelection() myFixture.checkResult(expected) } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/PasteHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/PasteHandler.java index 4b65a2c9716c..d2a99b30e253 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/PasteHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/PasteHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -379,7 +379,7 @@ public class PasteHandler extends EditorActionHandler implements EditorTextInser // Algorithm: the main idea is to process the first line of the pasted block, adjust its indent if necessary, calculate indent // adjustment string and apply to each line of the pasted block starting from the second one. // - // We differentiate three possible states here: + // We differentiate the following possible states here: // --- pasted block doesn't start new line, i.e. there are non-white space symbols before it at the first line. // Example: // old content [pasted line 1 @@ -460,7 +460,7 @@ public class PasteHandler extends EditorActionHandler implements EditorTextInser final int i = CharArrayUtil.shiftBackward(chars, startOffset - 1, " \t"); - // Handle situation when pasted block doesn't start new line. + // Handle a situation when pasted block doesn't start a new line. if (chars.charAt(startOffset) != '\n' && i > 0 && chars.charAt(i) != '\n') { int firstNonWsOffset = CharArrayUtil.shiftForward(chars, firstLineStart, " \t"); if (firstNonWsOffset > firstLineStart) { @@ -550,7 +550,7 @@ public class PasteHandler extends EditorActionHandler implements EditorTextInser } } else { - CharSequence toInsert = chars.subSequence(anchorLineStart, j + diff); + CharSequence toInsert = chars.subSequence(anchorLineStart, diff + startOffset); for (int line = anchorLine + 1; line <= lastLine; line++) { document.insertString(document.getLineStartOffset(line), toInsert); } From 33b7b9d9b09f53f5bb85607bb16d2ef5a6843bc5 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 29 Mar 2012 15:34:43 +0200 Subject: [PATCH 16/27] add a small gap --- platform/icons/src/process/fs/step_1.png | Bin 1204 -> 1182 bytes platform/icons/src/process/fs/step_10.png | Bin 1202 -> 1188 bytes platform/icons/src/process/fs/step_11.png | Bin 1175 -> 1167 bytes platform/icons/src/process/fs/step_12.png | Bin 1188 -> 1165 bytes platform/icons/src/process/fs/step_13.png | Bin 1173 -> 1190 bytes platform/icons/src/process/fs/step_14.png | Bin 1195 -> 1188 bytes platform/icons/src/process/fs/step_15.png | Bin 1189 -> 1189 bytes platform/icons/src/process/fs/step_16.png | Bin 1194 -> 1163 bytes platform/icons/src/process/fs/step_17.png | Bin 1188 -> 1171 bytes platform/icons/src/process/fs/step_18.png | Bin 1189 -> 1183 bytes platform/icons/src/process/fs/step_2.png | Bin 1174 -> 1174 bytes platform/icons/src/process/fs/step_3.png | Bin 1187 -> 1170 bytes platform/icons/src/process/fs/step_4.png | Bin 1174 -> 1190 bytes platform/icons/src/process/fs/step_5.png | Bin 1190 -> 1188 bytes platform/icons/src/process/fs/step_6.png | Bin 1185 -> 1186 bytes platform/icons/src/process/fs/step_7.png | Bin 1184 -> 1160 bytes platform/icons/src/process/fs/step_8.png | Bin 1185 -> 1177 bytes platform/icons/src/process/fs/step_9.png | Bin 1194 -> 1183 bytes platform/icons/src/process/fs/step_mask.png | Bin 978 -> 997 bytes .../icons/src/process/fs/step_passive.png | Bin 1192 -> 1187 bytes 20 files changed, 0 insertions(+), 0 deletions(-) diff --git a/platform/icons/src/process/fs/step_1.png b/platform/icons/src/process/fs/step_1.png index a02f0d104b398b50d5f8dc52940ff7220f45417a..eb6c407124beac4edc399d9f81385a54bec4cf2b 100644 GIT binary patch delta 506 zcmdnOIgfLL8&iydg_E1Pv4xYlrMab{p{t>Vv7wWbqmi+Rv!RiTld+qULPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|8JFJ4ic03T_J=ap|3`$Lv)9 zkY6^8fq_xT)5S5Q;#Sh1|NrfoRU0N|u^AW{HD$)$=Fn7_%68lYXva|aW_WDcl>U!koEkfDd5d~^+Q5w1GB^WrckuFE4zOf1y{v{;1u-MtXKyy#Pbk|HfS|qH1k94JHEXS+#z-Dcp%; z+$dwl>>#yXn5%RF>;A?m3}(!BOse%lMhp^sZydV#XEVNUoV3QpWv`V$ags5ENJA1! z&U2<9Mu$H#vl+KHMzBeR-Y_XzsfD4dkqeM*;bvy(=&Ynrkz3&FYvq!k zT$-DjSK{ens{|C$OUX>Jg6eg~rFZfoCIgrSmbertDHN9krKVY>;I_aKm)^;G%ue;f z3^#ol7#KA?T^vIyZYBNs|KFZjwV|`o=>Su*fss*DX6$VaO@*mkNBA7ha39HasA28c z&+zf}>GtqHY%800&JjGvAjNQH4O_}NmPh9uY@|EpGk#Q7V9OL@O-fU!V=#Hb-o{u} zHZjQ|i%(!a!=sZ9uJb3(=aZuz%c)J7E|r+H~b7h;OXk;vd$@?2>|>RwzB{L diff --git a/platform/icons/src/process/fs/step_10.png b/platform/icons/src/process/fs/step_10.png index b6bfb992ece4a1610f1fcc17bf472efdde19caca..39aed3098195b47e575996efda71c2422c983375 100644 GIT binary patch delta 460 zcmdnQxrB3r8&kBgo3XKpqlK%vrMab{p{t>VnUSfJp{0qViK~U7n}M;CLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|4Ts*z3z-b%p=z9Qsrkqx3sd8QON}nGGeC;u5fChEBtG6qcKnh?cte+&rZt(oznDWQ-1Ve(w z24+pW9JW2|UYmpjzrJ!f(|ML5fT2rp!(46;R)&woIc#^>k|Z-i5-*?OT_UuQafh_B zY(tQe$wUu^kIWfU8jtiePEip!&TM#MLd=3Yv1>F1rT+Ub2;^cmZrmZ!v7V`r%ftBE h6pMtNf(i#1p6!emzRK@2$&vvGJYD@<);T3K0RReKpBw-H delta 474 zcmZ3&xruXw8&kBSsk5<(simR0g|nHVp{t>#fq}D&v6+*ZlcRx)o0GAULPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|2#4Ou3z-b%A!;n#aH;voBnwqzX@EYv|~$!HIB0`aau4f(Ud{Nz~JcZA>*)&NuYVr8&QGgM^VC3|5sj^GLx^TH##C%>55vwDq+SX wxr{mbZOhIuFSx>amdKI;Vst0QO6t&#L&dR(aqG{(%jO}(ACh<(7?sn(!$Zn)Ya9^+0aQzp(3}y*VoD= zKe;qFHLt|e#a0O@qL-4HVg=P}hD-0{MN9@T3yg6oQc@@`2}(_~O2KV`2`;^p^_ZRN zU$=kT&%nUQ?CIhdQgJKk&;S4S%&H9&v)BxbjG8iIZ*v$bOyxMT&OwJE^t)uoVtv`D ze?03M9nKm#q=^bNvwUaxm_0#6z&PG+&m)F_dCVu$7&q-d@b#cXRoTQp4qDP3@0mo` z9C@0uK=G5qE7c38_6{{_Dwe_u`+EJ2MfR{H)w4>l-((O}uyfM5&>+^3^XypK0rLe< zij|n>v(9E*@6lmvn8Wr*(M{bzK($ds+>Cjj)8bBn4UCV>Z}3zw9C@U`rjfNVaRKW? zhs;m~yJl_0j}3d6x{?!i6)6V=~kadBH63 rp6$_32gS4N6V@%sOH&eOV3A-@Vyk>zBQrmr0SG)@{an^LB{Ts5=OUw< delta 499 zcmeC@oX)wyjVZ>_$<@Tb!r0Q>!r9Ew(ACh<+}zaB#Ms%@*~G}j*~vsnp(3}y*VoD= zKe;qFHLt|e#a0O@qL-4HVg=Rfh)eI}MN9@T3(RpTQc@@`2}(_~O2KV`1ungl^_ZRN z11nX`85kJ3JzX3_DsCnH`TyUZS+$|F(dhtFvVoCNQ)cXK4o-!sY)ASW&Tvot$8+ST zL(Sh$4@LJoG8s%aJ|yYD+%PM(;SAe~)7O|ja<5?gmNtP34R{tFK?87HiW1N z*fTsj>)?9-!d&hx4qUHR{hrRJ`@dC=?U%zJmii9!gv&gv2I8Gb+%6MNx;M_Mf5c_5 z;Euh*SE-KHjglW^JM4udf5hD2`N72{td!g*J)OIQQQ_>I8$1>4N0bgsI5u-fL(v|{PMh51o^fRxyZNe(h>UJVX0%ssuwBZ8H# z%v|H(C9K(@zDV^cvx5!yil3I(me?fh6jV6C@OW*!yOl!U1O_1RboFyt=akR{0El<4 A;Q#;t diff --git a/platform/icons/src/process/fs/step_12.png b/platform/icons/src/process/fs/step_12.png index fe7462e4093ed267c5de79acf39c7633469b3008..31c891386732f3b3356f2add06527114e89d8973 100644 GIT binary patch delta 489 zcmZ3&*~_`XjVZ>&!qU>%$->0k(%jO}(AChw)X~Vzz{%Xg)X>$~$<$0qp(3}y*VoD= zKe;qFHLt|e#a0O@qL-4HVg=P}ic9b0MN9@T3yg3nQc@@`2}(_~O2KV`F)qE6^_ZRN zozL6kGcYhRdb&7dJM$nUPH zII3B)oaw2f-UHU1A}7)qcRk_X#ck5?!z$o&ePvD^Ygav6(ENolnF@6savggdYFZ~n zRPb(jYCiFo#74;vQ(3xqZam6l;VS4AQB^i^L4@E^6~&hdtZH41{tL}K7!CFLZl7(K zq9$;^ft_vF`tT8A?NR$p5tUD&eWfW8pAhI8@`~oF*&B#sCDKu6{1-oD!M<$i$(K delta 512 zcmeC>T*A4*jVZ>-#LU#u#l_s*!r9Ew(ACh<)WyQZ+{nbu)y&!1+0j%caYo^l_Nb6CT0B*)>8WCuUP z$2X_j!)=&XHotZ@V^|T%aiWJQiBG|f?MQsX4AzdNjTWLEGaD@=GEVUGFn@WYw6kG~ zw!nVoN5KxR_7~@JZ*k!F_{;F<_jEqp|GYxU^-hzfGe6>Y=xyJa$;PPmhxSA!PI(|S>Yb%k=YHi?kD@6VxA_=$i%~7ES2-$MDl$p0}yz+ L`njxgN@xNAvK^?| diff --git a/platform/icons/src/process/fs/step_13.png b/platform/icons/src/process/fs/step_13.png index 29ee724831885f5d2548df3ece16ab2b0687ec40..02210fd7087f7d84bc5ef5d774d0fae4ff407100 100644 GIT binary patch delta 514 zcmbQrxr}pz8&iylizn}v&og{85Dsj-E*iK&Z{LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|8JFJ4ic03T_J=ap|3`$Lv%e z;J&Msfq_xV)5S5Q;#Sh1|NrfoRU0N|u^AW{HD$)$=8#iJ4&k;56@Bhwoy z&OJS>J+JY~!LN$a3|G$Zr|e?*D6LS(btJwqf~TXk(L%VxwZTF*)JXDth0AtT^4(c!RNHvA%2+Um2(HBq`T=g?&xF#vBYs_cN@tQ;6d`GXJ5Ff_Q_$ z1vc3vCf-%kSeNnNWL@vcQ6ne8e6wM`io}7wvkm$?=JfO|bP$=%ILBfCQbt34FDFJf zeIvGGVj5BZ6O9>`7z%ZCF9_1@suTbK delta 497 zcmZ3+IhAvR8&iyvg|oT2nVYM*g|nHVp{t>VtE+{Zfsui+v9q(YiG`(-LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|4VT`@i5|o-|m4e#>7hHNL>oGgk zZ!$g6z`(%B>FMGaQgJKk&;S4S%&H9&v)BxbjG8iIZ*%A=q;ehQa?s&EV&hQ5(UBf+ zx95?hhir`eCPs&|3a!^1&Tt;t-tdE6pxA-;6hl&+f*-q75%*yR+ua^!3aJc7;v2Zu zEwmQRu<$4r6tHF}{Ib;f^g+Euryym|mJhm*CT2a=IajYc}Kk zh8uD#R><{BW?d-x$dv8HlEtPugY(FO3-kCwe+aJ%W0g94ykX-<)@-j9t6(mVrA!-n xuPiw3p#Ddo<9vfbz-RL{o|OlRlpPuv8Qy%&(zE*N_?!U#v#G1IsimWvlZCUZp|gRKLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|1ee~)i5|o-|m4e#>BV2kX>oGgk zOMK4R$-uxU;pyTSQgJKk&;S4S%&H9&v)BxbjG8iIZ*%x5Eag0M%0Y+eNRz`E)+7B5 z6_1}D){bksa`3C7G{coM+$mB_h8`D%75*_FVRF!6KQhr_4abqE4$gUr5)0DBPcm-( zX%ui!zGOKQ?{l`GNQXC^M+~R)>DIFer8@;F*Y|oGb1)p;&$RNT!yn0x%L$K8u>Co( zRPy8meTOVQf!l|VL`--RFC_Vaz2S$NnYe}{^TfsmZHKrW?PnWiI=pdMqJ3neWPw0O zaKpL>2bT+L@P9I6H)Bp?G(5pQ^Mc0VrIF$t^OJl#9ays*($od+vp;%z;mUVLsT)QC z%jdJVGG8;B!m*Wg$qD&czxFYHtX8OFK2qNJ!z$o&`5Mp414YUX4U7z%R}>aHo}3!U O00f?{elF{r5}E)X^0#XM delta 519 zcmZ3&xteo>8&iyvi-nPeshg|0g|nHVp{t>jqob3XiKCOLp^JsFlasTOLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|4VT`@i5|o-|m4e#>7hHNL>oGgk zANk7I!N9;M@9E+gQgJKk&;S4S%&H9&v)BxbjG8iIZ*!C>Eaf>W6rjU##J{oP=hMU5 z^BS)l{HiF;aODhVN*0r$bjV?Og*4WrOa(vYBvu7KcBvxn!wj~&JtnAyD*WR*;@{Bq zPr+I=!-9W;7F!a#Lf^iU49gp;J|0;v3(V~5-LCU6Ic(H-SjFFA&s?bGBXg4>PN9x7 z=}>9-r$+QoRp`;!_azBIfpHTVI!*`TLaT?eKTf0 z1$I6&h91r|1y!~q@f#!=xMboMEV5E~c5GoJTSsKW58i82I6{`NrTDQwvUac$@3`;8 zEVjhfgR7&S`6F*aPR;RILJQ3rMcN#K?^_34ar#&*z?Su|(^Qi`B9Dc`fZ^7=q901v ReK{C_z|+;wWt~$(69B8yr|19x diff --git a/platform/icons/src/process/fs/step_15.png b/platform/icons/src/process/fs/step_15.png index dd7c72f16c71bb04e31f95af91139d181ee5d5dd..96456a5122a643961a150baa431481a72cee392d 100644 GIT binary patch delta 513 zcmZ3=xs-E*8&iy_nVX}5sj;)UrMab{p{t>#g`u&Nn}va^k+HL@v$Ls^LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|1()8*i5|o-|m4e#>CtP|b>oGgk zE5A6-$iToT>FMGaQgQ3Z?E-k$K~ zcA?;&<981v?|;7kWX!>i`sb?IpA#ARUvmaOFxegDmwsqnybpUpt}utiqTlW9^AB|T zCTw=G$(gohCX;dOu9(MCitnzeU6{&n-Qrf6R!)|11>?%y)71~KT}o-c=BJ|J`-R2% z#es+}$4YVYBTpWlQ%L)h`POBxGpqX56^CTp0pExHX`se+B$CffMGsM0r|NCD3 R@?HiY@O1TaS?83{1OS$W#TWnp delta 513 zcmZ3=xs-E*8&iz4k&%(5k+F-pg|nHVp{t>#qmzk?rK6*nqqD2CiG{P0LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|6_?)0i5|o-|m4e#>XIy$G>oGgk z`)=GN$-uxU>FMGaQgJKk&;S4S%&H9&v)BxbjG8iIZ*!O_s4^aTb%m4jaur5UcAVNB6tG87ir&-7@&!x^3&Zs_>#1kV66Wb(`e?6E*SAiRr6K8l;}s@_ ze~d>~8Wg55i!}T&4R~lD!^k$}H`kIh=8eo|%xaE*JveNd*|gdiQy5d2?U*-;2v)sg zD3mi}=3^*SGT5?{Q-Xo(4f_oq239@|t;HK&GD!j5bt%Ah{l;Z33z!0|PBh-yz}#_v z;Z2^PKjsV)()JscxvcPYayZ2_tHrVNm9WVEMzsy`5tBbPJaubeU}h+pm8UY}MzcEu O5O})!xvX|*}%=v#mv#%(%jO}(ACh<*wxL^z|F|a#L>yf*~nQ*p(3}y*VoD= zKe;qFHLt|e#a0O@qL-4HVg=RfgiG(_MN9@T3oLLcQc@@`2}(_~O2KUb&}rBmH(8I_ zseVW6$20~8hX0-}jv*DdlK%YvZ_ljSF!2@Ji<_=R44Rn=&zK(7JDlM@lH~A5tV2K6 zZqFlQ4_P01Gv*_WU2#g?FK@XOFl%ZngfTzb>hM$Cf;S;0<;csJ1&(zNr+7NlW30CP z;q~ZYJ^74HV>4r{@+8&S4X<<>N-PBYSvd_9SJrQ4f3(@9<+h$eS$p9GUIx}{>`FX8 zSdToq!SjRrXbXd}NU{V2SEZQ}j{w7?^EY^Ia30BXkx1Ytzp00i_>zopr0GjrtmH+?% delta 518 zcmeC?T*bM;jVZ?2+{n<))y>7+!r9Ew(ACh=$;i>k(bd)2z}(f@(!@zgp(3}y*VoD= zKe;qFHLt|e#a0O@qL-4HVg=Rfic9b0MN9@T3!HE%Qc@@`2}(_~O2KV`GcLW8^_ZRN z>m!sJ85kJlJY5_^DsCnH`TyUZS+!we7Mp>QQB!8@ZH_PnRjwmU4rdsTDs0qusQLWq zp{T+v#&!HR85X2XNU~h;3Vz6MoWVbv@xcLAQ>lr(70kU>P7Yih_Q}Qx(gM35 zT;}ZIoKO|5VApWAVX4C(;T0!jrBZJ+un3%Ie8d?MtQ4?VV!}(#BMU6{F&wdPkPy*c zkfO!3)JC2$`7!&oDIBG0<`aTglkzgW{s0x3d=N}A2>6`8#zmvv4FO#rFVusr|( diff --git a/platform/icons/src/process/fs/step_17.png b/platform/icons/src/process/fs/step_17.png index 3184821bf5dcf9f4adec16860f69daf8b1321eba..bf4f3b9ec5b84ef0086725142c620f0546162bd9 100644 GIT binary patch delta 495 zcmZ3&Ihk{V8&iy#p^>GrtFxs!5E>e~8d^9yTDY2;S{gbV8yOjzIVves7BfY$pB`7IW9#?3dJQsscBXzxGk{2rFXI(vr~O$ zz`cD842KT1m_>8lwsUGM=U7tG@Pi}ZpRJF)@FXTp1ykXU-i?-`D_+`7*u`~Z zpTpJ~gF-bG(@cjyf*sX`KgBan*schFvq7>xf%C}ahAul{j_uYCIc;Yf!{KAY!tU-|uH8Qgq+Z$$Z zukhgPe|yy74F8eM20RRH|I`&&y&P^;l}+rj;IZI7^3q}J`2w}n1>8FtrWlT49_C7e%`awkY@k_Pgg&ebxsLQ0H0E-V*mgE delta 512 zcmbQtxrB3r8&iz4lcTetp`)|8g|nHVp{t>#v$>h0xq+h*5EvL)7%3@K7BfY$pB`7BQ8Zs3dJQsscBXzxGiwPrFXI(vs1l< z_*F9o21W@_7srr_TSsWZRl)tI>3}{U}V&k8GD-}OhJ|F$ew`8v=x)|9sa!e z^ib5^L1xBj$%i}(7#+@LIV{r^kY{;h?(j!kh4n~|!x|RTFFY3}^c&O`h%=aaGp?NJ zP{Yvio>BC#bMag01yaHaZ<&{vGr#nIkvO5A>&X1Z9sJ#C5<6Iq%yD?rqbnfWP$3rZ zIX#AvZOU)fC3+55lO!0p)`YvT{4rMuJC=69SmB>*3*!O?(Zgv6Y?T(riFNExGJc?; zVbo!uASx9s!6w7>==}i=qa(|>HO{dd`FdfCf%H6vi$X&36EYb}A2BQZ>rI)+A#j`d zV`4&%*_}hPgch1@WY!E=^r$V1ZE2_dg(ZKaR{S)-w!|i3r=Y?ChSFVdQ&MBb@0712|FaQ7m diff --git a/platform/icons/src/process/fs/step_18.png b/platform/icons/src/process/fs/step_18.png index ba0cb9b6147f9ae47a4cd9f3c04383b2f6553166..233501cadb812a8f088d61542d8f933ad438cb45 100644 GIT binary patch delta 507 zcmZ3=IiGWb8&iy#nW34flck}#rMab{p{t>#xuLV8k(;HXv!SVrxrM2cLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|2$$Z;iCgZF_ROjc6SLS1jEtHxV{db4DokZNa=PJ%oWN)1jSK>t z89)9#-5&mjVP*4cXETNsk-R77a2|j-&$>a5mAA=R%9bG2L;$X(SvOHkA!2)T9 zqJKII7U{DbdaEdqoovjo%yN9WK%!%5V};r zofuFw^o$|n5|PFq;sW&ykNO?fup9}zkWtrWs>vUb$HHO2;L%_3_gBrYECwL(boFyt I=akR{0NjrKyRfvyr8#sfDAZiGiV#LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|7?5|o-|m4e#>LtJ_%>oGgk zE18P5GcYhpdb&7CX>c@d~8|(--exSP{wVq05?-ykc2^R!^wtU!QQ9hsj~%eur0f0-KpPnr(9kVSIG* zhKaJ|C-zsWvN>!u43E@ZSZp)|Qa4I|kkRtwXxO9Be73>e;fz}gW08YS&)J68C;Sex zH5eY`Uh>J|VB_hA`3|mL7c>sDbuDjg}I@HtC5SDrG$_i>(q+L@y;X#R{s|442-?i5|o-|m4e#>6I^;H>oGgA z?77tVVsZ(yLcO8FRE{I-9CR3_{^L1vaXO!FecNS*6={+Rp{z#~>U~)sU02xLI74zt z?Ic{RTKy}g$o*&LVehCU* zOqzN*Y&EQ2MFNR!yaM|VrX65b5K~X6wwMsa`pEdhidJc-0_{Z%V zvdG~LlW$0_!%uaC+7B06xM~_zwAeHiLivyE33$oxut&P%IkV|v7PH3<&)pgrm>E8b WN6unv?Rmri1fH&bE-dSu5}E+fk)P!N delta 471 zcmbQnIgN9J8&izArIVwxg^8)Tg|nHVp{pT~W9e+->}=>}WN74UJg6cKHrFZfoCIgrS#<&zIDHN9krKVY>;I_a7m)^;G%uXz~ z8Q1$wE@4)v_f(k5c7)I24ENN3JV$;y)cpPQP;|c|lfiW3Ly`{64YN`k&xi?#cZ4&3 zEMCF*$Kemht4Hn*&UFbA3)00ogQhSa`QFGiEwNbd0+Z&7)$ii1w)_#Vl6b-VFnhjr{pfjNyQ*pIX~Zu@^^skFv-eviG3Ns2jaHSCYpyVSGUshcr7%=#~|Q1S_D z9#B;IQdwP$UIjOoOoGQ_pBM+rGKExLUvUYxJ#CkSEKG_SS28F}V|>*8fu&>G1d9eA zOND>zOYM~;rFca18IBzjUZW|PC9FN+63e5`49`k?f%8mRb&aN){1JI990m*(&T;1# T1Z>>P00f?{el9HQoD!Mzv6-`*v8kb>tAUfTiGj0{LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|9GBk7i5|o-|m4e#>Q(Sr{>oGfV zXy|{Q$H2hIHo1aXzMl2SHwPW&BTNo|ggf||KCba@pJsnJiy>q)$Am7%q%?(j>__Sw zXNY#RHdx4Zq%&>Q4`XhawX<=Gw17PGts<_wE33*TDu{n*is1@5%@p#P{VuDNLyfFP zq1^2F#z*rTucW&j6IEDeB4F>r?-Hl5&&g9~&%T<9qxlnrKPE=ZNUkw{pv@^(oNU~% zLWGsaAz)2M(4+|^4vn2>8zmvv4FO#uINoC5#= delta 485 zcmbQlxtMc<8&izAn}wy5o2jX}g|nHVp{t>#k&%(Jp_{pZv#YDKxr?KcLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|442-?i5|o-|m4e#>6I^;H>oGfV zyz)#hW?*0xpIpH#U(bHzox>W2BRLL#Bs=&SKE65K9&W?DvU%qm!E+2!3|DkmQrwsg z*#+d8AK5#c;X0z=9NaiVvZJ}N?au)Nhx2-qxIK0E@ukg>ch4KFa z#_q%e@)~MtuOc@{e&CK|;!kkC)}C`9{mFrY%qERLw9S|u8V_^yYO(1Ap5QyO&0!gX zfPIs?!=aZuz|g)qg;Pz5FW!~`2s~Z=T-G@yGywoMI;h(K diff --git a/platform/icons/src/process/fs/step_4.png b/platform/icons/src/process/fs/step_4.png index a237bd9c4a91093f2c0ce435a3fb1eb50a817388..c7b463f0662e854542db4ddee5251cd361153427 100644 GIT binary patch delta 491 zcmbQnxr}pz8&iy-qluf5v5T9zrMab{p{t>Vqnm-Fsk4Ejp{uE-n~R~6LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{U=)c}{?$%~i_U>3OGQlz9%ToRO;W|e}|0vA_YdME2K zJ8@)GvRr3iV3e9%!7NiRr;y5bgv~*R^T;BHGrUKpH&mQ^dRTj2XjYh$b`n>feelu(C0v*;eTa;+<=M;+cU z9Jx51Pq)5Jj;+g~hIMwD07F+jV^FQb9+?jN!>SH?42cVPtqjbJj|_KqL2Up delta 475 zcmZ3+IgN9J8&iyhiJPgTvx&30g|nHVp{t>zfswhZtBbL#nW2e+g|VBGLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|1()8*i5|o-|m4e#>CtP|b>oGfV zEDTOcVPIh7nq0vwQ?I9x%5?OTgAVtRJq|T29qI9Qdmc%8$ewxHQ^0nCVL_Ul!ey=w z%Z49(S8~b}rZGJ7S>gE7!8tEcVnMq2Nwy_C4L`U84w~kiV~q;nUn0|B@$1sUr{^ym zW=J{BuduK6^nQnC>BcLL3eOISbtpWyXVm)TtZ+w7;k9#rtGx@$pZNMG2i(mYCUP)K z6fSMHU*cxFi}8QM4grZvdv=sCJ$0Cs>R{M#Nl@brzE@X{2Q>RN8w7kdU*lPMph(%F bfsrBRX!Na__m(v=0D-5gp9{-6r-UW|=8>s! diff --git a/platform/icons/src/process/fs/step_5.png b/platform/icons/src/process/fs/step_5.png index a9793e2aa4fc7e5204ceb1ad1eaaae00452c87e5..a58da6614372f21a58c84b3a22e214f92ae9b2cc 100644 GIT binary patch delta 512 zcmZ3+xrB3r8&iy-tBa+ni=~^nrMab{p{t>Vi;1zLk*R^Hftj0$i=mm4LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{U=(Eyj;$%~i_U>3OGQlz9%ToRO;W|e}|0!vq1dME2K zJJs9FG2G0+z$oGA;uunKE9uYw|MtwP4V{fn2bhu#jEtHxV{dc#DJ_x6=}42q z8P+5H4Hb`{9@dU)x^gh)97j3>FGJQdRwLd6kX*O2ZjHg?;=-PA^>fp4ntW z>HU&)!E&{?zc)t$~4=f&W29{nJUE Q4Gciw>FVdQ&MBb@07pZ(BLDyZ delta 514 zcmZ3&xr}pz8&iyhlZl0?siTv*g|nHVp{t>VnUkrTsjI8Axr?QnrI~?}LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|8JFJ4i5|o-|m4e#>M_hU*>oGgk z2mDSEWnf^G@^oiobmU0|@6rjU$#J{oP?9;>A z^BS)l{HiF;aODhVN*05mwm`E;lTRvhQlf$%Tau{4ITooR?!yeWyFJWSG_7~|!?NOq z{-)r@wqoX$NeX2wk6w7UPiu}n)Uw2lrQ?4>{be2|hmGqU?y#iPu{{czVX=wP#^Ddw z>@*Vt=?>Wqk_UK>?C;?CA?$Fc@hpR-!ZWo)3;`0hhteEa1)>EK88kNhPc(kOpi$7U z@NBoYdO)A#EIqqqV+Iimg|n^>tu_%Rn;A4C71%E3Z&>ECK*?00SWUp5;Zfv;E8nG8 zc}hv0u(;l6_*FLBtL2so>k_4fQumlYa%=44KICxLexuq`#?!qFjBE_P-33hhBpu%} O0D-5gpUXO@geCx*w675W diff --git a/platform/icons/src/process/fs/step_6.png b/platform/icons/src/process/fs/step_6.png index 3c7b285e2e5b54847ce0ed4eee0287ceb6dd39f7..3838816d288f927052a6022b01aa4e448b103d32 100644 GIT binary patch delta 510 zcmZ3;xrlRv8&iytnTffHk+G|}rMab{p{t>Vi;0DWfwPODp{a?BnSr5_LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|4VT`@i5|o-|m4e#>7hHNL>oGgk zYd*X)kAZzKS zcz@n)ZjGB8FU|KUh5Lh^e1@`?zvZB`wP_%FwFH%oHR#l@fijn N@O1TaS?83{1ONt>zRLgr delta 509 zcmZ3)xsY>%8&iy>fuWO|nW?k6g|nHVp{t>VnT4~PldGGtiK(-ti?gwkLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|1()8*i5|o-|m4e#>CtP|b>oGgk z%jEr9#=yWR>gnPbQgJKk&;S4S%&HBYjZO!ck`0WEnlfW=bC@ZpG9FQKIKzI_#^DcR zhkuOSo=37CvS*(56tG=jSdhl25X^Xl_0e??F;2#f>>+tv7ba9ou)VnHx`|2CRpB4k z5&ed)e~YZeGaR)hd}4m|#k+l)z4J#VfexmR_4W&nEw9+Kho{4~Q6eQkxk^E6fu%Gv z126l|JUapFgzi>Phc!+v2b$-c^WK`_V)npTz*}(Pb3K9QiN+5YGzuCN&-Qw&2lR1D z-QeFKX&~L<_)>v!#RTE*v@``(&a2G)IbT|q@T5$0n7fm;<35w2hHZmMcjF?-j`z&T zkJ+zHG3MCHIptMOV}yW|-U5|BoE`B_!Z-BScvc=LQg&!yWbm30SCyUcWg`O+c)I$z JtaD0e0swf;tz!TH diff --git a/platform/icons/src/process/fs/step_7.png b/platform/icons/src/process/fs/step_7.png index 103ba21a4677fef9e7fa4836d6b3521061c164f1..aeef1d044d401dd5b554f10818f865102c5039f2 100644 GIT binary patch delta 484 zcmZ3$*}=KNjVZ>+$=Jl$+|AV7(%jO}(ACh<#m&Xi$;r&k(7+ieV63E2kz3&FYvq!k zT$-DjSK{ens{|C$OUX>Jg6cKHrFZfoCIgrS#<&zIDHN9krKVY>;I_a7m)^;G%ueshFfjb_ba4!+xRvzh|9^XC)rQVSrvpuT3)00;GA>!tID@<6Kck_(KsV#ZXoY9Ls0ZE}L&V&6?s9Lzn9KNM`PB`oCaVH8vdWjL~Y!NOkA z1;_b>gG3r1m2wH3W_o;EbXLWM%Z(PhB<`?oU||Vi>Eg9j5Mz539`L_O=NH=%|3=Oi j>|xAoQaa{LED{VQEitiNUp_7ah6IDBtDnm{r-UW|ophv= delta 508 zcmeC+T)?@(jVZ>`)WE>l(!|l+!r9Ew(ACh%%*Djn$lS!z&D7M_^_ZRN znP&I>W?*0x@pN$vskoK&=l_3uX4QtyMyCTz$p%J7O_{N`Il>fFxsLpCIKy`2jRTL+ zZ>}TT_2uIj7fB}QrMDP2urZhxGt4Yfs8pz9Uh24xrBm90_a2|g6VW!tsKAuMxzk>eUR?p%h93q2 z7wwrIZe#D*yFu~*_mT4*96$ISbeud*j2?Nh&u@sB!NI(w;fJvqa~Z=%b%QOIg)do7 zHD0;R^pP=#?F{>)c!xJky+%0>OdZb|3Z?JZXK->ZIl$i$&-5{JMeu*eU?rUga*WBZ z*so3DFe+8!pAf{JB=A?dqu#+#<4ZiV>HlN1rm*XnGqFf89N|wCzV##g5Caf+y85}S Ib4q9e0LnqCcK`qY diff --git a/platform/icons/src/process/fs/step_8.png b/platform/icons/src/process/fs/step_8.png index 03898c63b27a4077d435c506a5d7befbd025da85..06d4602e9071e194a57c1d898dcad989de2b353e 100644 GIT binary patch delta 501 zcmZ3;Ig@jP8&iz2fvJ(Do3VkprMab{p{t>jv!kn}v4xR^lYybRvx|X}LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|5SQM`i*n{@MD><2)IrsbDJH(Yw*| z>!pQHzc*e9Rrtob>gi!IwoHdVf*sX`KgBaX+pee&f3ra{f%C}ahAz9qds_MyKHw9W zooM`kUBF&Z>A`-cjV5Ny_ZU9rEAcQK?cy+Fp2uWpF35I*!I0gI*^hA}m)+b07oM{Q zMLN{T%w}wFn8CfmgR@`qsKXilBbyC)7~1}+D{PhQ*xJ~p@yOtTj=*x}t9H%H6P`@r zC{+`m5X81qo2}!%6Z1Fz4&Ez2n3oAEYw}0rv2YkLe8>%x7xNNxWB>wBS3j3^P6%8&iy>rL&8rg^7{5g|nHVp{t>zo1vkTtGSV-rKN$3o0FxILPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|7?5|o-|m4e#>LtJ_%>oGgk zZ&`ELgMooj)YHW=q~cc6pa1{unN=G)8=Vd?B^wwSHD$)$<_J?za8y}K%U~ZUowZSJ^!H(lde!~y>5aSa8tP0QA9&tN3+a3IJFqYwp4(pOM zrjLvY``AOi@Sok9-OBNjY!vKHGhpbN&mJ_#A*WqeK(?X6 zOz>fuWXIZ#k_?~jCo3_>bIxX5-|$0RaMsO+2(H{be zW7Sx+$3csCmDu5iy$*k5JH8fVu&vZ(N{V}Oz|G&|kHa!flfL(khgp_1NOrh3+>qz Jmvv4FO#o6jvKjyY diff --git a/platform/icons/src/process/fs/step_9.png b/platform/icons/src/process/fs/step_9.png index 10c777aca3c0e9d6ac6b3c2ac4096f67bd506101..c4a3766def38a4ac562079d1e784a9e2d036f7e7 100644 GIT binary patch delta 481 zcmZ3*IiGWb8&iz2qq(7liKCIZrMab{p{t>#v4y#dn~9~lfvc0Do0*}KLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|7?5|o-|m4e#>LtJ_%>oGfV z*iG4ant_2)cya}^d_CKd(+xl51U@rwWDwZQ`0?-Q_V7OpE1P%D5j@8r#c*W}Tgo|> zNBRzT7(!~q(ij8!#62V#KDsXWp+3V-O@%cm;4FKC1y`go2gA?#j4Z3<|RwuUN0}HsE2ftQQNoD9-fon?T3bjgkzPDyDZd)N|J#5xT)s!F;r( zfkPx&;saAhYo~#OWJl!&$pX=irypOkwAt~S^xip?c7Rnuj7jU!;f0b@__`V+q&mb8 z3M)i8F=bw3mu!=n>QI;*aHz@3R#u~&JKL*8>ls5(m%|_K4ts`=?h0W{s(KkF_J?Op hVb?KdVv%6jc_wA63iDhO1_mw$22WQ%mvv4FO#rf*ogDxG delta 492 zcmbQwxr%dx8&iyViKU~9g_EVJiGibqi;J<6LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|5trV{i5|o-|m4e#>3tW09>oGfV zycPJckb!|wZgK^)d_C8Z;|)JF1&oMQ(XI4&*A#g`1m`fuWJJg{!5Rv89EQLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|0+-&&i5|o-|m4e#>GhBKn>oGf( ziuKpeV_;y2^mK6yskn7!@J1rF!vFaP)du_~Ro$x*N}WJW$8>y*i>o^H6cWV>^a z+k+p8t`6HY&q#iLm7unFWkbyW@Sq>T4CaS=7{Yh7awkv9a8)?Gt!)2-<(egoYzz-3 W^Q)foEZz&Wgu&C*&t;ucLK6U3jc8r~ delta 300 zcmaFLeu;g98&iy{fw_sHtCOR-g|nHVp{t>ziK(fZiHoy^xrLdbk%g&}LPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|376ic03T_K5ap|3`$Ly38 zYA$t?fq}uz)5S5Q;#Sh1|NrfoRU0OXu?ZMW6r9g^#Hw9zHsk+~H(R{rrZe_fh*)L+lt8W@-vel$8ie3|Bu4K$I#)78&qol`;+0HMBG A*#H0l diff --git a/platform/icons/src/process/fs/step_passive.png b/platform/icons/src/process/fs/step_passive.png index e1d490fdbbeb99dce18e414c703fba0934da7dea..70d281bbc1b6f7b23a381b294db54f66b661f561 100644 GIT binary patch delta 485 zcmZ3%xtMc<8&kA}v7>>jrMa28rMab{p{t>zqp_KziG{P9n}LCWxwDCqLPc(YudkI$ zesXDUYF>$_i>(q+L@y;X#R{s|9EaY?3z-b%p=wNUsrkqx3sYl?ON}nGbA5F5>zND; zjN+ayjv*DdlK%YvZ_ljS(Ans8fGOF)$fzk(U0q#K;VI)0D~B^X^Y8C-TCqc7!Y_s= z|Cv4}>bVy(2250$z?2!l@`%^LM%43{t^hal)dGdri7hjqym@nmf61iAAAADunQnby zzPr=m>=_3y$qxB9cXxjm-^Jb2@I$m-;Qf(hk}M66>KE!wJS5g}$f1U3#S8Vug5MlR z7Tw@s$gJ_vxY8*0hcW2R4W1udQ~vm#U`Vjoz@({{!&bxSwMjtm>m`RXZD$z*7(NMa zm@DfM$?(xShs}mLNiZWM@iI?Wy|@CK>I!a&mkd*c7Iv{Xu4{CY^zdQTdd71^;pa>T z)1A*Ff|X4E-FI3n!nUc=LZCyQ@uSLwv^AQA2a1#(8Wjsj-ujvAL$_i>(q+L@y;X#R{s|2#4Ou3z-b%A!>}>aH;voBnwqzVt`AHF0*sJ%PhI+ z3=E7io-U3d6}OH|-ks&-DA2Z9{n1|`(;E`<2hW|;QcIfXE~ry8-NsdGBUfCLenN7p z<_r&g1zhyxljM*+n*eFg!hPW_|n3{~Fgz_5C7WeP4FppY%OCohx8Ydi3>^=MCD+>nAJ{u`qB>`Ru-+D12%QThBt@OQ&)~3o{M5 z11nyCxBBfTqr99YI73$a^rJIZWj)V+eRxM?M-yXb_WH(;x!w^Dx70qc&aY$R_ndt| zsIG=1#_5pvf%9F?XVg9@7AM^53s=4G)Uv7a=Eepd&1~U^IzAN*(h^Z~J%T3W`t>YZ zu4|Pa+t6%%bY}maW2>)r{#w>BugInR#+7q2oz|N3qSyY(uYc^ Date: Thu, 29 Mar 2012 15:57:38 +0200 Subject: [PATCH 17/27] fix test data --- .../fieldProperties/nonIncremental1/.idea/misc.xml | 2 +- .../src/org/jetbrains/jps/incremental/BuilderRegistry.java | 4 ++-- .../src/org/jetbrains/jps/incremental/java/JavaBuilder.java | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/java/java-tests/testData/compileServer/incremental/fieldProperties/nonIncremental1/.idea/misc.xml b/java/java-tests/testData/compileServer/incremental/fieldProperties/nonIncremental1/.idea/misc.xml index 8a6459d2c612..83d038f968a4 100644 --- a/java/java-tests/testData/compileServer/incremental/fieldProperties/nonIncremental1/.idea/misc.xml +++ b/java/java-tests/testData/compileServer/incremental/fieldProperties/nonIncremental1/.idea/misc.xml @@ -3,7 +3,7 @@ - + diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/BuilderRegistry.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/BuilderRegistry.java index 62b2c1fd2cb4..dbe6eecef318 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/BuilderRegistry.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/BuilderRegistry.java @@ -30,7 +30,7 @@ public class BuilderRegistry { myTasksExecutor = Executors.newFixedThreadPool(runtime.availableProcessors()); runtime.addShutdownHook(new Thread() { public void run() { - myTasksExecutor.shutdownNow(); + myTasksExecutor.shutdown(); } }); @@ -70,7 +70,7 @@ public class BuilderRegistry { } public void shutdown() { - myTasksExecutor.shutdownNow(); + myTasksExecutor.shutdown(); } } diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java index 58db508502ac..0e5360167d20 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java @@ -868,7 +868,8 @@ public class JavaBuilder extends ModuleLevelBuilder { myContext.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.ERROR, "OutOfMemoryError: insufficient memory")); } else { - myContext.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.INFO, line)); + final BuildMessage.Kind kind = line.toLowerCase(Locale.US).contains("error")? BuildMessage.Kind.ERROR : BuildMessage.Kind.INFO; + myContext.processMessage(new CompilerMessage(BUILDER_NAME, kind, line)); } } } From 9318fd9da41eb474732be48b24bd45a0d5684325 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Thu, 29 Mar 2012 18:10:48 +0400 Subject: [PATCH 18/27] fixed PY-6147 Not able to create new project because of missing Python Interpreters control --- .../src/com/intellij/platform/NewDirectoryProjectDialog.form | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/platform/NewDirectoryProjectDialog.form b/platform/platform-impl/src/com/intellij/platform/NewDirectoryProjectDialog.form index d7c77b76f80f..4b1d4deab6d2 100644 --- a/platform/platform-impl/src/com/intellij/platform/NewDirectoryProjectDialog.form +++ b/platform/platform-impl/src/com/intellij/platform/NewDirectoryProjectDialog.form @@ -69,7 +69,7 @@ - + From 1c494ad50cb4e815de1a80306f850f74966191d2 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 29 Mar 2012 16:10:50 +0200 Subject: [PATCH 19/27] correct speed search comparator --- .../platform-impl/src/com/intellij/ide/actions/Switcher.java | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java index 158d0ecf6061..697399225e26 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java @@ -763,6 +763,7 @@ public class Switcher extends AnAction implements DumbAware { public SwitcherSpeedSearch() { super(SwitcherPanel.this); addChangeListener(this); + setComparator(new SpeedSearchComparator(false, true)); } @Override From 684f8982a3a6edb5d8c7b50c946aa8b0cd943e10 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 29 Mar 2012 16:17:54 +0200 Subject: [PATCH 20/27] prefer current library when navigating from its source --- .../psi/resolve/ResolveInLibrariesTest.groovy | 54 +++++++++++++++++++ .../scopes/LibraryRuntimeClasspathScope.java | 13 +++-- .../file/impl/ResolveScopeManagerImpl.java | 27 +++++++++- .../intellij/testFramework/PsiTestUtil.java | 27 ++++++++-- .../EclipseLibrariesModificationsTest.java | 19 ++----- 5 files changed, 114 insertions(+), 26 deletions(-) create mode 100644 java/java-tests/testSrc/com/intellij/psi/resolve/ResolveInLibrariesTest.groovy diff --git a/java/java-tests/testSrc/com/intellij/psi/resolve/ResolveInLibrariesTest.groovy b/java/java-tests/testSrc/com/intellij/psi/resolve/ResolveInLibrariesTest.groovy new file mode 100644 index 000000000000..ceb2bbd93df6 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/psi/resolve/ResolveInLibrariesTest.groovy @@ -0,0 +1,54 @@ +/* + * Copyright 2000-2012 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.psi.resolve + +import com.intellij.openapi.application.ex.PathManagerEx +import com.intellij.openapi.vfs.LocalFileSystem +import com.intellij.psi.JavaPsiFacade +import com.intellij.psi.search.GlobalSearchScope +import com.intellij.testFramework.PsiTestUtil +import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase + +/** + * @author peter + */ +class ResolveInLibrariesTest extends JavaCodeInsightFixtureTestCase { + + public void "test prefer current library when navigation from its source"() { + def lib = LocalFileSystem.getInstance().refreshAndFindFileByPath(PathManagerEx.getTestDataPath() + "/../../../lib") + def nanoJar = lib.children.find { it.name.startsWith("nanoxml") } + def nanoSrc = lib.findChild("src").children.find { it.name.startsWith("nanoxml") } + + def jarCopy = myFixture.copyFileToProject(nanoJar.path, 'lib/nanoJar.jar') + def srcCopy = myFixture.copyFileToProject(nanoSrc.path, 'lib/nanoSrc.zip') + + PsiTestUtil.addLibrary(myModule, 'nano1', lib.path, ["/$nanoJar.name!/"] as String[], ["/src/$nanoSrc.name!/"] as String[]) + PsiTestUtil.addLibrary(myModule, 'nano2', jarCopy.parent.path, ["/$jarCopy.name!/"] as String[], ["/$srcCopy.name!/"] as String[]) + + def parsers = JavaPsiFacade.getInstance(project).findClasses('net.n3.nanoxml.IXMLParser', GlobalSearchScope.allScope(project)) + assert parsers.size() == 2 + + def file0 = parsers[0].navigationElement.containingFile + assert file0.virtualFile.path.startsWith(nanoSrc.path) + assert file0.findReferenceAt(file0.text.indexOf('IXMLReader reader')).resolve().navigationElement.containingFile.virtualFile.path.startsWith(nanoSrc.path) + + def file1 = parsers[1].navigationElement.containingFile + assert file1.virtualFile.path.startsWith(srcCopy.path) + assert file1.findReferenceAt(file1.text.indexOf('IXMLReader reader')).resolve().navigationElement.containingFile.virtualFile.path.startsWith(srcCopy.path) + + } + +} diff --git a/platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/LibraryRuntimeClasspathScope.java b/platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/LibraryRuntimeClasspathScope.java index dbbbacc90f1d..90ad86b3980b 100644 --- a/platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/LibraryRuntimeClasspathScope.java +++ b/platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/LibraryRuntimeClasspathScope.java @@ -29,6 +29,7 @@ import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -39,11 +40,9 @@ import java.util.Set; public class LibraryRuntimeClasspathScope extends GlobalSearchScope { private final ProjectFileIndex myIndex; private final LinkedHashSet myEntries = new LinkedHashSet(); - private final List myModules; public LibraryRuntimeClasspathScope(final Project project, final List modules) { super(project); - myModules = modules; myIndex = ProjectRootManager.getInstance(project).getFileIndex(); final Set processedSdk = new THashSet(); final Set processedLibraries = new THashSet(); @@ -63,8 +62,14 @@ public class LibraryRuntimeClasspathScope extends GlobalSearchScope { } } + public LibraryRuntimeClasspathScope(Project project, LibraryOrderEntry entry) { + super(project); + myIndex = ProjectRootManager.getInstance(project).getFileIndex(); + Collections.addAll(myEntries, entry.getRootFiles(OrderRootType.CLASSES)); + } + public int hashCode() { - return myModules.hashCode(); + return myEntries.hashCode(); } public boolean equals(Object object) { @@ -72,7 +77,7 @@ public class LibraryRuntimeClasspathScope extends GlobalSearchScope { if (object == null || object.getClass() != LibraryRuntimeClasspathScope.class) return false; final LibraryRuntimeClasspathScope that = (LibraryRuntimeClasspathScope)object; - return that.myModules.equals(myModules); + return that.myEntries.equals(myEntries); } private void buildEntries(@NotNull final Module module, diff --git a/platform/lang-impl/src/com/intellij/psi/impl/file/impl/ResolveScopeManagerImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/file/impl/ResolveScopeManagerImpl.java index d00bba8e12d7..a7c4277861f2 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/file/impl/ResolveScopeManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/file/impl/ResolveScopeManagerImpl.java @@ -16,6 +16,7 @@ package com.intellij.psi.impl.file.impl; import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.impl.scopes.LibraryRuntimeClasspathScope; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.*; @@ -25,6 +26,7 @@ import com.intellij.psi.*; import com.intellij.psi.impl.PsiManagerImpl; import com.intellij.psi.impl.ResolveScopeManager; import com.intellij.psi.impl.source.resolve.FileContextUtil; +import com.intellij.psi.search.DelegatingGlobalSearchScope; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.search.SearchScope; import com.intellij.util.containers.ConcurrentFactoryMap; @@ -91,6 +93,7 @@ public class ResolveScopeManagerImpl extends ResolveScopeManager { List modulesLibraryUsedIn = new ArrayList(); List orderEntries = projectFileIndex.getOrderEntriesForFile(vFile); + LibraryOrderEntry lib = null; for (OrderEntry entry : orderEntries) { ProgressManager.checkCanceled(); @@ -98,12 +101,32 @@ public class ResolveScopeManagerImpl extends ResolveScopeManager { return ((ProjectRootManagerEx)myProjectRootManager).getScopeForJdk((JdkOrderEntry)entry); } - if (entry instanceof LibraryOrderEntry || entry instanceof ModuleOrderEntry) { + if (entry instanceof LibraryOrderEntry) { + lib = (LibraryOrderEntry)entry; + modulesLibraryUsedIn.add(entry.getOwnerModule()); + } + else if (entry instanceof ModuleOrderEntry) { modulesLibraryUsedIn.add(entry.getOwnerModule()); } } - return ((ProjectRootManagerEx)myProjectRootManager).getScopeForLibraryUsedIn(modulesLibraryUsedIn); + GlobalSearchScope allCandidates = ((ProjectRootManagerEx)myProjectRootManager).getScopeForLibraryUsedIn(modulesLibraryUsedIn); + if (lib != null) { + final LibraryRuntimeClasspathScope preferred = new LibraryRuntimeClasspathScope(myProject, lib); + // prefer current library + return new DelegatingGlobalSearchScope(allCandidates, preferred) { + @Override + public int compare(VirtualFile file1, VirtualFile file2) { + boolean c1 = preferred.contains(file1); + boolean c2 = preferred.contains(file2); + if (c1 && !c2) return 1; + if (c2 && !c1) return -1; + + return super.compare(file1, file2); + } + }; + } + return allCandidates; } } diff --git a/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java index 480dc6312069..4f66a034eae0 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java @@ -30,10 +30,7 @@ import com.intellij.openapi.roots.libraries.Library; import com.intellij.openapi.roots.libraries.LibraryTable; import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.io.FileUtil; -import com.intellij.openapi.vfs.JarFileSystem; -import com.intellij.openapi.vfs.LocalFileSystem; -import com.intellij.openapi.vfs.VfsUtil; -import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.*; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiFileFactory; @@ -278,4 +275,26 @@ import java.util.Collection; } }.execute().throwException(); } + + public static void addLibrary(final Module module, + final String libName, final String libDir, + final String[] classRoots, + final String[] sourceRoots) { + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + final ModifiableRootModel model = ModuleRootManager.getInstance(module).getModifiableModel(); + final String parentUrl = VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, libDir); + final Library library = model.getModuleLibraryTable().createLibrary(libName); + final Library.ModifiableModel libModifiableModel = library.getModifiableModel(); + for (String classRoot : classRoots) { + libModifiableModel.addRoot(parentUrl + classRoot, OrderRootType.CLASSES); + } + for (String sourceRoot : sourceRoots) { + libModifiableModel.addRoot(parentUrl + sourceRoot, OrderRootType.SOURCES); + } + libModifiableModel.commit(); + model.commit(); + } + }); + } } \ No newline at end of file diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLibrariesModificationsTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLibrariesModificationsTest.java index 05dfc5829a4b..d7972ddbb3fc 100644 --- a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLibrariesModificationsTest.java +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLibrariesModificationsTest.java @@ -30,6 +30,7 @@ import com.intellij.openapi.roots.OrderRootType; import com.intellij.openapi.roots.libraries.Library; import com.intellij.openapi.vfs.JarFileSystem; import com.intellij.openapi.vfs.VirtualFileManager; +import com.intellij.testFramework.PsiTestUtil; import com.intellij.util.ArrayUtil; public class EclipseLibrariesModificationsTest extends EclipseVarsTest { @@ -38,22 +39,8 @@ public class EclipseLibrariesModificationsTest extends EclipseVarsTest { final Project project = getProject(); final String path = project.getBaseDir().getPath() + "/test"; final Module module = EclipseClasspathTest.setUpModule(path, project); - ApplicationManager.getApplication().runWriteAction(new Runnable() { - public void run() { - final ModifiableRootModel model = ModuleRootManager.getInstance(module).getModifiableModel(); - final String parentUrl = VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, model.getContentRoots()[0].getParent().getPath()); - final Library library = model.getModuleLibraryTable().createLibrary("created"); - final Library.ModifiableModel libModifiableModel = library.getModifiableModel(); - for (String classRoot : classRoots) { - libModifiableModel.addRoot(parentUrl + classRoot, OrderRootType.CLASSES); - } - for (String sourceRoot : sourceRoots) { - libModifiableModel.addRoot(parentUrl + sourceRoot, OrderRootType.SOURCES); - } - libModifiableModel.commit(); - model.commit(); - } - }); + PsiTestUtil.addLibrary(module, "created", ModuleRootManager.getInstance(module).getContentRoots()[0].getParent().getPath(), classRoots, + sourceRoots); EclipseClasspathTest.checkModule(project.getBaseDir().getPath() + "/expected", module); } From 30042d0305a1658da66bd1cb5224d1ce1c3863b2 Mon Sep 17 00:00:00 2001 From: Sergey Evdokimov Date: Thu, 29 Mar 2012 18:30:41 +0400 Subject: [PATCH 21/27] Add additional loggining to understand cause of maven test fail --- .../maven/dom/MavenExtensionCompletionAndResolutionTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java index 95f5341069c4..211cf736ca95 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java @@ -21,6 +21,8 @@ import com.intellij.psi.PsiReference; import org.jetbrains.idea.maven.indices.MavenIndicesTestFixture; import org.jetbrains.idea.maven.indices.MavenProjectIndicesManager; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; public class MavenExtensionCompletionAndResolutionTest extends MavenDomWithIndicesTestCase { @@ -70,7 +72,7 @@ public class MavenExtensionCompletionAndResolutionTest extends MavenDomWithIndic List actual = getCompletionVariants(myProjectPom); - if (actual.isEmpty()) { + if (!new HashSet(actual).equals(new HashSet(Arrays.asList("maven-compiler-plugin", "maven-war-plugin", "maven-eclipse-plugin", "maven-surefire-plugin")))) { MavenProjectIndicesManager instance = MavenProjectIndicesManager.getInstance(myProject); System.out.println("GetArtifacts: " + instance.getArtifactIds("org.apache.maven.plugins")); System.out.println("Indexes: " + instance.getIndices()); From 69f7ea8dec3c8852b71cbe737008c27f757fe545 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Mar 2012 15:47:32 +0200 Subject: [PATCH 22/27] enable only run in fork mode (IDEA-83681) --- .../com/intellij/execution/junit/TestObject.java | 13 +++++++------ .../com/intellij/execution/junit/TestPackage.java | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/junit/src/com/intellij/execution/junit/TestObject.java b/plugins/junit/src/com/intellij/execution/junit/TestObject.java index 7ef35d90713f..6942a997b0b9 100644 --- a/plugins/junit/src/com/intellij/execution/junit/TestObject.java +++ b/plugins/junit/src/com/intellij/execution/junit/TestObject.java @@ -252,7 +252,7 @@ public abstract class TestObject implements JavaCommandLine { @Override public ExecutionResult execute(final Executor executor, @NotNull final ProgramRunner runner) throws ExecutionException { - final JUnitProcessHandler handler = createHandler(); + final JUnitProcessHandler handler = createHandler(executor); final RunnerSettings runnerSettings = getRunnerSettings(); JavaRunConfigurationExtensionManager.getInstance().attachExtensionsToProcess(myConfiguration, handler, runnerSettings); final TestProxy unboundOutputRoot = new TestProxy(new RootTestInfo()); @@ -360,19 +360,20 @@ public abstract class TestObject implements JavaCommandLine { TestsUIUtil.notifyByBalloon(myProject, model != null ? model.getRoot() : null, consoleProperties); } - protected JUnitProcessHandler createHandler() throws ExecutionException { - appendForkInfo(); + protected JUnitProcessHandler createHandler(Executor executor) throws ExecutionException { + appendForkInfo(executor); return JUnitProcessHandler.runCommandLine(CommandLineBuilder.createFromJavaParameters(myJavaParameters, myProject, true)); } - private void appendForkInfo() throws ExecutionException { + private void appendForkInfo(Executor executor) throws ExecutionException { final String forkMode = myConfiguration.getForkMode(); if (Comparing.strEqual(forkMode, "none")) { return; } - if (myRunnerSettings.getData() instanceof DebuggingRunnerData) { - throw new CantRunException("Debug is disabled in fork mode.
Please change fork mode to <none> to debug."); + if (myRunnerSettings.getData() != null) { + final String actionName = executor.getActionName(); + throw new CantRunException(actionName + " is disabled in fork mode.
Please change fork mode to <none> to " + actionName.toLowerCase() + "."); } final JavaParameters javaParameters = getJavaParameters(); diff --git a/plugins/junit/src/com/intellij/execution/junit/TestPackage.java b/plugins/junit/src/com/intellij/execution/junit/TestPackage.java index b4460ea4d7b9..2bb70b12c018 100644 --- a/plugins/junit/src/com/intellij/execution/junit/TestPackage.java +++ b/plugins/junit/src/com/intellij/execution/junit/TestPackage.java @@ -87,8 +87,8 @@ public class TestPackage extends TestObject { } @Override - protected JUnitProcessHandler createHandler() throws ExecutionException { - final JUnitProcessHandler handler = super.createHandler(); + protected JUnitProcessHandler createHandler(Executor executor) throws ExecutionException { + final JUnitProcessHandler handler = super.createHandler(executor); final SearchForTestsTask[] tasks = new SearchForTestsTask[1]; handler.addProcessListener(new ProcessAdapter() { @Override From bcbf3ca8a5c8b81f9fd00bbafecaf26a94e8e5fe Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Mar 2012 16:26:06 +0200 Subject: [PATCH 23/27] IDEA-83694: correctly process suite methods out of TestCase class --- .../junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java index fc75268f3598..9f65a8138aeb 100644 --- a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java +++ b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java @@ -17,7 +17,6 @@ package com.intellij.junit4; import org.junit.Ignore; import org.junit.internal.AssumptionViolatedException; -import org.junit.internal.builders.JUnit3Builder; import org.junit.internal.requests.ClassRequest; import org.junit.internal.runners.model.EachTestNotifier; import org.junit.runner.Description; @@ -151,7 +150,7 @@ public class JUnit4TestRunnerUtil { } try { if (clazz.getMethod("suite", new Class[0]) != null && !methodName.equals("suite")) { - return Request.runner(new JUnit3Builder().runnerForClass(clazz)).filterWith(Description.createTestDescription(clazz, methodName)); + return Request.classWithoutSuiteMethod(clazz).filterWith(Description.createTestDescription(clazz, methodName)); } } catch (Throwable e) { From 6e7c3616f1011c0ee87ac9f3af197cdc91840bcf Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Mar 2012 16:37:06 +0200 Subject: [PATCH 24/27] EA-35251 - NPE: DetectedPluginsPanel$.customizeCellRenderer --- .../impl/DetectedPluginsPanel.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java index b3013c4a347e..860d7c367872 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java @@ -53,15 +53,17 @@ public class DetectedPluginsPanel extends OrderPanel { final int row, final int column) { final PluginDownloader downloader = (PluginDownloader)value; - append(downloader.getPluginName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); - final IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(PluginId.getId(downloader.getPluginId())); - final String loadedVersion = downloader.getPluginVersion(); - if (loadedVersion != null || (ideaPluginDescriptor != null && ideaPluginDescriptor.getVersion() != null)) { - final String installedVersion = ideaPluginDescriptor != null && ideaPluginDescriptor.getVersion() != null - ? "v. " + ideaPluginDescriptor.getVersion() + (loadedVersion != null ? " -> " : "") - : ""; - final String availableVersion = loadedVersion != null ? loadedVersion : ""; - append(" (" + installedVersion + availableVersion + ")", SimpleTextAttributes.GRAY_ATTRIBUTES); + if (downloader != null) { + append(downloader.getPluginName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); + final IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(PluginId.getId(downloader.getPluginId())); + final String loadedVersion = downloader.getPluginVersion(); + if (loadedVersion != null || (ideaPluginDescriptor != null && ideaPluginDescriptor.getVersion() != null)) { + final String installedVersion = ideaPluginDescriptor != null && ideaPluginDescriptor.getVersion() != null + ? "v. " + ideaPluginDescriptor.getVersion() + (loadedVersion != null ? " -> " : "") + : ""; + final String availableVersion = loadedVersion != null ? loadedVersion : ""; + append(" (" + installedVersion + availableVersion + ")", SimpleTextAttributes.GRAY_ATTRIBUTES); + } } } }); From 99fc1e973772f6bb005cc9bdc38ea8a63815a5f9 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Mar 2012 16:38:05 +0200 Subject: [PATCH 25/27] plugin installation notification text should be more user friendly (IDEA-83688) --- .../src/com/intellij/ide/plugins/ActionInstallPlugin.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java b/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java index f1399ec5e82b..7f92920f3b53 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java @@ -36,6 +36,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.Function; import com.intellij.util.net.IOExceptionDialog; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.swing.event.HyperlinkEvent; import java.io.IOException; @@ -157,7 +158,7 @@ public class ActionInstallPlugin extends AnAction implements DumbAware { } if (needToRestart) { - notifyPluginsWereInstalled(); + notifyPluginsWereInstalled(list.size() == 1 ? list.get(0).getName() : null); } } } @@ -256,7 +257,7 @@ public class ActionInstallPlugin extends AnAction implements DumbAware { } } - private static void notifyPluginsWereInstalled() { + private static void notifyPluginsWereInstalled(@Nullable String pluginName) { final ApplicationEx app = ApplicationManagerEx.getApplicationEx(); final boolean restartCapable = app.isRestartCapable(); String message = ""; @@ -265,7 +266,8 @@ public class ActionInstallPlugin extends AnAction implements DumbAware { message += "
Restart now" : "\"shutdown\">Shutdown"; message += ""; - Notifications.Bus.notify(new Notification(IdeBundle.message("title.plugin.error"), IdeBundle.message("title.plugin.error"), + Notifications.Bus.notify(new Notification("Plugins Lifecycle Group", + pluginName != null ? "Plugin \'" + pluginName + "\' was successfully installed" : "Plugins were installed", message, NotificationType.INFORMATION, new NotificationListener() { @Override public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) { From dd7b3c55430c1eaa58a4bf22c47668ae10d7158a Mon Sep 17 00:00:00 2001 From: Anna Bulenkova Date: Thu, 29 Mar 2012 16:42:02 +0200 Subject: [PATCH 26/27] rename ApplicationController disabled from project view --- .../src/com/intellij/codeInsight/hint/HintUtil.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/codeInsight/hint/HintUtil.java b/platform/platform-impl/src/com/intellij/codeInsight/hint/HintUtil.java index ef9259d2c2da..a87d71b8a9c8 100644 --- a/platform/platform-impl/src/com/intellij/codeInsight/hint/HintUtil.java +++ b/platform/platform-impl/src/com/intellij/codeInsight/hint/HintUtil.java @@ -33,7 +33,7 @@ import java.awt.*; public class HintUtil { public static final Color INFORMATION_COLOR = new Color(253, 254, 226); public static final Color QUESTION_COLOR = new Color(181, 208, 251); - private static final Color ERROR_COLOR = new Color(255, 220, 220); + public static final Color ERROR_COLOR = new Color(255, 220, 220); private static final Icon INFORMATION_ICON = null; private static final Icon QUESTION_ICON = IconLoader.getIcon("/actions/help.png"); @@ -91,7 +91,7 @@ public class HintUtil { } public static JComponent createInformationLabel(final SimpleColoredText text, final Icon icon) { - SimpleColoredComponent highlighted = new SimpleColoredComponent (); + SimpleColoredComponent highlighted = new SimpleColoredComponent(); highlighted.setIcon(icon); highlighted.setBackground(INFORMATION_COLOR); @@ -219,6 +219,5 @@ public class HintUtil { public String toString() { return "Hint: text='" + (myPane != null ? myPane.getText() : "") + "'"; } - } } \ No newline at end of file From 3a5fb23841fa6789d36d7107e064aae282d9858e Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Thu, 29 Mar 2012 19:02:17 +0400 Subject: [PATCH 27/27] IDEA-83278 "Wrapping and Braces -> Keep when reformatting -> Multiple expressions in one line" prevents refactorings/intentions from producing correctly formatted code --- .../java/JavaSpacePropertyProcessor.java | 9 ++++++++- .../intellij/formatting/FormatterImpl.java | 8 +++----- .../intellij/psi/formatter/FormatterUtil.java | 19 +++++++++++++++++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java b/java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java index f27234ef9a5c..8d04c48535b9 100644 --- a/java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java +++ b/java/java-impl/src/com/intellij/psi/formatter/java/JavaSpacePropertyProcessor.java @@ -767,7 +767,14 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor { int minSpaces = 0; int minLineFeeds = 1; PsiElement psi = myChild1.getPsi(); - if (mySettings.KEEP_MULTIPLE_EXPRESSIONS_IN_ONE_LINE || psi != null && PsiTreeUtil.hasErrorElements(psi)) { + + // We want to avoid situations like below: + // 1. Call 'introduce variable' refactoring for the code like 'System.out.println(1);'; + // 2. When KEEP_MULTIPLE_EXPRESSIONS_IN_ONE_LINE is on, the output looks like 'int i = 1; System.out.println(i);'; + // That's why we process the option only during the explicit reformat (directly invoked by an user). + if ((mySettings.KEEP_MULTIPLE_EXPRESSIONS_IN_ONE_LINE && FormatterUtil.isFormatterCalledExplicitly()) + || psi != null && PsiTreeUtil.hasErrorElements(psi)) + { minSpaces = 1; minLineFeeds = 0; } diff --git a/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java b/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java index 660eedc034a7..0b47d69e55ef 100644 --- a/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java +++ b/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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,7 +18,6 @@ package com.intellij.formatting; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileTypes.FileType; @@ -34,7 +33,6 @@ import com.intellij.psi.formatter.PsiBasedFormattingModel; import com.intellij.util.IncorrectOperationException; import com.intellij.util.SequentialTask; import com.intellij.util.text.CharArrayUtil; -import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -98,7 +96,7 @@ public class FormatterImpl extends FormatterEx @Override public void setProgressTask(@NotNull FormattingProgressTask progressIndicator) { - if (!FormatterUtil.FORMATTER_ACTION_NAMES.contains(CommandProcessor.getInstance().getCurrentCommandName())) { + if (!FormatterUtil.isFormatterCalledExplicitly()) { return; } myProgressTask.set(progressIndicator); @@ -694,7 +692,7 @@ public class FormatterImpl extends FormatterEx final boolean keepLineBreaksFlag, final int keepLineBreaks, final boolean keepFirstColumn, int prefLineFeeds) { - synchronized(this) { + synchronized(ourSharedSpacing) { ourSharedSpacing.init(minSpaces, maxSpaces, minLineFeeds, readOnly, safe, keepLineBreaksFlag, keepLineBreaks, keepFirstColumn, prefLineFeeds); SpacingImpl spacing = ourSharedProperties.get(ourSharedSpacing); diff --git a/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java b/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java index c40a94360506..12b46a4f83e9 100644 --- a/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java +++ b/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -19,6 +19,7 @@ import com.intellij.codeInsight.actions.ReformatAndOptimizeImportsProcessor; import com.intellij.codeInsight.actions.ReformatCodeProcessor; import com.intellij.lang.ASTFactory; import com.intellij.lang.ASTNode; +import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.psi.TokenType; @@ -292,7 +293,11 @@ public class FormatterUtil { private static ASTNode findPreviousWhiteSpace(final ASTNode leafElement, final IElementType whiteSpaceTokenType) { final int offset = leafElement.getTextRange().getStartOffset() - 1; if (offset < 0) return null; - final PsiElement found = SourceTreeToPsiMap.treeElementToPsi(leafElement).getContainingFile().findElementAt(offset); + final PsiElement psiElement = SourceTreeToPsiMap.treeElementToPsi(leafElement); + if (psiElement == null) { + return null; + } + final PsiElement found = psiElement.getContainingFile().findElementAt(offset); if (found == null) return null; final ASTNode treeElement = found.getNode(); if (treeElement != null && treeElement.getElementType() == whiteSpaceTokenType) return treeElement; @@ -357,6 +362,9 @@ public class FormatterUtil { public static void replaceLastWhiteSpace(final ASTNode astNode, final String whiteSpace, final TextRange textRange) { ASTNode lastWS = TreeUtil.findLastLeaf(astNode); + if (lastWS == null) { + return; + } if (lastWS.getElementType() != TokenType.WHITE_SPACE) { lastWS = null; } @@ -381,4 +389,11 @@ public class FormatterUtil { treeParent.replaceChild(lastWS, whiteSpaceElement); } } + + /** + * @return true explicitly called 'reformat' is in progress at the moment; false otherwise + */ + public static boolean isFormatterCalledExplicitly() { + return FORMATTER_ACTION_NAMES.contains(CommandProcessor.getInstance().getCurrentCommandName()); + } }