Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 56f7c29

Browse files
Merge pull request #2504 from vitaliyboykocontributor/1263-Possibility-to-add-second-code-source-directory-for-modules-local-composer-development-using-content-root-feature-
Additional Code Source directiories selection
2 parents e904de9 + 5bd9238 commit 56f7c29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+768
-408
lines changed

‎.github/workflows/asset.yml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will build a package using Gradle and then save it to Assets
2+
3+
name: Build Asset
4+
5+
on:
6+
release:
7+
types: [created]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK 17
15+
uses: actions/setup-java@v3
16+
with:
17+
java-version: 17
18+
distribution: 'temurin'
19+
cache: gradle
20+
- name: Gradle wrapper
21+
run: gradle wrapper
22+
- name: Grant execute permission for gradlew
23+
run: chmod +x gradlew
24+
25+
- name: Build Plugin
26+
run: ./gradlew buildPlugin
27+
28+
- name: Upload Plugin to Release Assets
29+
uses: actions/upload-release-asset@v1
30+
with:
31+
upload_url: ${{ github.event.release.upload_url }}
32+
asset_path: ./build/distributions/PhpStorm Magento 2 Plugin-${{ github.event.release.tag_name }}.zip
33+
asset_name: PhpStorm Magento 2 Plugin-${{ github.event.release.tag_name }}.zip
34+
asset_content_type: application/zip-archive
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎CHANGELOG.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
66

7-
## 202501
7+
## 202510
8+
9+
### Added
10+
11+
- Possibility to add additional code source directories using content root feature [#2504](https://github.com/magento/magento2-phpstorm-plugin/pull/2504)
812

913
### Fixed
1014

‎README.md‎

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,53 @@
77
<!-- Plugin description -->
88
# PhpStorm Magento 2 Plugin
99

10-
<table align="center">
11-
<caption>
12-
This is a PhpStorm IDE plugin for a better Magento 2 development workflow.
10+
<table align="center"style="border-collapse: collapse; width: 100%; text-align: center;">
11+
<captionstyle="font-size: 1.2em; margin-bottom: 10px;">
12+
<strong>PhpStorm IDE Plugin</strong> for a better Magento 2 development workflow.
1313
</caption>
1414
<thead>
15-
<tr>
16-
<td colspan="3" align="center">
17-
Version 202500 - Contributors
15+
<tr style="background-color: #f4f4f4;">
16+
<td colspan="3" style="padding: 10px; font-size: 1.2em;">
17+
<strong>Version 202500 - Contributors</strong>
1818
</td>
1919
</tr>
2020
</thead>
21-
<tbody>
22-
<tr>
23-
<td align="center">
24-
<a href="https://github.com/YevhenZvieriev">
25-
<img src="https://avatars.githubusercontent.com/u/43544955?v=4" width="100px;" alt="Contributor 1"/>
26-
<br/>
27-
<sub><b>Yevhen Zvieriev</b></sub>
28-
</a>
29-
</td>
30-
<td align="center">
31-
<a href="https://github.com/SilinMykola">
32-
<img src="https://avatars.githubusercontent.com/u/15772032?v=4" width="100px;" alt="Contributor 2"/>
33-
<br/>
34-
<sub><b>Mykola Silin</b></sub>
35-
</a>
36-
</td>
37-
<td align="center">
38-
<a href="https://github.com/VitaliyBoyko">
39-
<img src="https://avatars.githubusercontent.com/u/20116393?v=4" width="100px;" alt="Contributor 3"/>
40-
<br/>
41-
<sub><b>Vitalii Boiko</b></sub>
42-
</a>
43-
</td>
44-
</tr>
45-
</tbody>
46-
<tfoot>
21+
<tbody>
4722
<tr>
48-
<td colspan="3" align="center">
49-
<h3>Support the Project</h3>
23+
<td align="center" style="padding: 15px;">
24+
<a href="https://github.com/YevhenZvieriev" style="text-decoration: none;">
25+
<img src="https://avatars.githubusercontent.com/u/43544955?v=4" width="120px" height="120px" style="border-radius: 50%;" alt="Yevhen Zvieriev"/>
26+
<br/>
27+
<sub style="font-size: 1em;"><b>Yevhen Zvieriev</b></sub>
28+
</a>
29+
</td>
30+
<td align="center" style="padding: 15px;">
31+
<a href="https://github.com/SilinMykola" style="text-decoration: none;">
32+
<img src="https://avatars.githubusercontent.com/u/15772032?v=4" width="120px" height="120px" style="border-radius: 50%;" alt="Mykola Silin"/>
33+
<br/>
34+
<sub style="font-size: 1em;"><b>Mykola Silin</b></sub>
35+
</a>
36+
</td>
37+
<td align="center" style="padding: 15px;">
38+
<a href="https://github.com/VitaliyBoyko" style="text-decoration: none;">
39+
<img src="https://avatars.githubusercontent.com/u/20116393?v=4" width="120px" height="120px" style="border-radius: 50%;" alt="Vitalii Boiko"/>
40+
<br/>
41+
<sub style="font-size: 1em;"><b>Vitalii Boiko</b></sub>
42+
</a>
43+
</td>
44+
</tr>
45+
</tbody>
46+
<tfoot>
47+
<tr style="background-color: #f9f9f9;">
48+
<td colspan="3" style="padding: 20px;">
49+
<h3 style="margin: 10px 0;">Support the Project</h3>
5050
<p>If you find this plugin helpful and want to support its development, consider buying the contributors a coffee:</p>
51-
<a href="https://buymeacoffee.com/vitalii_b">
52-
<img src="https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Donate-orange.svg" alt="Buy Me a Coffee">
51+
<a href="https://buymeacoffee.com/vitalii_b" style="text-decoration: none;">
52+
<img src="https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Donate-orange.svg" alt="Buy Me a Coffee" style="margin: 10px 0;">
5353
</a>
54-
<p>Thank you to our sponsors—your support means everything:</p>
55-
<p>Lucas van Staden</p>
56-
<p>Ivan Chepurnyi</p>
54+
<p style="margin: 10px 0;">Thank you to our sponsors—your support means everything:</p>
55+
<p><strong>Lucas van Staden</strong></p>
56+
<p><strong>Ivan Chepurnyi</strong></p>
5757
</td>
5858
</tr>
5959
</tfoot>

‎gradle.properties‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pluginGroup = com.magento.idea.magento2plugin
22
pluginName = Magento PhpStorm
33
pluginRepositoryUrl = https://github.com/magento/magento2-phpstorm-plugin
4-
pluginVersion = 2025.0.1
5-
pluginSinceBuild = 233
4+
pluginVersion = 2025.1.0
5+
pluginSinceBuild = 243.3
66
pluginUntilBuild = 258.*
77
platformType = PS
88
platformVersion = 2024.3

‎src/main/java/com/magento/idea/magento2plugin/MagentoIcons.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ public class MagentoIcons {
1818
public static final Icon PLUGIN_ICON_MEDIUM =
1919
IconLoader.getIcon("/icons/pluginIcon64x64.svg", MagentoIcons.class);
2020
public static final Icon GRAPHQL = IconLoader.getIcon("/icons/graphql.svg", MagentoIcons.class);
21+
public static final Icon MARK_AS = IconLoader.getIcon("/icons/mark-as.svg", MagentoIcons.class);
2122
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.actions.content.root;
7+
8+
import com.intellij.ide.projectView.ProjectView;
9+
import com.intellij.ide.projectView.actions.MarkRootActionBase;
10+
import com.intellij.openapi.actionSystem.*;
11+
import com.intellij.openapi.module.Module;
12+
import com.intellij.openapi.project.Project;
13+
import com.intellij.openapi.roots.ContentEntry;
14+
import com.intellij.openapi.vfs.VfsUtil;
15+
import com.intellij.openapi.vfs.VirtualFile;
16+
import com.intellij.psi.PsiDirectory;
17+
import com.intellij.psi.PsiElement;
18+
import com.magento.idea.magento2plugin.MagentoIcons;
19+
import com.magento.idea.magento2plugin.project.Settings;
20+
import com.magento.idea.magento2plugin.util.magento.MagentoPathUrlUtil;
21+
import org.jetbrains.annotations.NotNull;
22+
import java.net.MalformedURLException;
23+
import java.net.URL;
24+
25+
public class MarkDirectoryAsMagentoContentRot extends MarkRootActionBase {
26+
private Project project;
27+
28+
public MarkDirectoryAsMagentoContentRot() {
29+
super();
30+
final Presentation presentation = this.getTemplatePresentation();
31+
presentation.setIcon(MagentoIcons.MARK_AS);
32+
}
33+
34+
@Override
35+
protected void modifyRoots(final VirtualFile virtualFile, ContentEntry contentEntry) {
36+
if (project != null) {
37+
final Settings settings = Settings.getInstance(project);
38+
Settings.getInstance(project).addMagentoFolder(virtualFile.getUrl());
39+
if (settings.getMagentoFolders() != null) {
40+
settings.getMagentoFolders().removeIf(folder -> {
41+
final VirtualFile file;
42+
try {
43+
file = VfsUtil.findFileByURL(new URL(folder));
44+
} catch (MalformedURLException e) {
45+
return false;
46+
}
47+
return file == null || !file.exists();
48+
});
49+
}
50+
51+
ProjectView.getInstance(project).refresh();
52+
}
53+
}
54+
55+
@Override
56+
public void update(@NotNull final AnActionEvent event) {
57+
final DataContext context = event.getDataContext();
58+
final PsiElement targetElement = LangDataKeys.PSI_ELEMENT.getData(context);
59+
final Module module = event.getData(PlatformCoreDataKeys.MODULE);
60+
if (module != null) {
61+
project = module.getProject();
62+
}
63+
64+
if (targetElement instanceof PsiDirectory) {
65+
final Settings settings = Settings.getInstance(project);
66+
final String magentoPathUrl = MagentoPathUrlUtil.execute(project);
67+
final String directoryUrl = ((PsiDirectory) targetElement).getVirtualFile().getUrl();
68+
if (magentoPathUrl != null && magentoPathUrl.equals(directoryUrl)) {
69+
event.getPresentation().setEnabledAndVisible(false);
70+
return;
71+
}
72+
if (!settings.containsMagentoFolder(directoryUrl)) {
73+
event.getPresentation().setEnabledAndVisible(true);
74+
return;
75+
}
76+
}
77+
78+
event.getPresentation().setEnabledAndVisible(false);
79+
}
80+
81+
@Override
82+
protected boolean isEnabled(@NotNull RootsSelection rootsSelection, @NotNull Module module) {
83+
return false;
84+
}
85+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.actions.content.root;
7+
8+
import com.intellij.ide.projectView.ProjectView;
9+
import com.intellij.ide.projectView.actions.MarkRootActionBase;
10+
import com.intellij.openapi.actionSystem.*;
11+
import com.intellij.openapi.module.Module;
12+
import com.intellij.openapi.project.Project;
13+
import com.intellij.openapi.roots.ContentEntry;
14+
import com.intellij.openapi.vfs.VfsUtil;
15+
import com.intellij.openapi.vfs.VirtualFile;
16+
import com.intellij.psi.PsiDirectory;
17+
import com.intellij.psi.PsiElement;
18+
import com.magento.idea.magento2plugin.project.Settings;
19+
import com.magento.idea.magento2plugin.util.magento.MagentoPathUrlUtil;
20+
import org.jetbrains.annotations.NotNull;
21+
import java.net.MalformedURLException;
22+
import java.net.URL;
23+
24+
public class UnmarkDirectoryAsMagentoContentRot extends MarkRootActionBase {
25+
private Project project;
26+
27+
public UnmarkDirectoryAsMagentoContentRot() {
28+
super();
29+
}
30+
31+
@Override
32+
protected void modifyRoots(VirtualFile virtualFile, ContentEntry contentEntry) {
33+
if (project != null) {
34+
Settings settings = Settings.getInstance(project);
35+
Settings.getInstance(project).removeMagentoFolder(virtualFile.getUrl());
36+
if (settings.getMagentoFolders() != null) {
37+
settings.getMagentoFolders().removeIf(folder -> {
38+
VirtualFile file = null;
39+
try {
40+
file = VfsUtil.findFileByURL(new URL(folder));
41+
} catch (MalformedURLException e) {
42+
return false;
43+
}
44+
return file == null || !file.exists();
45+
});
46+
}
47+
48+
ProjectView.getInstance(project).refresh();
49+
}
50+
}
51+
52+
@Override
53+
public void update(@NotNull AnActionEvent event) {
54+
final DataContext context = event.getDataContext();
55+
final PsiElement targetElement = LangDataKeys.PSI_ELEMENT.getData(context);
56+
Module module = event.getData(PlatformCoreDataKeys.MODULE);
57+
if (module != null) {
58+
project = module.getProject();
59+
}
60+
61+
if (targetElement instanceof PsiDirectory) {
62+
Settings settings = Settings.getInstance(project);
63+
String magentoPathUrl = MagentoPathUrlUtil.execute(project);
64+
String directoryUrl = ((PsiDirectory) targetElement).getVirtualFile().getUrl();
65+
if (magentoPathUrl != null && magentoPathUrl.equals(directoryUrl)) {
66+
event.getPresentation().setEnabledAndVisible(false);
67+
return;
68+
}
69+
70+
if (settings.containsMagentoFolder(directoryUrl)) {
71+
event.getPresentation().setEnabledAndVisible(true);
72+
return;
73+
}
74+
}
75+
76+
event.getPresentation().setEnabledAndVisible(false);
77+
}
78+
79+
@Override
80+
protected boolean isEnabled(@NotNull RootsSelection rootsSelection, @NotNull Module module) {
81+
return false;
82+
}
83+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /