File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
src/com/magento/idea/magento2plugin Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,23 @@ public XmlCompletionContributor() {
103
103
new PhpConstructorArgumentCompletionProvider ()
104
104
);
105
105
106
+ // <source_model>php class completion</source_model> in system.xml files.
107
+ extend (CompletionType .BASIC , psiElement (XmlTokenType .XML_DATA_CHARACTERS )
108
+ .inside (XmlPatterns .xmlTag ().withName (ModuleSystemXml .SOURCE_MODEL_ELEMENT_NAME )
109
+ .withParent (XmlPatterns .xmlTag ().withName (ModuleSystemXml .FIELD_ELEMENT_NAME ))
110
+ ).inFile (xmlFile ().withName (string ().endsWith (ModuleSystemXml .FILE_NAME ))),
111
+ new PhpClassCompletionProvider ()
112
+ );
113
+
114
+ // <parameter source_model="completion">...</parameter> in widget.xml files.
115
+ extend (CompletionType .BASIC , psiElement (XmlTokenType .XML_ATTRIBUTE_VALUE_TOKEN )
116
+ .inside (XmlPatterns .xmlAttribute ().withName (ModuleWidgetXml .ATTRIBUTE_SOURCE_MODEL_NAME )
117
+ .withParent (XmlPatterns .xmlTag ().withName (ModuleWidgetXml .TAG_PARAMETER_NAME ).
118
+ withParent (XmlPatterns .xmlTag ().withName (ModuleWidgetXml .TAG_PARAMETERS_NAME )))
119
+ ).inFile (xmlFile ().withName (string ().endsWith (ModuleWidgetXml .FILE_NAME ))),
120
+ new PhpClassCompletionProvider ()
121
+ );
122
+
106
123
// <service method="methodName"/>
107
124
extend (CompletionType .BASIC , psiElement (XmlTokenType .XML_ATTRIBUTE_VALUE_TOKEN )
108
125
.inside (XmlPatterns .xmlAttribute ().withName ("method" )
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+ package com .magento .idea .magento2plugin .magento .files ;
6
+
7
+ public class ModuleSystemXml {
8
+ public static final String FILE_NAME = "system.xml" ;
9
+ public static final String FIELD_ELEMENT_NAME = "field" ;
10
+ public static final String SOURCE_MODEL_ELEMENT_NAME = "source_model" ;
11
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+ package com .magento .idea .magento2plugin .magento .files ;
6
+
7
+ public class ModuleWidgetXml {
8
+ public static final String FILE_NAME = "widget.xml" ;
9
+ public static final String TAG_WIDGET_NAME = "widget" ;
10
+ public static final String TAG_PARAMETERS_NAME = "parameters" ;
11
+ public static final String TAG_PARAMETER_NAME = "parameter" ;
12
+ public static final String ATTRIBUTE_SOURCE_MODEL_NAME = "source_model" ;
13
+ }
You can’t perform that action at this time.
0 commit comments