From fef33cf2193a878464f41b89396c3adc324428d7 Mon Sep 17 00:00:00 2001 From: Michail Plushnikov Date: Thu, 3 Oct 2019 15:33:54 +0200 Subject: [PATCH] merged with changes from master --- gradle.properties | 4 ++-- .../generate/LombokGenerateConstructorHandler.java | 2 +- .../plugin/language/LombokConfigParserDefinition.java | 5 +++++ .../plugin/AbstractLombokLightCodeInsightTestCase.java | 5 ++--- .../intellij/plugin/inspection/LombokInspectionTest.java | 9 +++------ .../postfix/NonIdempotentComputationIssue670Test.java | 3 --- .../processor/modifier/UtilityClassModifierTest.java | 4 ++-- .../plugin/processor/modifier/ValModifierTest.java | 4 ++-- .../plugin/processor/modifier/ValueModifierTest.java | 4 ++-- .../plugin/processor/modifier/VarModifierTest.java | 4 ++-- 10 files changed, 21 insertions(+), 23 deletions(-) diff --git a/gradle.properties b/gradle.properties index 97b31618e..f45ee8e7b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,11 +2,11 @@ # https://www.jetbrains.com/intellij-repository/releases # https://www.jetbrains.com/intellij-repository/snapshots # -#ideaVersion=2018.1 +ideaVersion=2018.1 #ideaVersion=2018.2 #ideaVersion=2018.3.5 #ideaVersion=2019.1 -ideaVersion=2019.1.4 +#ideaVersion=2019.1.4 # pluginGroup=de.plushnikov.intellij.plugin pluginName=lombok-plugin diff --git a/src/main/java/de/plushnikov/intellij/plugin/action/generate/LombokGenerateConstructorHandler.java b/src/main/java/de/plushnikov/intellij/plugin/action/generate/LombokGenerateConstructorHandler.java index 38c66cb53..05c9db872 100644 --- a/src/main/java/de/plushnikov/intellij/plugin/action/generate/LombokGenerateConstructorHandler.java +++ b/src/main/java/de/plushnikov/intellij/plugin/action/generate/LombokGenerateConstructorHandler.java @@ -26,7 +26,7 @@ public class LombokGenerateConstructorHandler extends GenerateConstructorHandler protected ClassMember[] getAllOriginalMembers(PsiClass aClass) { PsiField[] fields = aClass.getFields(); ArrayList array = new ArrayList<>(); - List implicitUsageProviders = ImplicitUsageProvider.EP_NAME.getExtensionList(); + ImplicitUsageProvider[] implicitUsageProviders = ImplicitUsageProvider.EP_NAME.getExtensions(); fieldLoop: for (PsiField field : fields) { if (field.hasModifierProperty(PsiModifier.STATIC)) { diff --git a/src/main/java/de/plushnikov/intellij/plugin/language/LombokConfigParserDefinition.java b/src/main/java/de/plushnikov/intellij/plugin/language/LombokConfigParserDefinition.java index 6ba70fa90..4e7548823 100644 --- a/src/main/java/de/plushnikov/intellij/plugin/language/LombokConfigParserDefinition.java +++ b/src/main/java/de/plushnikov/intellij/plugin/language/LombokConfigParserDefinition.java @@ -58,6 +58,11 @@ public PsiFile createFile(FileViewProvider viewProvider) { return new LombokConfigFile(viewProvider); } + @Override + public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode left, ASTNode right) { + return SpaceRequirements.MAY; + } + @NotNull public PsiElement createElement(ASTNode node) { return LombokConfigTypes.Factory.createElement(node); diff --git a/src/test/java/de/plushnikov/intellij/plugin/AbstractLombokLightCodeInsightTestCase.java b/src/test/java/de/plushnikov/intellij/plugin/AbstractLombokLightCodeInsightTestCase.java index 1351fa758..8cf951475 100644 --- a/src/test/java/de/plushnikov/intellij/plugin/AbstractLombokLightCodeInsightTestCase.java +++ b/src/test/java/de/plushnikov/intellij/plugin/AbstractLombokLightCodeInsightTestCase.java @@ -5,16 +5,15 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; import com.intellij.testFramework.LightProjectDescriptor; -import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; -import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; -import com.intellij.util.PathUtil; import junit.framework.ComparisonFailure; import org.jetbrains.annotations.NotNull; import java.io.File; import java.io.IOException; +import static com.intellij.testFramework.LightPlatformTestCase.getModule; + public abstract class AbstractLombokLightCodeInsightTestCase extends LightCodeInsightFixtureTestCase { @Override diff --git a/src/test/java/de/plushnikov/intellij/plugin/inspection/LombokInspectionTest.java b/src/test/java/de/plushnikov/intellij/plugin/inspection/LombokInspectionTest.java index 176ded47c..093b2146a 100644 --- a/src/test/java/de/plushnikov/intellij/plugin/inspection/LombokInspectionTest.java +++ b/src/test/java/de/plushnikov/intellij/plugin/inspection/LombokInspectionTest.java @@ -1,15 +1,12 @@ package de.plushnikov.intellij.plugin.inspection; -import com.intellij.openapi.util.registry.Registry; import com.intellij.testFramework.LightProjectDescriptor; -import com.siyeh.ig.LightJavaInspectionTestCase; -import de.plushnikov.intellij.plugin.LombokTestUtil; -import com.intellij.testFramework.PsiTestUtil; -import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; -import com.intellij.util.PathUtil; import com.siyeh.ig.LightInspectionTestCase; +import de.plushnikov.intellij.plugin.LombokTestUtil; import org.jetbrains.annotations.NotNull; +import static com.intellij.testFramework.LightPlatformTestCase.getModule; + public abstract class LombokInspectionTest extends LightInspectionTestCase { static final String TEST_DATA_INSPECTION_DIRECTORY = "testData/inspection"; diff --git a/src/test/java/de/plushnikov/intellij/plugin/postfix/NonIdempotentComputationIssue670Test.java b/src/test/java/de/plushnikov/intellij/plugin/postfix/NonIdempotentComputationIssue670Test.java index 64737bd89..eb327646b 100644 --- a/src/test/java/de/plushnikov/intellij/plugin/postfix/NonIdempotentComputationIssue670Test.java +++ b/src/test/java/de/plushnikov/intellij/plugin/postfix/NonIdempotentComputationIssue670Test.java @@ -1,6 +1,5 @@ package de.plushnikov.intellij.plugin.postfix; -import com.intellij.openapi.util.registry.Registry; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiMethod; import de.plushnikov.intellij.plugin.AbstractLombokLightCodeInsightTestCase; @@ -12,8 +11,6 @@ public class NonIdempotentComputationIssue670Test extends AbstractLombokLightCodeInsightTestCase { public void testIssue670() { - Registry.get("platform.random.idempotence.check.rate").setValue(1, getTestRootDisposable()); - myFixture.configureByFile((getBasePath() + "/postfix/issue670/" + getTestName(false)) + ".java"); final PsiMethod[] firstCallGetMethods = myFixture.findClass("Issue670").getMethods(); diff --git a/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/UtilityClassModifierTest.java b/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/UtilityClassModifierTest.java index 56a7695be..818b4a9e7 100644 --- a/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/UtilityClassModifierTest.java +++ b/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/UtilityClassModifierTest.java @@ -7,12 +7,12 @@ import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiModifier; import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; +import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; /** * @author Florian Böhm */ -public class UtilityClassModifierTest extends LightJavaCodeInsightFixtureTestCase { +public class UtilityClassModifierTest extends LightCodeInsightFixtureTestCase { @Override protected String getTestDataPath() { diff --git a/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/ValModifierTest.java b/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/ValModifierTest.java index 3c283254f..7c091af74 100644 --- a/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/ValModifierTest.java +++ b/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/ValModifierTest.java @@ -6,12 +6,12 @@ import com.intellij.psi.PsiModifier; import com.intellij.psi.PsiType; import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; +import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; /** * @author Alexej Kubarev */ -public class ValModifierTest extends LightJavaCodeInsightFixtureTestCase { +public class ValModifierTest extends LightCodeInsightFixtureTestCase { @Override protected String getTestDataPath() { diff --git a/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/ValueModifierTest.java b/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/ValueModifierTest.java index 14688405a..3e891b0fa 100644 --- a/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/ValueModifierTest.java +++ b/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/ValueModifierTest.java @@ -6,12 +6,12 @@ import com.intellij.psi.PsiModifier; import com.intellij.psi.PsiModifierList; import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; +import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; /** * @author Alexej Kubarev */ -public class ValueModifierTest extends LightJavaCodeInsightFixtureTestCase { +public class ValueModifierTest extends LightCodeInsightFixtureTestCase { @Override protected String getTestDataPath() { diff --git a/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/VarModifierTest.java b/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/VarModifierTest.java index 3f7a0e234..64f946054 100644 --- a/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/VarModifierTest.java +++ b/src/test/java/de/plushnikov/intellij/plugin/processor/modifier/VarModifierTest.java @@ -6,12 +6,12 @@ import com.intellij.psi.PsiModifier; import com.intellij.psi.PsiPrimitiveType; import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; +import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; /** * @author Alexej Kubarev */ -public class VarModifierTest extends LightJavaCodeInsightFixtureTestCase { +public class VarModifierTest extends LightCodeInsightFixtureTestCase { @Override protected String getTestDataPath() {