From 581e899f47debb87838c69d202b09a99e713a1e6 Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 21 Apr 2010 16:57:55 +0400 Subject: [PATCH 01/16] exclude method type parameters from extracted class signature (IDEA-53446) --- .../extractclass/ExtractClassProcessor.java | 2 ++ .../methodTypeParameters/after/Extracted.java | 8 ++++++++ .../methodTypeParameters/after/Test.java | 12 ++++++++++++ .../methodTypeParameters/before/Test.java | 10 ++++++++++ .../com/intellij/refactoring/ExtractClassTest.java | 4 ++++ 5 files changed, 36 insertions(+) create mode 100644 java/java-tests/testData/refactoring/extractClass/methodTypeParameters/after/Extracted.java create mode 100644 java/java-tests/testData/refactoring/extractClass/methodTypeParameters/after/Test.java create mode 100644 java/java-tests/testData/refactoring/extractClass/methodTypeParameters/before/Test.java diff --git a/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java b/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java index e73ea25c55ee..e3eca3742431 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java @@ -110,6 +110,8 @@ public class ExtractClassProcessor extends FixableUsagesRefactoringProcessor { } for (PsiMethod method : methods) { method.accept(visitor); + //do not include method's type parameters in class signature + typeParamSet.removeAll(Arrays.asList(method.getTypeParameters())); } typeParams.addAll(typeParamSet); } diff --git a/java/java-tests/testData/refactoring/extractClass/methodTypeParameters/after/Extracted.java b/java/java-tests/testData/refactoring/extractClass/methodTypeParameters/after/Extracted.java new file mode 100644 index 000000000000..bb979dcebb4e --- /dev/null +++ b/java/java-tests/testData/refactoring/extractClass/methodTypeParameters/after/Extracted.java @@ -0,0 +1,8 @@ +public class Extracted { + public Extracted() { + } + + public void foo(T p) { + System.out.println(p.getClass().getName()); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/extractClass/methodTypeParameters/after/Test.java b/java/java-tests/testData/refactoring/extractClass/methodTypeParameters/after/Test.java new file mode 100644 index 000000000000..e4826f85ba8b --- /dev/null +++ b/java/java-tests/testData/refactoring/extractClass/methodTypeParameters/after/Test.java @@ -0,0 +1,12 @@ +class Test { + private final Extracted extracted = new Extracted(); + + public void foo(T p) { + extracted.foo(p); + } + + public static void main(String[] args) { + new Test().foo(10f); + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/extractClass/methodTypeParameters/before/Test.java b/java/java-tests/testData/refactoring/extractClass/methodTypeParameters/before/Test.java new file mode 100644 index 000000000000..577710ba32f3 --- /dev/null +++ b/java/java-tests/testData/refactoring/extractClass/methodTypeParameters/before/Test.java @@ -0,0 +1,10 @@ +class Test { + public void foo(T p) { + System.out.println(p.getClass().getName()); + } + + public static void main(String[] args) { + new Test().foo(10f); + } + +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/refactoring/ExtractClassTest.java b/java/java-tests/testSrc/com/intellij/refactoring/ExtractClassTest.java index 66f5db32490a..f060901f2d58 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/ExtractClassTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/ExtractClassTest.java @@ -227,6 +227,10 @@ public class ExtractClassTest extends MultiFileTestCase{ doTestField(null); } + public void testMethodTypeParameters() throws Exception { + doTestMethod(); + } + public void testPublicVisibility() throws Exception { doTest(new PerformAction() { public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception { From 73081ee24db66b9bae8c1b76c409f437ab62bfd3 Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 21 Apr 2010 20:07:35 +0400 Subject: [PATCH 02/16] package-info.java is involved in Ctrl-Q (IDEA-26014); testdata moved --- .../javadoc/JavaDocInfoGenerator.java | 40 ++++++++++++++----- .../javadocIG/classTypeParameter.html | 3 ++ .../javadocIG/classTypeParameter.java | 6 +++ .../codeInsight/javadocIG/fieldValue.html | 1 + .../codeInsight/javadocIG/fieldValue.java | 4 ++ .../codeInsight/javadocIG/ideadev2326.html | 2 + .../codeInsight/javadocIG/ideadev2326.java | 12 ++++++ .../javadocIG/methodTypeParameter.html | 1 + .../javadocIG/methodTypeParameter.java | 7 ++++ .../javadocIG/packageInfo/package-info.java | 4 ++ .../javadocIG/packageInfo/packageInfo.html | 2 + .../codeInsight/javadocIG/simpleField.html | 1 + .../codeInsight/javadocIG/simpleField.java | 4 ++ .../codeInsight/javadocIG/valueInMethod.html | 1 + .../codeInsight/javadocIG/valueInMethod.java | 6 +++ 15 files changed, 83 insertions(+), 11 deletions(-) create mode 100644 java/java-tests/testData/codeInsight/javadocIG/classTypeParameter.html create mode 100644 java/java-tests/testData/codeInsight/javadocIG/classTypeParameter.java create mode 100644 java/java-tests/testData/codeInsight/javadocIG/fieldValue.html create mode 100644 java/java-tests/testData/codeInsight/javadocIG/fieldValue.java create mode 100644 java/java-tests/testData/codeInsight/javadocIG/ideadev2326.html create mode 100644 java/java-tests/testData/codeInsight/javadocIG/ideadev2326.java create mode 100644 java/java-tests/testData/codeInsight/javadocIG/methodTypeParameter.html create mode 100644 java/java-tests/testData/codeInsight/javadocIG/methodTypeParameter.java create mode 100644 java/java-tests/testData/codeInsight/javadocIG/packageInfo/package-info.java create mode 100644 java/java-tests/testData/codeInsight/javadocIG/packageInfo/packageInfo.html create mode 100644 java/java-tests/testData/codeInsight/javadocIG/simpleField.html create mode 100644 java/java-tests/testData/codeInsight/javadocIG/simpleField.java create mode 100644 java/java-tests/testData/codeInsight/javadocIG/valueInMethod.html create mode 100644 java/java-tests/testData/codeInsight/javadocIG/valueInMethod.java diff --git a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java index 0fff2b07db6c..7453b29a9cb3 100644 --- a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java +++ b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java @@ -19,6 +19,7 @@ import com.intellij.codeInsight.AnnotationUtil; import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.codeInsight.ExternalAnnotationsManager; import com.intellij.codeInsight.documentation.DocumentationManager; +import com.intellij.lang.ASTNode; import com.intellij.lang.LangBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; @@ -28,6 +29,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; import com.intellij.psi.impl.JavaConstantExpressionEvaluator; +import com.intellij.psi.impl.source.tree.JavaDocElementType; import com.intellij.psi.javadoc.PsiDocComment; import com.intellij.psi.javadoc.PsiDocTag; import com.intellij.psi.javadoc.PsiDocTagValue; @@ -315,10 +317,7 @@ public class JavaDocInfoGenerator { PsiDocComment comment = getDocComment(aClass); if (comment != null) { - generateDescription(buffer, comment); - generateDeprecatedSection(buffer, comment); - generateSinceSection(buffer, comment); - generateSeeAlsoSection(buffer, comment); + generateCommonSection(buffer, comment); generateTypeParametersSection(buffer, aClass); } generateEpilogue(buffer); @@ -418,10 +417,7 @@ public class JavaDocInfoGenerator { PsiDocComment comment = getDocComment(field); if (comment != null) { - generateDescription(buffer, comment); - generateDeprecatedSection(buffer, comment); - generateSinceSection(buffer, comment); - generateSeeAlsoSection(buffer, comment); + generateCommonSection(buffer, comment); } generateEpilogue(buffer); @@ -463,6 +459,23 @@ public class JavaDocInfoGenerator { private void generatePackageJavaDoc(final StringBuilder buffer, final PsiPackage psiPackage) { for(PsiDirectory directory: psiPackage.getDirectories()) { + final PsiFile packageInfoFile = directory.findFile("package-info.java"); + if (packageInfoFile != null) { + final ASTNode node = packageInfoFile.getNode(); + if (node != null) { + final ASTNode docCommentNode = node.findChildByType(JavaDocElementType.DOC_COMMENT); + if (docCommentNode != null) { + final PsiDocComment docComment = (PsiDocComment)docCommentNode.getPsi(); + + generatePrologue(buffer); + + generateCommonSection(buffer, docComment); + + generateEpilogue(buffer); + break; + } + } + } PsiFile packageHtmlFile = directory.findFile("package.html"); if (packageHtmlFile != null) { generatePackageHtmlJavaDoc(buffer, packageHtmlFile); @@ -471,6 +484,13 @@ public class JavaDocInfoGenerator { } } + private void generateCommonSection(StringBuilder buffer, PsiDocComment docComment) { + generateDescription(buffer, docComment); + generateDeprecatedSection(buffer, docComment); + generateSinceSection(buffer, docComment); + generateSeeAlsoSection(buffer, docComment); + } + private void generatePackageHtmlJavaDoc(final StringBuilder buffer, final PsiFile packageHtmlFile) { String htmlText; XmlFile packageXmlFile = (XmlFile) packageHtmlFile; @@ -502,9 +522,7 @@ public class JavaDocInfoGenerator { generatePrologue(buffer); - generateDescription(buffer, docComment); - generateSinceSection(buffer, docComment); - generateSeeAlsoSection(buffer, docComment); + generateCommonSection(buffer, docComment); generateEpilogue(buffer); } diff --git a/java/java-tests/testData/codeInsight/javadocIG/classTypeParameter.html b/java/java-tests/testData/codeInsight/javadocIG/classTypeParameter.html new file mode 100644 index 000000000000..531cb6123a81 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/classTypeParameter.html @@ -0,0 +1,3 @@ +
class MethodTypeParam<T>
+extends Object
+
Type parameters:
<T> - type param
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/classTypeParameter.java b/java/java-tests/testData/codeInsight/javadocIG/classTypeParameter.java new file mode 100644 index 000000000000..1ceb9caa5398 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/classTypeParameter.java @@ -0,0 +1,6 @@ +/** + * @param type param + */ +class MethodTypeParam { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/fieldValue.html b/java/java-tests/testData/codeInsight/javadocIG/fieldValue.html new file mode 100644 index 000000000000..6f269de54369 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/fieldValue.html @@ -0,0 +1 @@ + A
public static int JAVADOC_ME = 23
The value of the field is 23. \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/fieldValue.java b/java/java-tests/testData/codeInsight/javadocIG/fieldValue.java new file mode 100644 index 000000000000..01c0ff6936cb --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/fieldValue.java @@ -0,0 +1,4 @@ +class A { + /** The value of the field is {@value}. */ + public static int JAVADOC_ME = 23; +} diff --git a/java/java-tests/testData/codeInsight/javadocIG/ideadev2326.html b/java/java-tests/testData/codeInsight/javadocIG/ideadev2326.html new file mode 100644 index 000000000000..4ada6b3a0ac8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/ideadev2326.html @@ -0,0 +1,2 @@ + Idea4780
public Object read()
+           throws IOException
Throws:
EOFException - if this source is already closed when the read() is called, or is closed during the read().
InterruptedIOException - if the reading thread is interrupted.
IOException - if an I/O error occurs while reading.
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/ideadev2326.java b/java/java-tests/testData/codeInsight/javadocIG/ideadev2326.java new file mode 100644 index 000000000000..ba8b065e36f8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/ideadev2326.java @@ -0,0 +1,12 @@ +import java.io.*; + +public interface Idea4780 { + /** + * @throws IOException if an I/O error occurs while reading. + * @throws EOFException if this source is already closed when the read() is called, + * or is closed during the read(). + * @throws InterruptedIOException if the reading thread is interrupted. + */ + public Object read() + throws IOException; +} diff --git a/java/java-tests/testData/codeInsight/javadocIG/methodTypeParameter.html b/java/java-tests/testData/codeInsight/javadocIG/methodTypeParameter.html new file mode 100644 index 000000000000..1d324319ab10 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/methodTypeParameter.html @@ -0,0 +1 @@ + MethodTypeParam
<T> void foo(T t)
Type parameters:
<T> - type param
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/methodTypeParameter.java b/java/java-tests/testData/codeInsight/javadocIG/methodTypeParameter.java new file mode 100644 index 000000000000..5ad5d851af69 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/methodTypeParameter.java @@ -0,0 +1,7 @@ +class MethodTypeParam { + /** + * @param type param + */ + void foo(T t) { + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/packageInfo/package-info.java b/java/java-tests/testData/codeInsight/javadocIG/packageInfo/package-info.java new file mode 100644 index 000000000000..5dc3f1b97914 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/packageInfo/package-info.java @@ -0,0 +1,4 @@ +/** + * This package contains nothing but package-info.java + */ +package packageInfo; \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/packageInfo/packageInfo.html b/java/java-tests/testData/codeInsight/javadocIG/packageInfo/packageInfo.html new file mode 100644 index 000000000000..a258c8654e7a --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/packageInfo/packageInfo.html @@ -0,0 +1,2 @@ + + This package contains nothing but package-info.java \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/simpleField.html b/java/java-tests/testData/codeInsight/javadocIG/simpleField.html new file mode 100644 index 000000000000..ddbd3871a41f --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/simpleField.html @@ -0,0 +1 @@ + A
public static int JAVADOC_ME
Test \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/simpleField.java b/java/java-tests/testData/codeInsight/javadocIG/simpleField.java new file mode 100644 index 000000000000..1172e6919bf1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/simpleField.java @@ -0,0 +1,4 @@ +class A { + /** Test */ + public static int JAVADOC_ME; +} diff --git a/java/java-tests/testData/codeInsight/javadocIG/valueInMethod.html b/java/java-tests/testData/codeInsight/javadocIG/valueInMethod.html new file mode 100644 index 000000000000..91b1c9744ed7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/valueInMethod.html @@ -0,0 +1 @@ + A
public static void JAVADOC_ME()
The value of A is 23. \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/valueInMethod.java b/java/java-tests/testData/codeInsight/javadocIG/valueInMethod.java new file mode 100644 index 000000000000..4c7e205db70e --- /dev/null +++ b/java/java-tests/testData/codeInsight/javadocIG/valueInMethod.java @@ -0,0 +1,6 @@ +class A { + public static int A = 23; + + /** The value of A is {@value #A}. */ + public static void JAVADOC_ME() { } +} From cfd764a9c90fd3ae75e23b1c922b568296c788d7 Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 21 Apr 2010 20:46:24 +0400 Subject: [PATCH 03/16] suggest to rename tests if corresponding class was renamed ( IDEA-19812 ) --- .../refactoring/JavaRefactoringSettings.java | 9 ++ .../naming/AutomaticTestRenamerFactory.java | 83 +++++++++++++++++++ .../src/messages/RefactoringBundle.properties | 4 + resources/src/META-INF/IdeaPlugin.xml | 1 + 4 files changed, 97 insertions(+) create mode 100644 java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticTestRenamerFactory.java diff --git a/java/java-impl/src/com/intellij/refactoring/JavaRefactoringSettings.java b/java/java-impl/src/com/intellij/refactoring/JavaRefactoringSettings.java index f61f70cffb99..bcb261bdb727 100644 --- a/java/java-impl/src/com/intellij/refactoring/JavaRefactoringSettings.java +++ b/java/java-impl/src/com/intellij/refactoring/JavaRefactoringSettings.java @@ -100,6 +100,7 @@ public class JavaRefactoringSettings implements PersistentStateComponent usages) { + return new TestsRenamer((PsiClass)element, newName); + } + + private static class TestsRenamer extends AutomaticRenamer { + public TestsRenamer(PsiClass aClass, String newClassName) { + + appendTestClass(aClass, "Test"); + appendTestClass(aClass, "TestCase"); + + suggestAllNames(aClass.getName(), newClassName); + } + + private void appendTestClass(PsiClass aClass, String testSuffix) { + final Project project = aClass.getProject(); + final JavaPsiFacade facade = JavaPsiFacade.getInstance(project); + final PsiClass psiClassTest = facade.findClass(aClass.getQualifiedName() + testSuffix, GlobalSearchScope.projectScope(project)); + if (psiClassTest != null) { + myElements.add(psiClassTest); + } + } + + public String getDialogTitle() { + return RefactoringBundle.message("rename.tests.title"); + } + + public String getDialogDescription() { + return RefactoringBundle.message("rename.tests.with.the.following.names.to"); + } + + public String entityName() { + return RefactoringBundle.message("entity.name.test"); + } + } +} diff --git a/platform/platform-resources-en/src/messages/RefactoringBundle.properties b/platform/platform-resources-en/src/messages/RefactoringBundle.properties index 909d679b0513..97799609dd07 100644 --- a/platform/platform-resources-en/src/messages/RefactoringBundle.properties +++ b/platform/platform-resources-en/src/messages/RefactoringBundle.properties @@ -562,6 +562,7 @@ automatic.renamer.rename.to.column=Rename To rename.0.and.its.usages.to=Rename {0} and its usages to: rename.variables=Rename &variables rename.inheritors=Rename &inheritors +rename.tests=Rename &tests rename.parameters.hierarchy=Rename parameters in hier&archy rename.bound.forms=Rename bound &forms inner.class.0.is.already.defined.in.class.1=Inner class {0} is already defined in class {1}.\nContinue anyway? @@ -577,8 +578,11 @@ rename.bound.forms.title=Rename bound forms rename.forms.with.the.following.names.to=Rename forms with the following names to: entity.name.form=Form rename.inheritors.title=Rename Inheritors +rename.tests.title=Rename Tests rename.inheritors.with.the.following.names.to=Rename inheritors with the following names to: +rename.tests.with.the.following.names.to=Rename tests with the following names to: entity.name.inheritor=Inheritor +entity.name.test=Test unused.overriding.methods.title=Unused Overriding Methods there.are.unused.methods.that.override.methods.you.delete=There are unused methods that override methods you delete. choose.the.ones.you.want.to.be.deleted=Choose the ones you want to be deleted. diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml index 1f88249aa728..a32a3ec171c9 100644 --- a/resources/src/META-INF/IdeaPlugin.xml +++ b/resources/src/META-INF/IdeaPlugin.xml @@ -1016,6 +1016,7 @@ + From bb3cacc36cf45d2ed25ccb5f4e9c00644aff4d40 Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 21 Apr 2010 21:04:29 +0400 Subject: [PATCH 04/16] allow to change constructor signature when caret is on constructor call --- .../changeSignature/ChangeSignatureTargetUtil.java | 5 +++-- .../refactoring/changeSignatureTarget/inTypeArguments.java | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/java/java-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureTargetUtil.java b/java/java-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureTargetUtil.java index 5c947f4c48bb..b4735a329f85 100644 --- a/java/java-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureTargetUtil.java +++ b/java/java-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureTargetUtil.java @@ -35,10 +35,11 @@ public class ChangeSignatureTargetUtil { return PsiTreeUtil.getParentOfType(element, PsiMethod.class); } - final PsiMethodCallExpression expression = PsiTreeUtil.getParentOfType(element, PsiMethodCallExpression.class); + final PsiCallExpression expression = PsiTreeUtil.getParentOfType(element, PsiCallExpression.class); if (expression != null) { assert element != null; - final PsiExpression qualifierExpression = expression.getMethodExpression().getQualifierExpression(); + final PsiExpression qualifierExpression = expression instanceof PsiMethodCallExpression ? ((PsiMethodCallExpression)expression).getMethodExpression().getQualifierExpression() + : expression instanceof PsiNewExpression ? ((PsiNewExpression)expression).getQualifier() : null; if (PsiTreeUtil.isAncestor(qualifierExpression, element, false)) { final PsiExpressionList expressionList = PsiTreeUtil.getParentOfType(qualifierExpression, PsiExpressionList.class); if (expressionList != null) { diff --git a/java/java-tests/testData/refactoring/changeSignatureTarget/inTypeArguments.java b/java/java-tests/testData/refactoring/changeSignatureTarget/inTypeArguments.java index d0fb0a13392e..088e9bbcc97d 100644 --- a/java/java-tests/testData/refactoring/changeSignatureTarget/inTypeArguments.java +++ b/java/java-tests/testData/refactoring/changeSignatureTarget/inTypeArguments.java @@ -1,5 +1,7 @@ import java.util.*; class A1 { + A1(){} + public static void main(String[] args) { Callable callable = new Callable() { From ff63d5e3e3548e7792b3c8f5c2b04cc76191c686 Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 21 Apr 2010 21:18:59 +0400 Subject: [PATCH 05/16] enable wrong package statement for package-info.java files ( IDEA-53604 ) --- .../WrongPackageStatementInspection.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInspection/wrongPackageStatement/WrongPackageStatementInspection.java b/java/java-impl/src/com/intellij/codeInspection/wrongPackageStatement/WrongPackageStatementInspection.java index 04365a22fbf6..560f2f11f13a 100644 --- a/java/java-impl/src/com/intellij/codeInspection/wrongPackageStatement/WrongPackageStatementInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/wrongPackageStatement/WrongPackageStatementInspection.java @@ -40,15 +40,17 @@ public class WrongPackageStatementInspection extends BaseJavaLocalInspectionTool if (file instanceof PsiJavaFile) { if (JspPsiUtil.isInJspFile(file)) return null; PsiJavaFile javaFile = (PsiJavaFile)file; - // highlight the first class in the file only - PsiClass[] classes = javaFile.getClasses(); - if (classes.length == 0) return null; + PsiDirectory directory = javaFile.getContainingDirectory(); if (directory == null) return null; PsiPackage dirPackage = JavaDirectoryService.getInstance().getPackage(directory); if (dirPackage == null) return null; PsiPackageStatement packageStatement = javaFile.getPackageStatement(); + // highlight the first class in the file only + PsiClass[] classes = javaFile.getClasses(); + if (classes.length == 0 && packageStatement == null) return null; + String packageName = dirPackage.getQualifiedName(); if (!Comparing.strEqual(packageName, "", true) && packageStatement == null) { String description = JavaErrorMessages.message("missing.package.statement", packageName); @@ -75,7 +77,7 @@ public class WrongPackageStatementInspection extends BaseJavaLocalInspectionTool String description = JavaErrorMessages.message("package.name.file.path.mismatch", packageReference.getText(), dirPackage.getQualifiedName()); - return new ProblemDescriptor[]{manager.createProblemDescriptor(packageStatement, description, isOnTheFly, availableFixes.toArray(new LocalQuickFix[availableFixes.size()]), ProblemHighlightType.GENERIC_ERROR_OR_WARNING)}; + return new ProblemDescriptor[]{manager.createProblemDescriptor(packageStatement.getPackageReference(), description, isOnTheFly, availableFixes.toArray(new LocalQuickFix[availableFixes.size()]), ProblemHighlightType.GENERIC_ERROR_OR_WARNING)}; } } From 6a72485e0d227423e2321a3d1ff657ba0e3254e4 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 22 Apr 2010 14:38:43 +0400 Subject: [PATCH 06/16] IDEA-54248 Error when indexing a package called xml --- .../testng/src/com/theoryinpractice/testng/util/TestNGUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java b/plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java index 02570512b051..ec396fd77e7c 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java +++ b/plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java @@ -553,7 +553,7 @@ public class TestNGUtil implements TestFramework } public static boolean isTestngXML(final VirtualFile virtualFile) { - if (virtualFile.getName().endsWith("xml")) { + if ("xml".equalsIgnoreCase(virtualFile.getExtension())) { final String result = NanoXmlUtil.parseHeader(virtualFile).getRootTagLocalName(); if (result != null && result.equals(SUITE_TAG_NAME)) { return true; From b1ca0f5b484f4b37d684e02b1c0dc2e51fa16686 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Wed, 21 Apr 2010 20:33:58 +0400 Subject: [PATCH 07/16] LH: assertions --- .../com/intellij/history/core/storage/StreamUtil.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/platform/lvcs-impl/src/com/intellij/history/core/storage/StreamUtil.java b/platform/lvcs-impl/src/com/intellij/history/core/storage/StreamUtil.java index fc065965bbbc..503f718cf18a 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/storage/StreamUtil.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/storage/StreamUtil.java @@ -52,8 +52,8 @@ public class StreamUtil { } public static Change readChange(DataInput in) throws IOException { - switch (in.readInt()) { - case 0: + int type = in.readInt(); + switch (type) { case 1: return new CreateFileChange(in); case 2: @@ -73,14 +73,13 @@ public class StreamUtil { case 9: return new PutSystemLabelChange(in); } - throw new IOException(); + throw new IOException("unexpected change type: " + type); } public static void writeChange(DataOutput out, Change change) throws IOException { int id = -1; Class c = change.getClass(); - if (c.equals(ChangeSet.class)) id = 0; if (c.equals(CreateFileChange.class)) id = 1; if (c.equals(CreateDirectoryChange.class)) id = 2; if (c.equals(ContentChange.class)) id = 3; @@ -91,7 +90,7 @@ public class StreamUtil { if (c.equals(PutLabelChange.class)) id = 8; if (c.equals(PutSystemLabelChange.class)) id = 9; - assert id != -1; + if (id == -1) throw new IOException("unexpected change type: " + c); out.writeInt(id); change.write(out); From cf777e15bc2cdada7eea5eb5c40a7df1c6d96caf Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Thu, 22 Apr 2010 14:41:44 +0400 Subject: [PATCH 08/16] LH: storage bug fix --- .../com/intellij/history/core/ChangeList.java | 2 +- .../history/core/ChangeListStorageImpl.java | 6 +- .../history/core/LinkedRecordsTable.java | 11 +- .../intellij/history/core/LinkedStorage.java | 12 ++ .../historyIntegrTests/LinkedStorageTest.java | 147 ++++++++++++++++++ .../util/io/storage/AbstractRecordsTable.java | 3 + .../util/io/storage/RecordsTable.java | 4 + .../io/storage/RefCountingRecordsTable.java | 5 + 8 files changed, 182 insertions(+), 8 deletions(-) create mode 100644 platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/LinkedStorageTest.java diff --git a/platform/lvcs-impl/src/com/intellij/history/core/ChangeList.java b/platform/lvcs-impl/src/com/intellij/history/core/ChangeList.java index 3fc8641a09f6..f180a35105ee 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/ChangeList.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/ChangeList.java @@ -144,7 +144,7 @@ public class ChangeList { } private void flushChanges(boolean force) { - if (myChangeSetDepth > 0) return; + if (myChangeSetDepth > 0) return; if (myCurrentBlock.shouldFlush(force) || flushEveryChangeSetInTests()) { myStorage.writeNextBlock(myCurrentBlock); myCurrentBlock = myStorage.createNewBlock(); diff --git a/platform/lvcs-impl/src/com/intellij/history/core/ChangeListStorageImpl.java b/platform/lvcs-impl/src/com/intellij/history/core/ChangeListStorageImpl.java index 3b9a32962074..5c5159e2aae0 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/ChangeListStorageImpl.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/ChangeListStorageImpl.java @@ -140,7 +140,7 @@ public class ChangeListStorageImpl implements ChangeListStorage { } public synchronized List purge(long period, int intervalBetweenActivities) { - List result = new ArrayList(); + List result = new ArrayList(); // todo : do not collect changesets int each = findFirstObsoleteBlock(period, intervalBetweenActivities); try { while(each != 0) { @@ -155,7 +155,6 @@ public class ChangeListStorageImpl implements ChangeListStorage { return result; } - private int findFirstObsoleteBlock(long period, int intervalBetweenActivities) { long prevTimestamp = 0; long length = 0; @@ -178,8 +177,7 @@ public class ChangeListStorageImpl implements ChangeListStorage { return 0; } - - public void flush() { + public synchronized void flush() { myStorage.flushSome(); } } \ No newline at end of file diff --git a/platform/lvcs-impl/src/com/intellij/history/core/LinkedRecordsTable.java b/platform/lvcs-impl/src/com/intellij/history/core/LinkedRecordsTable.java index 5a40317b5a92..a49a7fd24b5d 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/LinkedRecordsTable.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/LinkedRecordsTable.java @@ -23,7 +23,7 @@ import java.io.File; import java.io.IOException; public class LinkedRecordsTable extends AbstractRecordsTable { - private static final int VERSION = 3; + private static final int VERSION = 4; private static final int ID_COUNTER_OFFSET = DEFAULT_HEADER_SIZE; private static final int FIRST_RECORD_OFFSET = ID_COUNTER_OFFSET + 8; @@ -62,6 +62,13 @@ public class LinkedRecordsTable extends AbstractRecordsTable { return ZEROS; } + @Override + protected void clearDeletedRecord(int record) { + setTimestamp(record, 0); + setNextRecord(record, 0); + setPrevRecord(record, 0); + } + public void setFSTimestamp(long timestamp) { markDirty(); myStorage.putLong(FS_TIMESTAMP_OFFSET, timestamp); @@ -77,7 +84,6 @@ public class LinkedRecordsTable extends AbstractRecordsTable { } public int getFirstRecord() { - markDirty(); return myStorage.getInt(FIRST_RECORD_OFFSET); } @@ -87,7 +93,6 @@ public class LinkedRecordsTable extends AbstractRecordsTable { } public int getLastRecord() { - markDirty(); return myStorage.getInt(LAST_RECORD_OFFSET); } diff --git a/platform/lvcs-impl/src/com/intellij/history/core/LinkedStorage.java b/platform/lvcs-impl/src/com/intellij/history/core/LinkedStorage.java index cbabb7082ddb..b4d3aa8f3de3 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/LinkedStorage.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/LinkedStorage.java @@ -55,6 +55,12 @@ public class LinkedStorage extends AbstractStorage { } } + public int getFirstRecord() { + synchronized (myLock) { + return ((LinkedRecordsTable)myRecordsTable).getFirstRecord(); + } + } + public int getLastRecord() { synchronized (myLock) { return ((LinkedRecordsTable)myRecordsTable).getLastRecord(); @@ -67,6 +73,12 @@ public class LinkedStorage extends AbstractStorage { } } + public int getNextRecord(int record) { + synchronized (myLock) { + return ((LinkedRecordsTable)myRecordsTable).getNextRecord(record); + } + } + public long getTimestamp(int record) { synchronized (myLock) { return ((LinkedRecordsTable)myRecordsTable).getTimestamp(record); diff --git a/platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/LinkedStorageTest.java b/platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/LinkedStorageTest.java new file mode 100644 index 000000000000..a3d058d32663 --- /dev/null +++ b/platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/LinkedStorageTest.java @@ -0,0 +1,147 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.historyIntegrTests; + +import com.intellij.history.core.LinkedStorage; +import com.intellij.util.io.storage.AbstractStorage; + +import java.io.DataInputStream; +import java.io.IOException; + +public class LinkedStorageTest extends IntegrationTestCase { + private LinkedStorage myStorage; + + @Override + public void setUp() throws Exception { + super.setUp(); + myStorage = new LinkedStorage(myRoot.getPath() + "/storage"); + } + + @Override + protected void tearDown() throws Exception { + myStorage.dispose(); + super.tearDown(); + } + + public void testBasic() throws Exception { + assertFirstAndLast(0, 0); + + int r1 = createRecord(); + int r2 = createRecord(); + + assertFirstAndLast(r1, r2); + assertRecord(r2, r1, 0); + assertRecord(r1, 0, r2); + } + + public void testDeletion() throws Exception { + int r1 = createRecord(); + int r2 = createRecord(); + int r3 = createRecord(); + + assertFirstAndLast(r1, r3); + assertRecord(r3, r2, 0); + assertRecord(r2, r1, r3); + assertRecord(r1, 0, r2); + + myStorage.deleteRecord(r2); + + assertFirstAndLast(r1, r3); + assertRecord(r3, r1, 0); + assertRecord(r1, 0, r3); + + myStorage.deleteRecord(r3); + + assertFirstAndLast(r1, r1); + assertRecord(r1, 0, 0); + + int r4 = createRecord(); + + assertFirstAndLast(r1, r4); + assertRecord(r4, r1, 0); + assertRecord(r1, 0, r4); + + myStorage.deleteRecord(r1); + + assertFirstAndLast(r4, r4); + assertRecord(r4, 0, 0); + + myStorage.deleteRecord(r4); + + assertFirstAndLast(0, 0); + } + + public void testReopening() throws Exception { + int r1 = createRecord(); + int r2 = createRecord(); + int r3 = createRecord(); + + myStorage.deleteRecord(r2); + + myStorage.dispose(); + myStorage = new LinkedStorage(myRoot.getPath() + "/storage"); + + assertFirstAndLast(r1, r3); + assertRecord(r3, r1, 0); + assertRecord(r1, 0, r3); + + myStorage.deleteRecord(r1); + + myStorage.dispose(); + myStorage = new LinkedStorage(myRoot.getPath() + "/storage"); + + assertFirstAndLast(r3, r3); + assertRecord(r3, 0, 0); + + int r4 = createRecord(); + + myStorage.dispose(); + myStorage = new LinkedStorage(myRoot.getPath() + "/storage"); + + assertFirstAndLast(r3, r4); + assertRecord(r4, r3, 0); + assertRecord(r3, 0, r4); + } + + private int createRecord() throws IOException { + int r = myStorage.createNextRecord(); + AbstractStorage.StorageDataOutput s = myStorage.writeStream(r); + for (int i = 0; i < 1000; i++) { + s.writeInt(r); + } + s.close(); + return r; + } + + private void assertFirstAndLast(int first, int last) { + assertEquals(first, myStorage.getFirstRecord()); + assertEquals(last, myStorage.getLastRecord()); + } + + private void assertRecord(int id, int prev, int next) throws IOException { + assertEquals(prev, myStorage.getPrevRecord(id)); + assertEquals(next, myStorage.getNextRecord(id)); + DataInputStream s = myStorage.readStream(id); + try { + for (int i = 0; i < 1000; i++) { + assertEquals(id, s.readInt()); + } + } + finally { + s.close(); + } + } +} diff --git a/platform/util/src/com/intellij/util/io/storage/AbstractRecordsTable.java b/platform/util/src/com/intellij/util/io/storage/AbstractRecordsTable.java index 04cac6518ffb..c02628e4030e 100644 --- a/platform/util/src/com/intellij/util/io/storage/AbstractRecordsTable.java +++ b/platform/util/src/com/intellij/util/io/storage/AbstractRecordsTable.java @@ -173,9 +173,12 @@ public abstract class AbstractRecordsTable implements Disposable, Forceable { public void deleteRecord(final int record) { ensureFreeRecordsScanned(); setSize(record, -1); + clearDeletedRecord(record); myFreeRecordsList.add(record); } + protected abstract void clearDeletedRecord(int record); + public int getVersion() { return myStorage.getInt(HEADER_VERSION_OFFSET); } diff --git a/platform/util/src/com/intellij/util/io/storage/RecordsTable.java b/platform/util/src/com/intellij/util/io/storage/RecordsTable.java index 3e53a9c4c1f2..0c6243937edc 100644 --- a/platform/util/src/com/intellij/util/io/storage/RecordsTable.java +++ b/platform/util/src/com/intellij/util/io/storage/RecordsTable.java @@ -47,4 +47,8 @@ class RecordsTable extends AbstractRecordsTable { protected byte[] getZeros() { return ZEROES; } + + @Override + protected void clearDeletedRecord(int record) { + } } diff --git a/platform/util/src/com/intellij/util/io/storage/RefCountingRecordsTable.java b/platform/util/src/com/intellij/util/io/storage/RefCountingRecordsTable.java index 025dc80e6d00..0b3bb50012a0 100644 --- a/platform/util/src/com/intellij/util/io/storage/RefCountingRecordsTable.java +++ b/platform/util/src/com/intellij/util/io/storage/RefCountingRecordsTable.java @@ -47,6 +47,11 @@ class RefCountingRecordsTable extends AbstractRecordsTable { return ZEROES; } + @Override + protected void clearDeletedRecord(int record) { + myStorage.putInt(getOffset(record, REF_COUNT_OFFSET), 0); + } + public void incRefCount(int record) { markDirty(); From 8e1b726f049e31d01839a5fc665deaf83a0ff1a5 Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Thu, 22 Apr 2010 14:49:31 +0400 Subject: [PATCH 09/16] logging for project reloading on external changes --- .../intellij/openapi/project/impl/ProjectManagerImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java index a1c0f774aeae..d71326a9e1c5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java @@ -110,6 +110,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt connection.subscribe(StateStorage.STORAGE_TOPIC, new StateStorage.Listener() { public void storageFileChanged(final VirtualFileEvent event, @NotNull final StateStorage storage) { VirtualFile file = event.getFile(); + LOG.info("[RELOAD] Storage file changed: " + file.getPath()); if (!file.isDirectory() && !(event.getRequestor() instanceof StateStorage.SaveSession)) { saveChangedProjectFile(file, null, storage); } @@ -535,6 +536,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt } private void askToReloadProjectIfConfigFilesChangedExternally() { + LOG.info("[RELOAD] myReloadBlockCount = " + myReloadBlockCount.get()); if (myReloadBlockCount.get() == 0) { Set projects; @@ -572,7 +574,6 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt ApplicationManager.getApplication().runWriteAction(new Runnable() { public void run() { try { - reloadOk[0] = ((ApplicationImpl)app).getStateStore().reload(causes, components); } catch (StateStorage.StateStorageException e) { @@ -639,6 +640,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt ApplicationManager.getApplication().runWriteAction(new Runnable() { public void run() { try { + LOG.info("[RELOAD] Reloading project/components..."); reloadOk[0] = ((ProjectEx)project).getStateStore().reload(causes); } catch (StateStorage.StateStorageException e) { @@ -725,6 +727,8 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt } private void registerProjectToReload(final Project project, final VirtualFile cause, final StateStorage storage) { + LOG.info("[RELOAD] Registering project to reload."); + if (project != null) { synchronized (myChangedProjectFiles) { List> changedProjectFiles = myChangedProjectFiles.get(project); @@ -743,6 +747,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt myChangedFilesAlarm.cancelAllRequests(); myChangedFilesAlarm.addRequest(new Runnable() { public void run() { + LOG.info("[RELOAD] Scheduling reload application & project, myReloadBlockCount = " + myReloadBlockCount); if (myReloadBlockCount.get() == 0) { scheduleReloadApplicationAndProject(); } From 68640d5efb4032af9637e2f7074fc40499c10318 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Thu, 22 Apr 2010 15:39:07 +0400 Subject: [PATCH 10/16] LH: directory history dialog UI improved --- .../history/integration/ui/views/DirectoryHistoryDialog.java | 1 - 1 file changed, 1 deletion(-) diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/DirectoryHistoryDialog.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/DirectoryHistoryDialog.java index aa5d3ab4007d..51bbfe1152ed 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/DirectoryHistoryDialog.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/DirectoryHistoryDialog.java @@ -81,7 +81,6 @@ public class DirectoryHistoryDialog extends HistoryDialog Date: Wed, 21 Apr 2010 17:12:08 +0400 Subject: [PATCH 11/16] added before event firing --- .../src/com/intellij/util/FileContentUtil.java | 13 +++++++------ .../src/com/intellij/openapi/vfs/VirtualFile.java | 7 ++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/platform/lang-api/src/com/intellij/util/FileContentUtil.java b/platform/lang-api/src/com/intellij/util/FileContentUtil.java index 5cf631476812..d627f9c15300 100644 --- a/platform/lang-api/src/com/intellij/util/FileContentUtil.java +++ b/platform/lang-api/src/com/intellij/util/FileContentUtil.java @@ -30,6 +30,7 @@ import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiManager; import gnu.trove.THashSet; +import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -42,7 +43,7 @@ import java.util.Set; * @author peter */ public class FileContentUtil { - public static final String FORCE_RELOAD_REQUESTOR = "FileContentUtil.saveOrReload"; + @NonNls public static final String FORCE_RELOAD_REQUESTOR = "FileContentUtil.saveOrReload"; private FileContentUtil() { } @@ -67,23 +68,23 @@ public class FileContentUtil { } public static void reparseFiles(@NotNull final Project project, @NotNull final Collection files, boolean includeOpenFiles) { - final Set list = new THashSet(); + final Set events = new THashSet(); for (VirtualFile file : files) { - saveOrReload(file, list); + saveOrReload(file, events); } if (includeOpenFiles) { for (VirtualFile open : FileEditorManager.getInstance(project).getOpenFiles()) { if (!files.contains(open)) { - saveOrReload(open, list); + saveOrReload(open, events); } } } ApplicationManager.getApplication().runWriteAction(new Runnable() { public void run() { ApplicationManager.getApplication().getMessageBus().syncPublisher(VirtualFileManager.VFS_CHANGES) - .before(new ArrayList(list)); + .before(new ArrayList(events)); ApplicationManager.getApplication().getMessageBus().syncPublisher(VirtualFileManager.VFS_CHANGES) - .after(new ArrayList(list)); + .after(new ArrayList(events)); } }); } diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/VirtualFile.java b/platform/platform-api/src/com/intellij/openapi/vfs/VirtualFile.java index f60217bfd97a..5f4c0337dda3 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/VirtualFile.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/VirtualFile.java @@ -24,6 +24,7 @@ import com.intellij.openapi.fileTypes.FileTypeManager; import com.intellij.openapi.util.*; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.encoding.EncodingManager; +import com.intellij.openapi.vfs.newvfs.BulkFileListener; import com.intellij.openapi.vfs.newvfs.events.VFilePropertyChangeEvent; import com.intellij.util.Icons; import org.jetbrains.annotations.NonNls; @@ -36,6 +37,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.charset.Charset; import java.util.Collections; +import java.util.List; /** * Represents a file in {@link VirtualFileSystem}. A particular file is represented by the same @@ -451,7 +453,10 @@ public abstract class VirtualFile extends UserDataHolderBase implements Modifica if (isValid() && !application.isDisposed()) { application.runWriteAction(new Runnable(){ public void run() { - application.getMessageBus().syncPublisher(VirtualFileManager.VFS_CHANGES).after(Collections.singletonList(new VFilePropertyChangeEvent(this, VirtualFile.this, PROP_ENCODING, old, charset, false))); + List events = Collections.singletonList(new VFilePropertyChangeEvent(this, VirtualFile.this, PROP_ENCODING, old, charset, false)); + BulkFileListener listener = application.getMessageBus().syncPublisher(VirtualFileManager.VFS_CHANGES); + listener.before(events); + listener.after(events); } }); } From 19444c3656577d06c9eb2faddd447af319bc17bf Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 22 Apr 2010 16:57:57 +0400 Subject: [PATCH 12/16] xdebugger: asynchronous fetching full value text --- .../frame/ImmediateFullValueEvaluator.java | 35 +++++++++++++ .../xdebugger/frame/XFullValueEvaluator.java | 52 +++++++++++++++++++ .../xdebugger/frame/XValueModifier.java | 2 +- .../intellij/xdebugger/frame/XValueNode.java | 7 ++- .../impl/evaluate/quick/XValueHint.java | 3 +- .../xdebugger/impl/ui/DebuggerUIUtil.java | 42 ++++++++++++--- .../impl/ui/tree/nodes/XValueNodeImpl.java | 18 +++---- 7 files changed, 134 insertions(+), 25 deletions(-) create mode 100644 platform/xdebugger-api/src/com/intellij/xdebugger/frame/ImmediateFullValueEvaluator.java create mode 100644 platform/xdebugger-api/src/com/intellij/xdebugger/frame/XFullValueEvaluator.java diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/ImmediateFullValueEvaluator.java b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/ImmediateFullValueEvaluator.java new file mode 100644 index 000000000000..0fc3366e35cc --- /dev/null +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/ImmediateFullValueEvaluator.java @@ -0,0 +1,35 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.xdebugger.frame; + +import org.jetbrains.annotations.NotNull; + +/** + * @author nik + */ +public class ImmediateFullValueEvaluator extends XFullValueEvaluator { + private String myFullValue; + + public ImmediateFullValueEvaluator(@NotNull String linkText, @NotNull String fullValue) { + super(linkText); + myFullValue = fullValue; + } + + @Override + public void startEvaluation(@NotNull XFullValueEvaluationCallback callback) { + callback.evaluated(myFullValue); + } +} diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XFullValueEvaluator.java b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XFullValueEvaluator.java new file mode 100644 index 000000000000..0c5483a1b5f0 --- /dev/null +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XFullValueEvaluator.java @@ -0,0 +1,52 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.xdebugger.frame; + +import org.jetbrains.annotations.NotNull; + +/** + * Supports asynchronous fetching full text of a value. If full text is already computed use {@link ImmediateFullValueEvaluator} + * @see XValueNode#setFullValueEvaluator + * @see ImmediateFullValueEvaluator + * + * @author nik + */ +public abstract class XFullValueEvaluator { + private String myLinkText; + + /** + * @param linkText text of the link what will be appended to a variables tree node text + */ + protected XFullValueEvaluator(@NotNull String linkText) { + myLinkText = linkText; + } + + /** + * Start fetching full text of the value. Note that this method is called from the Event Dispatch Thread so it should return quickly + * @param callback used to notify that the full text has been successfully evaluated or an error occurs + */ + public abstract void startEvaluation(@NotNull XFullValueEvaluationCallback callback); + + public String getLinkText() { + return myLinkText; + } + + public interface XFullValueEvaluationCallback { + void evaluated(@NotNull String fullValue); + + void errorOccurred(@NotNull String errorMessage); + } +} diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueModifier.java b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueModifier.java index e4f90b8fa1a6..d7889e7e9efc 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueModifier.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueModifier.java @@ -24,7 +24,7 @@ import org.jetbrains.annotations.Nullable; public abstract class XValueModifier { /** - * Start modification of the value. Note that this methods is called from the Event Dispatch Thread so it should return quickly + * Start modification of the value. Note that this method is called from the Event Dispatch Thread so it should return quickly * @param expression new value * @param callback used to notify that value has been successfully modified or an error occurs */ diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueNode.java b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueNode.java index de922b904dc5..941ae65c7f75 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueNode.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueNode.java @@ -38,9 +38,8 @@ public interface XValueNode extends Obsolescent { /** * If string representation of the value is too long to show in the tree pass truncated value to {@link #setPresentation(String, javax.swing.Icon, String, String, boolean)} * method and call this method to provide full value. - * This will add a link to the node and show fullValue text if a user click on that link. - * @param fullValue full text of the value. Will be shown in popup window - * @param linkText text of the link. Will be appended to the node text + * This will add a link to the node and show popup with full value if an user clicks on that link. + * @param fullValueEvaluator will be used to obtain full text of the value */ - void setFullValue(@NotNull String fullValue, @NotNull String linkText); + void setFullValueEvaluator(@NotNull XFullValueEvaluator fullValueEvaluator); } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XValueHint.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XValueHint.java index 4a6ceb994bf5..8797bde9ef4c 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XValueHint.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XValueHint.java @@ -30,6 +30,7 @@ import com.intellij.xdebugger.XDebugSession; import com.intellij.xdebugger.XDebuggerUtil; import com.intellij.xdebugger.XSourcePosition; import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; +import com.intellij.xdebugger.frame.XFullValueEvaluator; import com.intellij.xdebugger.frame.XValue; import com.intellij.xdebugger.frame.XValueNode; import com.intellij.xdebugger.impl.evaluate.quick.common.AbstractValueHint; @@ -90,7 +91,7 @@ public class XValueHint extends AbstractValueHint { }); } - public void setFullValue(@NotNull String fullValue, @NotNull String linkText) { + public void setFullValueEvaluator(@NotNull XFullValueEvaluator fullValueEvaluator) { //todo[nik] implement? } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java index 0e161a49bb30..c4272f80b0f7 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java @@ -25,6 +25,7 @@ import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.wm.WindowManager; import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.awt.RelativePoint; +import com.intellij.xdebugger.frame.XFullValueEvaluator; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -90,26 +91,51 @@ public class DebuggerUIUtil { return new RelativePoint(editor.getContentComponent(), p); } - public static void showValuePopup(@NotNull String text, @NotNull MouseEvent event, @NotNull Project project) { - JTextArea textArea = new JTextArea(text); + public static void showValuePopup(@NotNull XFullValueEvaluator text, @NotNull MouseEvent event, @NotNull Project project) { + final JTextArea textArea = new JTextArea("Evaluating..."); + text.startEvaluation(new FullValueEvaluationCallbackImpl(textArea)); + textArea.setEditable(false); textArea.setBackground(HintUtil.INFORMATION_COLOR); textArea.setLineWrap(false); final JScrollPane component = ScrollPaneFactory.createScrollPane(textArea); + final Dimension frameSize = WindowManager.getInstance().getFrame(project).getSize(); + final Dimension size = new Dimension(frameSize.width / 2, frameSize.height / 2); + component.setPreferredSize(size); component.setBorder(null); final JBPopup popup = JBPopupFactory.getInstance().createComponentPopupBuilder(component, null) .setResizable(true) .setMovable(true) + .setDimensionServiceKey(project, "XDebugger.FullValuePopup", false) .setRequestFocus(false) .createPopup(); - - final Dimension size = textArea.getPreferredSize(); final Component parentComponent = event.getComponent(); - final Dimension frameSize = WindowManager.getInstance().getFrame(project).getSize(); - size.width = Math.min(size.width, frameSize.width / 2); - size.height = Math.min(size.height, frameSize.height / 2); - component.setPreferredSize(size); RelativePoint point = new RelativePoint(parentComponent, new Point(event.getX()-size.width, event.getY()-size.height)); popup.show(point); } + + private static class FullValueEvaluationCallbackImpl implements XFullValueEvaluator.XFullValueEvaluationCallback { + private final JTextArea myTextArea; + + public FullValueEvaluationCallbackImpl(JTextArea textArea) { + myTextArea = textArea; + } + + public void evaluated(@NotNull final String fullValue) { + invokeOnEventDispatch(new Runnable() { + public void run() { + myTextArea.setText(fullValue); + } + }); + } + + public void errorOccurred(@NotNull final String errorMessage) { + invokeOnEventDispatch(new Runnable() { + public void run() { + myTextArea.setForeground(XDebuggerUIConstants.ERROR_MESSAGE_ATTRIBUTES.getFgColor()); + myTextArea.setText(errorMessage); + } + }); + } + } } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java index 98578803c47a..f21546849afe 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java @@ -20,6 +20,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.StringBuilderSpinAllocator; import com.intellij.xdebugger.frame.XCompositeNode; +import com.intellij.xdebugger.frame.XFullValueEvaluator; import com.intellij.xdebugger.frame.XValue; import com.intellij.xdebugger.frame.XValueNode; import com.intellij.xdebugger.impl.ui.DebuggerUIUtil; @@ -39,10 +40,9 @@ public class XValueNodeImpl extends XValueContainerNode implements XValu private String myName; private String myType; private String myValue; - private String myFullValue; + private XFullValueEvaluator myFullValueEvaluator; private String mySeparator; private boolean myChanged; - private String myLinkText; public XValueNodeImpl(XDebuggerTree tree, final XDebuggerTreeNode parent, final XValue value) { super(tree, parent, value); @@ -74,11 +74,10 @@ public class XValueNodeImpl extends XValueContainerNode implements XValu }); } - public void setFullValue(@NotNull final String fullValue, @NotNull final String linkText) { + public void setFullValueEvaluator(@NotNull final XFullValueEvaluator fullValueEvaluator) { DebuggerUIUtil.invokeOnEventDispatch(new Runnable() { public void run() { - myLinkText = linkText; - myFullValue = fullValue; + myFullValueEvaluator = fullValueEvaluator; fireNodeChanged(); } }); @@ -122,11 +121,11 @@ public class XValueNodeImpl extends XValueContainerNode implements XValu @Override public XDebuggerNodeLink getLink() { - if (myFullValue != null) { - return new XDebuggerNodeLink(myLinkText) { + if (myFullValueEvaluator != null) { + return new XDebuggerNodeLink(myFullValueEvaluator.getLinkText()) { @Override public void onClick(MouseEvent event) { - DebuggerUIUtil.showValuePopup(myFullValue, event, myTree.getProject()); + DebuggerUIUtil.showValuePopup(myFullValueEvaluator, event, myTree.getProject()); } }; } @@ -135,9 +134,6 @@ public class XValueNodeImpl extends XValueContainerNode implements XValu @Nullable public String getValue() { - if (myFullValue != null) { - return myFullValue; - } return myValue; } From 9a13cb9aee10df364a8fcf000b261102eff50587 Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Thu, 22 Apr 2010 14:43:59 +0400 Subject: [PATCH 13/16] cosmetics --- .../execution/process/CommandLineArgumentsProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/platform-api/src/com/intellij/execution/process/CommandLineArgumentsProvider.java b/platform/platform-api/src/com/intellij/execution/process/CommandLineArgumentsProvider.java index e0f2d9cd622c..68d99ba6bb54 100644 --- a/platform/platform-api/src/com/intellij/execution/process/CommandLineArgumentsProvider.java +++ b/platform/platform-api/src/com/intellij/execution/process/CommandLineArgumentsProvider.java @@ -20,7 +20,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Map; /** - * @author oleg + * @author Roman.Chernyatchik, oleg */ public interface CommandLineArgumentsProvider { /** From 06424d4332343ded566d5f9a28f900ac18d20abb Mon Sep 17 00:00:00 2001 From: "Rustam.Vishnyakov" Date: Thu, 22 Apr 2010 17:23:55 +0400 Subject: [PATCH 14/16] Merged from 9.0.x (Maia) branch --- .../intellij/psi/formatter/FormatterUtil.java | 20 ++++++ .../intellij/psi/formatter/WrappingUtil.java | 72 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 platform/lang-impl/src/com/intellij/psi/formatter/WrappingUtil.java 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 ccd6e4f7db62..b405b0ebbb00 100644 --- a/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java +++ b/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java @@ -19,10 +19,12 @@ import com.intellij.lang.ASTFactory; import com.intellij.lang.ASTNode; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiWhiteSpace; import com.intellij.psi.TokenType; import com.intellij.psi.impl.source.SourceTreeToPsiMap; import com.intellij.psi.impl.source.tree.*; import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; import com.intellij.util.CharTable; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.Nullable; @@ -248,4 +250,22 @@ public class FormatterUtil { return true; } + public static boolean isPrecededBy(ASTNode node, IElementType eType) { + ASTNode prevNode = node.getTreePrev(); + while (prevNode != null && prevNode.getPsi() instanceof PsiWhiteSpace) { + prevNode = prevNode.getTreePrev(); + } + if (prevNode == null) return false; + return prevNode.getElementType() == eType; + } + + public static boolean isPrecededBy(ASTNode node, TokenSet tokens) { + ASTNode prevNode = node.getTreePrev(); + while (prevNode != null && prevNode.getPsi() instanceof PsiWhiteSpace) { + prevNode = prevNode.getTreePrev(); + } + if (prevNode == null) return false; + return tokens.contains(prevNode.getElementType()); + } + } diff --git a/platform/lang-impl/src/com/intellij/psi/formatter/WrappingUtil.java b/platform/lang-impl/src/com/intellij/psi/formatter/WrappingUtil.java new file mode 100644 index 000000000000..bfc480c5f688 --- /dev/null +++ b/platform/lang-impl/src/com/intellij/psi/formatter/WrappingUtil.java @@ -0,0 +1,72 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.psi.formatter; + +import com.intellij.formatting.Wrap; +import com.intellij.formatting.WrapType; +import com.intellij.lang.ASTNode; +import com.intellij.psi.codeStyle.CodeStyleSettings; +import com.intellij.psi.tree.IElementType; + +/** + * Misc. code wrapping functions + * @author rvishnyakov + */ +public class WrappingUtil { + + private WrappingUtil() { + } + + public static boolean shouldWrap(int setting) { + return setting != CodeStyleSettings.DO_NOT_WRAP; + } + + public static Wrap createWrap(int setting) { + return Wrap.createWrap(getWrapType(setting), true); + } + + public static WrapType getWrapType(int setting) { + switch (setting) { + case CodeStyleSettings.WRAP_ALWAYS: + return WrapType.ALWAYS; + case CodeStyleSettings.WRAP_AS_NEEDED: + return WrapType.NORMAL; + case CodeStyleSettings.DO_NOT_WRAP: + return WrapType.NONE; + default: + return WrapType.CHOP_DOWN_IF_LONG; + } + } + + public static WrapType getArrayInitializerWrapType(CodeStyleSettings settings, + ASTNode node, + IElementType lBraceType, + IElementType rBraceType) { + WrapType wrapType = WrapType.NONE; + if (shouldWrap(settings.ARRAY_INITIALIZER_WRAP)) { + if (node.getElementType() == rBraceType) { + wrapType = settings.ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE ? Wrap.ALWAYS : Wrap.NONE; + } + else if (FormatterUtil.isPrecededBy(node, lBraceType)) { + wrapType = settings.ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE ? Wrap.ALWAYS : Wrap.NONE; + } + else { + wrapType = WrappingUtil.getWrapType(settings.ARRAY_INITIALIZER_WRAP); + } + } + return wrapType; + } +} From aeb1872f2cd2cf3c537a9370558414d80a014343 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 22 Apr 2010 17:42:31 +0400 Subject: [PATCH 15/16] fix 'square' symbols in framework support wizard dialog --- platform/platform-api/src/com/intellij/ui/GuiUtils.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/platform-api/src/com/intellij/ui/GuiUtils.java b/platform/platform-api/src/com/intellij/ui/GuiUtils.java index ff7db4427a67..8a6a90c84908 100644 --- a/platform/platform-api/src/com/intellij/ui/GuiUtils.java +++ b/platform/platform-api/src/com/intellij/ui/GuiUtils.java @@ -24,6 +24,7 @@ import com.intellij.openapi.ui.FixedSizeButton; import com.intellij.openapi.ui.Splitter; import com.intellij.openapi.ui.TextFieldWithBrowseButton; import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.CharFilter; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; @@ -50,6 +51,11 @@ public class GuiUtils { private static final Insets paddingInsideDialog = new Insets(5, 5, 5, 5); public static final int lengthForFileField = 25; + private static final CharFilter NOT_MNEMONIC_CHAR_FILTER = new CharFilter() { + public boolean accept(char ch) { + return ch != '&' && ch != UIUtil.MNEMONIC; + } + }; public static JPanel constructFieldWithBrowseButton(JComponent aComponent, ActionListener aActionListener) { return constructFieldWithBrowseButton(aComponent, aActionListener, 0); @@ -187,7 +193,7 @@ public class GuiUtils { } public static String getTextWithoutMnemonicEscaping(String text) { - return text.replaceAll("&", ""); + return StringUtil.strip(text, NOT_MNEMONIC_CHAR_FILTER); } public static char getDisplayedMnemonic(String text) { From a4191ba2513e5a9b4a0ecf4b9c82e23e45b13668 Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Thu, 22 Apr 2010 17:52:41 +0400 Subject: [PATCH 16/16] fix keymap test --- .../platform-resources/src/idea/Keymap_Eclipse.xml | 10 ++-------- platform/platform-resources/src/idea/Keymap_Emacs.xml | 2 +- platform/platform-resources/src/idea/Keymap_KDE.xml | 2 +- .../platform-resources/src/idea/Keymap_Netbeans.xml | 10 +++------- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/platform/platform-resources/src/idea/Keymap_Eclipse.xml b/platform/platform-resources/src/idea/Keymap_Eclipse.xml index de8626efc763..6108e7648f1a 100644 --- a/platform/platform-resources/src/idea/Keymap_Eclipse.xml +++ b/platform/platform-resources/src/idea/Keymap_Eclipse.xml @@ -22,19 +22,13 @@ - - - - + - - - - + diff --git a/platform/platform-resources/src/idea/Keymap_Emacs.xml b/platform/platform-resources/src/idea/Keymap_Emacs.xml index bd928b8b397a..7025ec286e34 100644 --- a/platform/platform-resources/src/idea/Keymap_Emacs.xml +++ b/platform/platform-resources/src/idea/Keymap_Emacs.xml @@ -224,7 +224,7 @@ - + diff --git a/platform/platform-resources/src/idea/Keymap_KDE.xml b/platform/platform-resources/src/idea/Keymap_KDE.xml index 377d5c094ff6..0751bed27d80 100644 --- a/platform/platform-resources/src/idea/Keymap_KDE.xml +++ b/platform/platform-resources/src/idea/Keymap_KDE.xml @@ -6,7 +6,7 @@ - + diff --git a/platform/platform-resources/src/idea/Keymap_Netbeans.xml b/platform/platform-resources/src/idea/Keymap_Netbeans.xml index 93095e74205f..024c60ceed38 100644 --- a/platform/platform-resources/src/idea/Keymap_Netbeans.xml +++ b/platform/platform-resources/src/idea/Keymap_Netbeans.xml @@ -42,20 +42,16 @@ - - - + - + - - - +