Skip to content

Commit 3b613b8

Browse files
author
Vitaliy
authored
Merge branch '1.0.0-develop' into graphql-codeinspection-resolver--task-35
2 parents 655538e + 78394be commit 3b613b8

File tree

59 files changed

+2414
-75
lines changed

Some content is hidden

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

59 files changed

+2414
-75
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Create a Plugin class for a class public method action
1414
* Code Inspection: Warning regarding Cacheable false attribute in default XML
1515
* Create a Preference for a class action
16+
* Create a Block action
17+
* Line markers for navigation from a plugin class to a target class
1618

1719
0.3.0
1820
=============

resources/META-INF/plugin.xml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
title="CHANGELOG.md"
2222
>here</a>
2323
]]>
24-
2524
</change-notes>
2625

2726
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
@@ -38,6 +37,7 @@
3837
<depends optional="true" config-file="withJsGraphQl.xml">com.intellij.lang.jsgraphql</depends>
3938

4039
<actions>
40+
<!-- In editor generators -->
4141
<group id="MagentoGenerateGroup">
4242
<action id="MagentoGenerateBeforeMethodAction"
4343
class="com.magento.idea.magento2plugin.actions.generation.PluginGenerateBeforeMethodAction"
@@ -53,16 +53,28 @@
5353
description="Create Magento around plugin method."/>
5454
<add-to-group group-id="PhpGenerateGroup" anchor="last"/>
5555
</group>
56+
57+
<!-- Module file generators -->
58+
<group id="MagentoNewModuleFileGroup" class="com.magento.idea.magento2plugin.actions.groups.NewModuleFileGroup" text="Module File" popup="true">
59+
<action id="MagentoCreateABlock" class="com.magento.idea.magento2plugin.actions.generation.NewBlockAction" />
60+
<add-to-group group-id="NewGroup" anchor="last"/>
61+
</group>
62+
63+
<!-- Complex generators -->
5664
<group id="MagentoNewGroup">
5765
<action id="Magento2NewModule" class="com.magento.idea.magento2plugin.actions.generation.NewModuleAction"/>
5866
<add-to-group group-id="NewGroup" anchor="after" relative-to-action="NewDir"/>
5967
</group>
68+
<action id="MagentoCreateAnObserver.Menu" class="com.magento.idea.magento2plugin.actions.generation.CreateAnObserverAction">
69+
<add-to-group group-id="EditorPopupMenu"/>
70+
</action>
6071
<action id="MagentoCreateAPlugin.Menu" class="com.magento.idea.magento2plugin.actions.generation.CreateAPluginAction">
6172
<add-to-group group-id="EditorPopupMenu"/>
6273
</action>
6374
<action id="OverrideClassByAPreference.Menu" class="com.magento.idea.magento2plugin.actions.generation.OverrideClassByAPreferenceAction">
6475
<add-to-group group-id="EditorPopupMenu"/>
6576
</action>
77+
6678
</actions>
6779

6880
<extensions defaultExtensionNs="com.intellij">
@@ -100,6 +112,7 @@
100112
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.js.MagentoLibJsIndex" />
101113

102114
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.PluginLineMarkerProvider"/>
115+
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.PluginTargetLineMarkerProvider"/>
103116
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.ClassConfigurationLineMarkerProvider"/>
104117
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.WebApiLineMarkerProvider"/>
105118

@@ -134,18 +147,9 @@
134147
<internalFileTemplate name="Magento Module Xml"/>
135148
<internalFileTemplate name="Magento Module DI Xml"/>
136149
<internalFileTemplate name="Magento Php Preference Class"/>
150+
<internalFileTemplate name="Magento Module Common Php Class"/>
151+
<internalFileTemplate name="Magento Observer Class"/>
152+
<internalFileTemplate name="Magento Module Events Xml"/>
137153
</extensions>
138154

139-
<application-components>
140-
<!-- Add your application components here -->
141-
</application-components>
142-
143-
<project-components>
144-
<!-- Add your project components here -->
145-
</project-components>
146-
147-
<actions>
148-
<!-- Add your actions here -->
149-
</actions>
150-
151155
</idea-plugin>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<preference for="${FOR}" type="${TYPE}" />
1+
<preference for="${FOR}" type="${TYPE}" />

resources/fileTemplates/code/Magento Module DI Xml Preference.xml.html

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,36 @@
66
-->
77
<html>
88
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td><font face="verdana" size="-1">
12+
The object manager uses abstraction-implementation mappings when the constructor signature of a class requests
13+
an object by its interface. The object manager uses these mappings to determine what the default implementation
14+
is for that class for a particular scope.
15+
</font><br>
16+
</td>
17+
</tr>
18+
<tr>
19+
<td><font face="verdana" size="-1">
20+
If you want to override a public or protected method from a core class, utilize the preference node from di.xml to achieve it.
21+
</font><br>
22+
</td>
23+
</tr>
24+
</table>
25+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
26+
<tr>
27+
<td colspan="3"><font face="verdana" size="-1">Predefined variables will take the following values:</font></td>
28+
</tr>
29+
<tr>
30+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${FOR}</b></font></nobr></td>
31+
<td width="10">&nbsp;</td>
32+
<td width="100%" valign="top"><font face="verdana" size="-1">Target PHP Class to change its concrete implementation</font></td>
33+
</tr>
34+
<tr>
35+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${TYPE}</b></font></nobr></td>
36+
<td width="10">&nbsp;</td>
37+
<td width="100%" valign="top"><font face="verdana" size="-1">PHP Class that will be instantiated instead of specified in predefined ${FOR} variable</font></td>
38+
</tr>
39+
</table>
940
</body>
10-
</html>
41+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<event name="${EVENT_NAME}">
2+
<observer name="${OBSERVER_NAME}" instance="${OBSERVER_CLASS}" />
3+
</event>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
</body>
10+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Observer for ${EVENT_NAME}
3+
*
4+
* @param Observer $observer
5+
* @return void
6+
*/
7+
public function execute(Observer $observer)
8+
{
9+
$event = $observer->getEvent();
10+
// TODO: Implement observer method.
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
</body>
10+
</html>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
#parse("PHP File Header.php")
3+
#if (${NAMESPACE})
4+
5+
namespace ${NAMESPACE};
6+
#end
7+
#if (${USE})
8+
9+
use ${USE};
10+
#end
11+
12+
class ${NAME} #if (${EXTENDS})extends ${EXTENDS}#end #if (${IMPLEMENTS}) implements ${IMPLEMENTS}#end {
13+
14+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0"?>
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
3+
</config>

0 commit comments

Comments
 (0)