Skip to content

Commit f72e224

Browse files
authored
Merge pull request magento#417 from magento/skip-idea-include-during-indexing
Skip IDEA include tag
2 parents 1fca5ce + 84041d5 commit f72e224

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
66

77
## 3.0.1
88

9+
### Fixed
10+
11+
- Skipped IDEA include tag causing error
12+
- Fixed StringIndexOutOfBoundsException on PluginInspection
13+
914
## 3.0.0
1015

1116
### Added

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ This is a PhpStorm IDE plugin for a better Magento 2 development workflow. It is
1717

1818
## Works with
1919

20-
* PhpStorm >= 2020.1.1
21-
* JRE >= 1.8
20+
* PhpStorm >= 2020.3
21+
* JRE >= 11
2222

2323
## Features
2424

resources/META-INF/plugin.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<vendor url="https://github.com/magento/magento2-phpstorm-plugin">Magento Inc.</vendor>
1212

1313
<description><![CDATA[
14-
Magento PhpStorm plugin, created to improve life-work balance while working with Magento 2
14+
This is a PhpStorm IDE plugin for a better Magento 2 development workflow.
1515
]]></description>
1616

1717
<change-notes><![CDATA[

src/com/magento/idea/magento2plugin/stubs/indexes/xml/PhpClassNameIndex.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
import com.jetbrains.php.lang.PhpLangUtil;
2424
import com.magento.idea.magento2plugin.project.Settings;
2525
import com.magento.idea.magento2plugin.util.RegExUtil;
26+
import com.magento.idea.magento2plugin.util.xml.XmlPsiTreeUtil;
2627
import gnu.trove.THashMap;
28+
import java.util.List;
2729
import java.util.Map;
2830
import org.jetbrains.annotations.NotNull;
2931

@@ -65,7 +67,7 @@ public DataIndexer<String, Void, FileContent> getIndexer() {
6567
};
6668
}
6769

68-
private void fillMap(final XmlTag parentTag, final Map<String, Void> resultMap) {
70+
private void fillMap(final XmlTag parentTag, final Map<String, Void> resultMap) { //NOPMD
6971
for (final XmlTag childTag: parentTag.getSubTags()) {
7072
for (final XmlAttribute xmlAttribute: childTag.getAttributes()) {
7173
final String xmlAttributeValue = xmlAttribute.getValue();
@@ -79,6 +81,16 @@ private void fillMap(final XmlTag parentTag, final Map<String, Void> resultMap)
7981
if (XmlIncludeHandler.isXInclude(childTag)) {
8082
return;
8183
}
84+
85+
//skipping IDEA include tag
86+
final List<XmlTag> ideaIncludeTags = XmlPsiTreeUtil.findSubTagsOfParent(
87+
childTag,
88+
"xi:include"
89+
);
90+
if (!ideaIncludeTags.isEmpty()) {
91+
return;
92+
}
93+
8294
final XmlTagValue childTagValue = childTag.getValue();
8395
final String tagValue = childTagValue.getTrimmedText();
8496
if (!tagValue.isEmpty() && tagValue.matches(CLASS_NAME_PATTERN)) {

0 commit comments

Comments
 (0)