From 355653197137d19ebc48675811b0062b4db900c4 Mon Sep 17 00:00:00 2001 From: Cedric Ziel Date: Sat, 27 Nov 2021 15:32:54 +0100 Subject: [PATCH] Upgrade to platform 213 (#359) --- .github/workflows/build.yml | 15 +++++++++++++ .github/workflows/release.yml | 7 ++++++ CHANGELOG.md | 2 +- build.gradle | 22 +++++++++++-------- gradle.properties | 20 ++++++++++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- .../idea/fluid/AbstractFluidTest.java | 2 ++ .../idea/typo3/annotation/RouteAnnotator.java | 17 +++++++++----- .../annotation/PathResourceAnnotator.java | 7 +++++- .../translation/AbstractTranslationTest.java | 2 ++ 10 files changed, 73 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 791db25b..1127e06a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,13 @@ jobs: grammar_kit_plugin_version: "2021.1.3" since_build: "212" until_build: "212.*" + - idea_version: "IU-213.5744.202-EAP-SNAPSHOT" + java_version: "11" + php_plugin_version: "213.5744.206" + psi_viewer_plugin_version: "213-SNAPSHOT" + grammar_kit_plugin_version: "2021.1.3" + since_build: "213" + until_build: "213.*" steps: @@ -102,6 +109,13 @@ jobs: grammar_kit_plugin_version: "2021.1.3" since_build: "212" until_build: "212.*" + - idea_version: "IU-213.5744.202-EAP-SNAPSHOT" + java_version: "11" + php_plugin_version: "213.5744.206" + psi_viewer_plugin_version: "213-SNAPSHOT" + grammar_kit_plugin_version: "2021.1.3" + since_build: "213" + until_build: "213.*" outputs: cms-name: ${{ steps.properties.outputs.cms-name }} @@ -295,6 +309,7 @@ jobs: matrix: include: - since_build: "212" + - since_build: "213" steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7158ae6a..a342d6e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,13 @@ jobs: grammar_kit_plugin_version: "2021.1.3" since_build: "212" until_build: "212.*" + - idea_version: "IU-213.5744.202-EAP-SNAPSHOT" + java_version: "11" + php_plugin_version: "213.5744.206" + psi_viewer_plugin_version: "213-SNAPSHOT" + grammar_kit_plugin_version: "2021.1.3" + since_build: "213" + until_build: "213.*" outputs: prefixed-version: ${{ steps.properties.outputs.prefixed-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f7e5bc0..a518b0e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## [Unreleased] ### Added - +- Upgrade to platform 213 ### Changed - migrate checkHighlight to testHighlight where possible - migrate away from using FileTypeIndex.NAME directly diff --git a/build.gradle b/build.gradle index 2055f98f..23c43f42 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat plugins { - id "org.jetbrains.intellij" version "1.1.6" apply false + id "org.jetbrains.intellij" version "1.3.0" apply false + id 'java' id "org.jetbrains.grammarkit" version "${grammarKitPluginVersion}" apply false id 'org.jetbrains.changelog' version '1.1.1' } repositories { mavenCentral() - jcenter() } def htmlFixer = { htmlFile -> file(htmlFile).text.replace('', '').replace('', '') } @@ -16,6 +16,10 @@ def htmlFixer = { htmlFile -> file(htmlFile).text.replace('', '').replace( group pluginGroup allprojects { + repositories { + mavenCentral() + } + apply plugin: 'java' apply plugin: 'org.jetbrains.changelog' @@ -24,6 +28,11 @@ allprojects { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } version = pluginVersion + + test { + scanForTestClasses false + include "**/*Test.class" + } } subprojects { @@ -32,12 +41,6 @@ subprojects { apply plugin: 'java' apply plugin: 'org.jetbrains.grammarkit' - repositories { - mavenCentral() - jcenter() - maven { url 'https://jitpack.io' } - } - changelog { version = pluginVersion path = "${project.rootProject.projectDir}/CHANGELOG.md" @@ -73,6 +76,7 @@ subprojects { grammarKit { jflexRelease = jFlexRelease + grammarKitRelease = grammarKitVersion } runPluginVerifier { @@ -83,7 +87,7 @@ subprojects { } wrapper { - gradleVersion '7.2' + gradleVersion '7.3' } test.testLogging.exceptionFormat = TestExceptionFormat.FULL diff --git a/gradle.properties b/gradle.properties index dd4c3118..e617480f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,14 +10,22 @@ javaTargetVersion = 1.11 jFlexRelease = 1.7.0-1 -pluginVerifierIdeVersions = 2021.2 +pluginVerifierIdeVersions = 2021.2,2021.3 grammarKitPluginVersion = 2021.1.3 -ideaVersion = IU-2021.2.2 -phpPluginVersion = 212.5284.49 -psiViewerPluginVersion = 212-SNAPSHOT -customSinceBuild=212 -customUntilBuild=212.* +grammarKitVersion = 2021.1.2 +ideaVersion = IU-213.5744.202-EAP-SNAPSHOT +phpPluginVersion = 213.5744.206 +psiViewerPluginVersion = 213-SNAPSHOT +customSinceBuild=213 +customUntilBuild=213.* + +#grammarKitPluginVersion = 2021.1.3 +#ideaVersion = IU-2021.2.2 +#phpPluginVersion = 212.5284.49 +#psiViewerPluginVersion = 212-SNAPSHOT +#customSinceBuild=212 +#customUntilBuild=212.* #grammarKitPluginVersion = 2020.2.1 #ideaVersion = IU-2021.1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a25..e750102e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/lang-fluid/src/test/java/com/cedricziel/idea/fluid/AbstractFluidTest.java b/lang-fluid/src/test/java/com/cedricziel/idea/fluid/AbstractFluidTest.java index 4eead7b8..c033e1bf 100644 --- a/lang-fluid/src/test/java/com/cedricziel/idea/fluid/AbstractFluidTest.java +++ b/lang-fluid/src/test/java/com/cedricziel/idea/fluid/AbstractFluidTest.java @@ -11,9 +11,11 @@ import com.intellij.psi.util.PsiTreeUtil; import com.intellij.testFramework.fixtures.BasePlatformTestCase; import org.jetbrains.annotations.NotNull; +import org.junit.Ignore; import java.util.List; +@Ignore abstract public class AbstractFluidTest extends BasePlatformTestCase { @Override public void setUp() throws Exception { diff --git a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/annotation/RouteAnnotator.java b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/annotation/RouteAnnotator.java index 6d95caed..21d45454 100644 --- a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/annotation/RouteAnnotator.java +++ b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/annotation/RouteAnnotator.java @@ -3,10 +3,10 @@ import com.cedricziel.idea.typo3.TYPO3CMSProjectSettings; import com.cedricziel.idea.typo3.index.RouteIndex; import com.cedricziel.idea.typo3.routing.RouteReference; -import com.intellij.lang.annotation.Annotation; +import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.lang.annotation.AnnotationHolder; import com.intellij.lang.annotation.Annotator; -import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiReference; @@ -50,11 +50,18 @@ private void annotateRoute(@NotNull PsiElement psiElement, @NotNull AnnotationHo if (allKeys.contains(value)) { TextRange range = new TextRange(psiElement.getTextRange().getStartOffset(), psiElement.getTextRange().getEndOffset()); - Annotation annotation = annotationHolder.createInfoAnnotation(range, null); - annotation.setTextAttributes(DefaultLanguageHighlighterColors.STRING); + annotationHolder + .newAnnotation(HighlightSeverity.INFORMATION, "") + .range(range) + .highlightType(ProblemHighlightType.INFORMATION) + .create(); } else { TextRange range = new TextRange(psiElement.getTextRange().getStartOffset() + 1, psiElement.getTextRange().getEndOffset() - 1); - annotationHolder.createWeakWarningAnnotation(range, "Unresolved route"); + annotationHolder + .newAnnotation(HighlightSeverity.WEAK_WARNING, "Unresolved route") + .range(range) + .highlightType(ProblemHighlightType.WEAK_WARNING) + .create(); } } } diff --git a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/resources/annotation/PathResourceAnnotator.java b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/resources/annotation/PathResourceAnnotator.java index 50c105d0..1d6a2b22 100644 --- a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/resources/annotation/PathResourceAnnotator.java +++ b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/resources/annotation/PathResourceAnnotator.java @@ -1,8 +1,10 @@ package com.cedricziel.idea.typo3.resources.annotation; import com.cedricziel.idea.typo3.index.ResourcePathIndex; +import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.lang.annotation.AnnotationHolder; import com.intellij.lang.annotation.Annotator; +import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.psi.PsiElement; import com.jetbrains.php.lang.psi.elements.StringLiteralExpression; import org.jetbrains.annotations.NotNull; @@ -60,6 +62,9 @@ private String getContents(@NotNull PsiElement element) { private void createErrorMessage(@NotNull PsiElement element, @NotNull AnnotationHolder holder, String resourceName) { String message = "Resource \"%s\" could not be found in your current project.".replace("%s", resourceName); - holder.createWarningAnnotation(element, message); + holder + .newAnnotation(HighlightSeverity.WARNING, message) + .highlightType(ProblemHighlightType.WARNING) + .create(); } } diff --git a/typo3-cms/src/test/java/com/cedricziel/idea/typo3/translation/AbstractTranslationTest.java b/typo3-cms/src/test/java/com/cedricziel/idea/typo3/translation/AbstractTranslationTest.java index 6f68dd10..45fe2a2e 100644 --- a/typo3-cms/src/test/java/com/cedricziel/idea/typo3/translation/AbstractTranslationTest.java +++ b/typo3-cms/src/test/java/com/cedricziel/idea/typo3/translation/AbstractTranslationTest.java @@ -6,7 +6,9 @@ import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.fileTypes.FileTypeManager; import com.intellij.util.indexing.FileBasedIndex; +import org.junit.Ignore; +@Ignore abstract public class AbstractTranslationTest extends AbstractTestCase { @Override protected void setUp() throws Exception {