Skip to content

Commit

Permalink
Bump to platform 223 (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricziel committed Dec 8, 2022
1 parent 497a032 commit 9c745ce
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 70 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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 }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lang-fluid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ idea {

def loadPlugins = [
"com.jetbrains.php:${phpPluginVersion}",
'CSS',
'com.intellij.css',
'java',
'java-i18n',
'properties',
Expand Down
2 changes: 1 addition & 1 deletion lang-typoscript/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ idea {

def usedPlugins = [
"com.jetbrains.php:${phpPluginVersion}",
'CSS',
'com.intellij.css',
'java',
'java-i18n',
'properties',
Expand Down
5 changes: 2 additions & 3 deletions typo3-cms/build.gradle
Original file line number Diff line number Diff line change
@@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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");
}
Expand All @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,11 +31,10 @@ public class ModuleProvider extends JSResolvableModuleReferenceContributor {
}

@NotNull
@Override
protected Object @NotNull [] getVariants(@NotNull PsiElement element) {
Set<LookupElement> result = new HashSet<>();
public Collection<LookupElement> getLookupElements(@NotNull String unquotedEscapedText, @NotNull PsiElement host) {
List<LookupElement> 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) {
Expand All @@ -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());
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -10,18 +10,19 @@
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;
import com.intellij.util.indexing.FileBasedIndex;
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);
Expand All @@ -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());
});
}
}

Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
7 changes: 2 additions & 5 deletions typo3-cms/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@
<typeProvider4 implementation="com.cedricziel.idea.typo3.contextApi.ContextTypeProvider"/>
</extensions>

<projectListeners>
<listener class="com.cedricziel.idea.typo3.listener.TYPO3DetectionListener" topic="com.intellij.openapi.project.ProjectManagerListener"/>
<listener class="com.cedricziel.idea.typo3.listener.XLFFileTypeListener" topic="com.intellij.openapi.project.ProjectManagerListener"/>
</projectListeners>

<extensions defaultExtensionNs="com.intellij">
<postStartupActivity implementation="com.cedricziel.idea.typo3.startup.TYPO3CMSPostStartupActivity"/>
<postStartupActivity implementation="com.cedricziel.idea.typo3.startup.XLFFFileTypePostStartupActivity"/>

<projectService serviceImplementation="com.cedricziel.idea.typo3.TYPO3CMSSettings"/>
<projectService serviceImplementation="com.cedricziel.idea.typo3.TYPO3CMSProjectSettings"/>
Expand Down

0 comments on commit 9c745ce

Please sign in to comment.