Skip to content

Commit 63e7c51

Browse files
author
Vitaliy
authored
Merge branch '1.0.1-develop' into dialog-center-position
2 parents 567cb15 + 7b8eaf0 commit 63e7c51

File tree

14 files changed

+222
-6
lines changed

14 files changed

+222
-6
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group 'com.magento.idea'
11-
version '0.0.9'
11+
version '1.0.1'
1212

1313
apply plugin: 'org.jetbrains.intellij'
1414
apply plugin: 'java'
@@ -47,7 +47,7 @@ publishPlugin {
4747
token = System.getenv("MAGENTO_PHPSTORM_intellijPublishToken")
4848
if (Boolean.valueOf(System.getenv("MAGENTO_PHPSTORM_isAlpha"))) {
4949
channels 'alpha'
50-
//version = version + "-alpha-" + getDate()
50+
version = version + "-alpha-" + getDate()
5151
}
5252
}
5353

resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<idea-plugin>
88
<id>com.magento.idea.magento2plugin</id>
99
<name>Magento PhpStorm</name>
10-
<version>0.0.9</version>
10+
<version>1.0.1</version>
1111
<vendor url="https://github.com/magento/magento2-phpstorm-plugin">Magento Inc.</vendor>
1212

1313
<description><![CDATA[

src/com/magento/idea/magento2plugin/completion/provider/mftf/ActionGroupCompletionProvider.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
import com.intellij.codeInsight.completion.CompletionResultSet;
1010
import com.intellij.codeInsight.lookup.LookupElementBuilder;
1111
import com.intellij.psi.PsiElement;
12+
import com.intellij.psi.util.PsiTreeUtil;
13+
import com.intellij.psi.xml.XmlAttribute;
14+
import com.intellij.psi.xml.XmlAttributeValue;
15+
import com.intellij.psi.xml.XmlTag;
1216
import com.intellij.util.ProcessingContext;
1317
import com.intellij.util.indexing.FileBasedIndex;
18+
import com.magento.idea.magento2plugin.magento.files.MftfActionGroup;
1419
import com.magento.idea.magento2plugin.stubs.indexes.mftf.ActionGroupIndex;
1520
import org.jetbrains.annotations.NotNull;
1621

@@ -31,9 +36,37 @@ protected void addCompletions(@NotNull CompletionParameters parameters,
3136

3237
Collection<String> selectorNames
3338
= FileBasedIndex.getInstance().getAllKeys(ActionGroupIndex.KEY, position.getProject());
39+
String currentActionGroup = getCurrentActionGroupName((XmlAttributeValue) parameters.getPosition().getParent());
3440

3541
for (String selectorName: selectorNames) {
42+
if (selectorName.equals(currentActionGroup)) {
43+
continue;
44+
}
45+
3646
result.addElement(LookupElementBuilder.create(selectorName));
3747
}
3848
}
49+
50+
private String getCurrentActionGroupName(XmlAttributeValue xmlAttributeValue) {
51+
PsiElement xmlAttribute = xmlAttributeValue.getParent();
52+
XmlTag xmlTag = PsiTreeUtil.getParentOfType(xmlAttribute, XmlTag.class);
53+
54+
if (xmlTag == null) {
55+
return null;
56+
}
57+
58+
XmlAttribute nameAttribute = xmlTag.getAttribute(MftfActionGroup.NAME_ATTRIBUTE);
59+
60+
if (nameAttribute == null) {
61+
return null;
62+
}
63+
64+
String value = nameAttribute.getValue();
65+
66+
if (value == null || value.isEmpty()) {
67+
return null;
68+
}
69+
70+
return value;
71+
}
3972
}

src/com/magento/idea/magento2plugin/linemarker/php/WebApiLineMarkerProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.intellij.codeInsight.daemon.LineMarkerProvider;
99
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder;
1010
import com.intellij.psi.PsiElement;
11+
import com.intellij.psi.util.PsiTreeUtil;
1112
import com.intellij.psi.xml.XmlTag;
1213
import com.jetbrains.php.lang.psi.elements.Method;
1314
import com.jetbrains.php.lang.psi.elements.PhpClass;
@@ -62,7 +63,7 @@ public void collectSlowLineMarkers(@NotNull List<PsiElement> psiElements, @NotNu
6263
.create(MagentoIcons.WEB_API)
6364
.setTargets(results)
6465
.setTooltipText(tooltipText.toString());
65-
collection.add(builder.createLineMarkerInfo(psiElement));
66+
collection.add(builder.createLineMarkerInfo(PsiTreeUtil.getDeepestFirst(psiElement)));
6667
}
6768
}
6869

src/com/magento/idea/magento2plugin/magento/files/MftfActionGroup.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ public class MftfActionGroup {
1313
public static String USER_INPUT_TAG = "userInput";
1414
public static String ROOT_TAG = "actionGroup";
1515
public static String URL_ATTRIBUTE = "url";
16+
public static String NAME_ATTRIBUTE = "name";
1617
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Foo\Bar\Block\Test;
4+
5+
use Magento\Framework\View\Element\Template;
6+
7+
class ViewBlock extends Template
8+
{
9+
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="MyActionGroup" extends="MyActionGr<caret>">
11+
</actionGroup>
12+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Model;
8+
9+
class ClassNotConfiguredInWebApiXml
10+
{
11+
public function create()
12+
{
13+
}
14+
15+
public function update()
16+
{
17+
}
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Service;
8+
9+
class TestService
10+
{
11+
public function create()
12+
{
13+
}
14+
15+
public function update()
16+
{
17+
}
18+
}
19+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
9+
<route url="/V1/blog/post" method="PUT">
10+
<service class="Magento\Catalog\Service\TestService" method="create"/>
11+
<resources>
12+
<resource ref="Magento_Catalog::test"/>
13+
</resources>
14+
</route>
15+
<route url="/V1/blog/update" method="POST">
16+
<service class="Magento\Catalog\Service\TestService" method="update"/>
17+
<resources>
18+
<resource ref="Magento_Catalog::test"/>
19+
</resources>
20+
</route>
21+
</routes>

0 commit comments

Comments
 (0)