From ea08920aee5c90f2a02ec7099599000fda98615d Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Mon, 23 Mar 2020 15:19:59 +0700 Subject: [PATCH] Inline descriptions for soutc, serrc; FQN for java.lang.System Review ID: IDEA-CR-60451 GitOrigin-RevId: c50adbdaeb66256e8e09b37d618eb84169c69c09 --- .../template/SerrConsumerConflict-out.java | 8 ++++++++ .../template/SerrConsumerConflict.java | 8 ++++++++ .../template/JavaLiveTemplateTest.groovy | 6 ++++++ .../messages/CodeInsightBundle.properties | 2 -- resources/src/liveTemplates/output.xml | 18 ++++++++---------- 5 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 java/java-tests/testData/codeInsight/template/SerrConsumerConflict-out.java create mode 100644 java/java-tests/testData/codeInsight/template/SerrConsumerConflict.java diff --git a/java/java-tests/testData/codeInsight/template/SerrConsumerConflict-out.java b/java/java-tests/testData/codeInsight/template/SerrConsumerConflict-out.java new file mode 100644 index 000000000000..8eceabd95384 --- /dev/null +++ b/java/java-tests/testData/codeInsight/template/SerrConsumerConflict-out.java @@ -0,0 +1,8 @@ +import java.util.List; + +class System { + + static void foo(List ls) { + ls.forEach(java.lang.System.err::println); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/template/SerrConsumerConflict.java b/java/java-tests/testData/codeInsight/template/SerrConsumerConflict.java new file mode 100644 index 000000000000..ebeca652d2a3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/template/SerrConsumerConflict.java @@ -0,0 +1,8 @@ +import java.util.List; + +class System { + + static void foo(List ls) { + ls.forEach(); + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.groovy b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.groovy index c7bd13bcf35d..f235ece2f279 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.groovy +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.groovy @@ -245,6 +245,12 @@ class Outer { checkResult() } + void testSerrConsumerConflict() { + configure() + startTemplate("serrc", "output") + checkResult() + } + private boolean isApplicable(String text, TemplateImpl inst) throws IOException { myFixture.configureByText("a.java", text) return TemplateManagerImpl.isApplicable(myFixture.getFile(), getEditor().getCaretModel().getOffset(), inst) diff --git a/platform/lang-api/resources/messages/CodeInsightBundle.properties b/platform/lang-api/resources/messages/CodeInsightBundle.properties index b6b26eaa4066..9a4beae7f25b 100644 --- a/platform/lang-api/resources/messages/CodeInsightBundle.properties +++ b/platform/lang-api/resources/messages/CodeInsightBundle.properties @@ -282,9 +282,7 @@ livetemplate.description.if.not.null=Inserts 'if not null' statement livetemplate.description.if.null=Inserts 'if null' statement livetemplate.description.geti=Inserts singleton method getInstance livetemplate.description.serr=Prints a string to System.err -livetemplate.description.serrc=System.err::println livetemplate.description.sout=Prints a string to System.out -livetemplate.description.soutc=System.out::println livetemplate.description.souf=Prints a formatted string to System.out livetemplate.description.soutm=Prints current class and method names to System.out livetemplate.description.soutp=Prints method parameter names and values to System.out diff --git a/resources/src/liveTemplates/output.xml b/resources/src/liveTemplates/output.xml index 0351307ac9df..b069aeec2757 100644 --- a/resources/src/liveTemplates/output.xml +++ b/resources/src/liveTemplates/output.xml @@ -1,42 +1,40 @@ -