diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d392acc8..29d579bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,12 +37,12 @@ jobs: strategy: matrix: include: - - idea_version: "IU-2022.2.4" - php_plugin_version: "222.4345.15" - psi_viewer_plugin_version: "222-SNAPSHOT" + - idea_version: "IU-2022.3" + php_plugin_version: "223.7571.231" + psi_viewer_plugin_version: "223-SNAPSHOT" grammar_kit_plugin_version: "2021.2.2" - since_build: "222" - until_build: "222.*" + since_build: "223" + until_build: "223.*" steps: @@ -96,12 +96,12 @@ jobs: strategy: matrix: include: - - idea_version: "IU-2022.2.4" - php_plugin_version: "222.4345.15" - psi_viewer_plugin_version: "222-SNAPSHOT" + - idea_version: "IU-2022.3" + php_plugin_version: "223.7571.231" + psi_viewer_plugin_version: "223-SNAPSHOT" grammar_kit_plugin_version: "2021.2.2" - since_build: "222" - until_build: "222.*" + since_build: "223" + until_build: "223.*" outputs: cms-name: ${{ steps.properties.outputs.cms-name }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80677346..6dfdff47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,12 +24,12 @@ jobs: strategy: matrix: include: - - idea_version: "IU-2022.2.4" - php_plugin_version: "222.4345.15" - psi_viewer_plugin_version: "222-SNAPSHOT" + - idea_version: "IU-2022.3" + php_plugin_version: "223.7571.231" + psi_viewer_plugin_version: "223-SNAPSHOT" grammar_kit_plugin_version: "2021.2.2" - since_build: "222" - until_build: "222.*" + since_build: "223" + until_build: "223.*" outputs: prefixed-version: ${{ steps.properties.outputs.prefixed-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 20733e3e..39a5d9e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ ### Changed - Bump version to 0.8.1 +- Bump platform to 223 +- Update plugin ids for 223 +- Migrate Icons for 223 +- Update JS ModuleProvider +- Bump versions in GitHub workflows +- Migrate to postStartupActivity from project listeners ### Deprecated diff --git a/build.gradle b/build.gradle index 7e029fba..4e100c45 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat plugins { - id "org.jetbrains.intellij" version "1.9.0" apply false + id "org.jetbrains.intellij" version "1.10.0" apply false id 'java' id "org.jetbrains.grammarkit" version "${grammarKitPluginVersion}" apply false id 'org.jetbrains.changelog' version '2.0.0' diff --git a/gradle.properties b/gradle.properties index 94125ac4..8eea8d6c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,21 +3,21 @@ pluginGroup = com.cedricziel.idea pluginNameCMS = TYPO3 CMS Support pluginNameFluid = TYPO3 Fluid Support pluginNameTypoScript = TYPO3 TypoScript Support -pluginVersion = 0.8.1 +pluginVersion = 0.9.0 javaVersion = 1.17 javaTargetVersion = 1.17 jFlexRelease = 1.7.0-1 -pluginVerifierIdeVersions = 2022.2.4 +pluginVerifierIdeVersions = 2022.3 grammarKitPluginVersion = 2021.2.2 -ideaVersion = IU-2022.2.4 -phpPluginVersion = 222.4345.15 -psiViewerPluginVersion = 222-SNAPSHOT -customSinceBuild=222 -customUntilBuild=222.* +ideaVersion = IU-2022.3 +phpPluginVersion = 223.7571.231 +psiViewerPluginVersion = 223-SNAPSHOT +customSinceBuild=223 +customUntilBuild=223.* #grammarKitPluginVersion = 2021.2.1 #grammarKitVersion = 2021.1.1 diff --git a/lang-fluid/build.gradle b/lang-fluid/build.gradle index 65b32243..78da65e8 100644 --- a/lang-fluid/build.gradle +++ b/lang-fluid/build.gradle @@ -22,7 +22,7 @@ idea { def loadPlugins = [ "com.jetbrains.php:${phpPluginVersion}", - 'CSS', + 'com.intellij.css', 'java', 'java-i18n', 'properties', diff --git a/lang-typoscript/build.gradle b/lang-typoscript/build.gradle index 3b6f5e48..5aaf7199 100644 --- a/lang-typoscript/build.gradle +++ b/lang-typoscript/build.gradle @@ -22,7 +22,7 @@ idea { def usedPlugins = [ "com.jetbrains.php:${phpPluginVersion}", - 'CSS', + 'com.intellij.css', 'java', 'java-i18n', 'properties', diff --git a/typo3-cms/build.gradle b/typo3-cms/build.gradle index b9d98f67..41dbfae8 100644 --- a/typo3-cms/build.gradle +++ b/typo3-cms/build.gradle @@ -1,13 +1,12 @@ def requiredPlugins = [ 'java', 'java-i18n', - 'coverage', "com.jetbrains.php:${phpPluginVersion}", - 'CSS', + 'com.intellij.css', 'platform-images', 'properties', 'yaml', - 'JavaScriptLanguage', + 'JavaScript', "PsiViewer:${psiViewerPluginVersion}", project(':lang-fluid'), project(':lang-typoscript'), diff --git a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/contextApi/ContextReference.java b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/contextApi/ContextReference.java index fb3030e3..c9e7364d 100644 --- a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/contextApi/ContextReference.java +++ b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/contextApi/ContextReference.java @@ -43,7 +43,7 @@ public ContextReference(@NotNull PsiElement psiElement) { elements.add( LookupElementBuilder .create(availableAspect) - .withIcon(PhpIcons.CLASS_ICON) + .withIcon(PhpIcons.CLASS) .withTypeText(TYPO3Utility.getFQNByAspectName(availableAspect), true) ); } diff --git a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/extbase/persistence/codeInsight/RepositoryMagicMethodsCompletionContributor.java b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/extbase/persistence/codeInsight/RepositoryMagicMethodsCompletionContributor.java index d670a228..af4cfab5 100644 --- a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/extbase/persistence/codeInsight/RepositoryMagicMethodsCompletionContributor.java +++ b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/extbase/persistence/codeInsight/RepositoryMagicMethodsCompletionContributor.java @@ -79,7 +79,7 @@ public void renderElement(LookupElementPresentation presentation) { presentation.setItemText("findBy" + StringUtils.capitalize(f.getName())); presentation.setTypeText("findBy" + StringUtils.capitalize(f.getName())); - presentation.setIcon(PhpIcons.METHOD_ICON); + presentation.setIcon(PhpIcons.METHOD); presentation.setTailText("(" + f.getName() + " : " + f.getInferredType() + ")", true); presentation.setTypeText(c.getName() + "[]|" + ExtbaseUtils.QUERY_RESULT_INTERFACE); @@ -100,7 +100,7 @@ public void renderElement(LookupElementPresentation presentation) { presentation.setItemText("countBy" + StringUtils.capitalize(f.getName())); presentation.setTypeText("countBy" + StringUtils.capitalize(f.getName())); - presentation.setIcon(PhpIcons.METHOD_ICON); + presentation.setIcon(PhpIcons.METHOD); presentation.setTailText("(" + f.getName() + " : " + f.getInferredType() + ")", true); presentation.setTypeText("int"); } @@ -120,7 +120,7 @@ public void renderElement(LookupElementPresentation presentation) { presentation.setItemText("findOneBy" + StringUtils.capitalize(f.getName())); presentation.setTypeText("findOneBy" + StringUtils.capitalize(f.getName())); - presentation.setIcon(PhpIcons.METHOD_ICON); + presentation.setIcon(PhpIcons.METHOD); presentation.setTailText("(" + f.getName() + " : " + f.getInferredType() + ")", true); presentation.setTypeText("null|" + c.getName()); } diff --git a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/javaScript/ModuleProvider.java b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/javaScript/ModuleProvider.java index d16999a6..1c537ccd 100644 --- a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/javaScript/ModuleProvider.java +++ b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/javaScript/ModuleProvider.java @@ -6,15 +6,12 @@ import com.intellij.lang.javascript.completion.JSLookupUtilImpl; import com.intellij.lang.javascript.frameworks.modules.JSResolvableModuleReferenceContributor; import com.intellij.lang.javascript.psi.resolve.JSResolveResult; -import com.intellij.openapi.project.DumbService; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.ResolveResult; import org.jetbrains.annotations.NotNull; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; public class ModuleProvider extends JSResolvableModuleReferenceContributor { @NotNull @@ -34,11 +31,10 @@ public class ModuleProvider extends JSResolvableModuleReferenceContributor { } @NotNull - @Override - protected Object @NotNull [] getVariants(@NotNull PsiElement element) { - Set result = new HashSet<>(); + public Collection getLookupElements(@NotNull String unquotedEscapedText, @NotNull PsiElement host) { + List result = new ArrayList<>(); - JavaScriptUtil.getModuleMap(element.getProject()).forEach((name, file) -> { + JavaScriptUtil.getModuleMap(host.getProject()).forEach((name, file) -> { for (PsiFile psiFile : file) { LookupElement lookupItem = JSLookupUtilImpl.createPrioritizedLookupItem(psiFile, name, JSLookupPriority.MAX_PRIORITY); if (lookupItem != null) { @@ -47,16 +43,11 @@ public class ModuleProvider extends JSResolvableModuleReferenceContributor { } }); - return result.toArray(); + return result; } @Override public int getDefaultWeight() { return 25; } - - public boolean isApplicable(@NotNull PsiElement host) { - - return !DumbService.isDumb(host.getProject()); - } } diff --git a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/listener/TYPO3DetectionListener.java b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/startup/TYPO3CMSPostStartupActivity.java similarity index 65% rename from typo3-cms/src/main/java/com/cedricziel/idea/typo3/listener/TYPO3DetectionListener.java rename to typo3-cms/src/main/java/com/cedricziel/idea/typo3/startup/TYPO3CMSPostStartupActivity.java index e878a17a..ab53c3d3 100644 --- a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/listener/TYPO3DetectionListener.java +++ b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/startup/TYPO3CMSPostStartupActivity.java @@ -1,4 +1,4 @@ -package com.cedricziel.idea.typo3.listener; +package com.cedricziel.idea.typo3.startup; import com.cedricziel.idea.typo3.IdeHelper; import com.cedricziel.idea.typo3.TYPO3CMSProjectSettings; @@ -10,8 +10,9 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor; import com.intellij.ide.plugins.PluginManagerCore; import com.intellij.openapi.extensions.PluginId; +import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; -import com.intellij.openapi.project.ProjectManagerListener; +import com.intellij.openapi.startup.StartupActivity; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.psi.search.FilenameIndex; import com.intellij.psi.search.GlobalSearchScope; @@ -19,9 +20,9 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class TYPO3DetectionListener implements ProjectManagerListener { +public class TYPO3CMSPostStartupActivity implements StartupActivity.Background { @Override - public void projectOpened(@NotNull Project project) { + public void runActivity(@NotNull Project project) { this.checkProject(project); TYPO3CMSSettings instance = TYPO3CMSSettings.getInstance(project); @@ -35,15 +36,17 @@ public void projectOpened(@NotNull Project project) { instance.setVersion(plugin.getVersion()); FileBasedIndex index = FileBasedIndex.getInstance(); - index.scheduleRebuild(CoreServiceMapStubIndex.KEY, new Throwable()); - index.scheduleRebuild(ExtensionNameStubIndex.KEY, new Throwable()); - index.scheduleRebuild(IconIndex.KEY, new Throwable()); - index.scheduleRebuild(ResourcePathIndex.KEY, new Throwable()); - index.scheduleRebuild(RouteIndex.KEY, new Throwable()); - index.scheduleRebuild(TablenameFileIndex.KEY, new Throwable()); - index.scheduleRebuild(LegacyClassesForIDEIndex.KEY, new Throwable()); - index.scheduleRebuild(MethodArgumentDroppedIndex.KEY, new Throwable()); - index.scheduleRebuild(ControllerActionIndex.KEY, new Throwable()); + DumbService.getInstance(project).runWhenSmart(() -> { + index.scheduleRebuild(CoreServiceMapStubIndex.KEY, new Throwable()); + index.scheduleRebuild(ExtensionNameStubIndex.KEY, new Throwable()); + index.scheduleRebuild(IconIndex.KEY, new Throwable()); + index.scheduleRebuild(ResourcePathIndex.KEY, new Throwable()); + index.scheduleRebuild(RouteIndex.KEY, new Throwable()); + index.scheduleRebuild(TablenameFileIndex.KEY, new Throwable()); + index.scheduleRebuild(LegacyClassesForIDEIndex.KEY, new Throwable()); + index.scheduleRebuild(MethodArgumentDroppedIndex.KEY, new Throwable()); + index.scheduleRebuild(ControllerActionIndex.KEY, new Throwable()); + }); } } @@ -65,6 +68,6 @@ private boolean notificationIsDismissed(@NotNull Project project) { private boolean containsPluginRelatedFiles(@NotNull Project project) { return (VfsUtil.findRelativeFile(project.getBaseDir(), "vendor", "typo3") != null) - || FilenameIndex.getFilesByName(project, "ext_emconf.php", GlobalSearchScope.allScope(project)).length > 0; + || FilenameIndex.getVirtualFilesByName("ext_emconf.php", GlobalSearchScope.allScope(project)).size() > 0; } } diff --git a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/listener/XLFFileTypeListener.java b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/startup/XLFFFileTypePostStartupActivity.java similarity index 78% rename from typo3-cms/src/main/java/com/cedricziel/idea/typo3/listener/XLFFileTypeListener.java rename to typo3-cms/src/main/java/com/cedricziel/idea/typo3/startup/XLFFFileTypePostStartupActivity.java index 2edcdec5..5b3cb2a3 100644 --- a/typo3-cms/src/main/java/com/cedricziel/idea/typo3/listener/XLFFileTypeListener.java +++ b/typo3-cms/src/main/java/com/cedricziel/idea/typo3/startup/XLFFFileTypePostStartupActivity.java @@ -1,18 +1,20 @@ -package com.cedricziel.idea.typo3.listener; +package com.cedricziel.idea.typo3.startup; import com.intellij.ide.highlighter.XmlFileType; -import com.intellij.notification.*; +import com.intellij.notification.Notification; +import com.intellij.notification.NotificationType; +import com.intellij.notification.Notifications; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.fileTypes.FileTypeManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; -import com.intellij.openapi.project.ProjectManagerListener; +import com.intellij.openapi.startup.StartupActivity; import org.jetbrains.annotations.NotNull; -public class XLFFileTypeListener implements ProjectManagerListener { +public class XLFFFileTypePostStartupActivity implements StartupActivity { @Override - public void projectOpened(@NotNull Project project) { + public void runActivity(@NotNull Project project) { if (!(FileTypeManager.getInstance().getFileTypeByExtension("xlf") instanceof XmlFileType)) { WriteCommandAction.runWriteCommandAction(ProjectManager.getInstance().getOpenProjects()[0], () -> { FileTypeManager.getInstance().associateExtension(XmlFileType.INSTANCE, "xlf"); diff --git a/typo3-cms/src/main/resources/META-INF/plugin.xml b/typo3-cms/src/main/resources/META-INF/plugin.xml index 008a0196..f2751d2c 100644 --- a/typo3-cms/src/main/resources/META-INF/plugin.xml +++ b/typo3-cms/src/main/resources/META-INF/plugin.xml @@ -37,12 +37,9 @@ - - - - - + +