|
10 | 10 | import com.intellij.psi.xml.XmlTokenType;
|
11 | 11 | import com.magento.idea.magento2plugin.completion.provider.*;
|
12 | 12 | import com.magento.idea.magento2plugin.completion.provider.mftf.*;
|
13 |
| -import com.magento.idea.magento2plugin.magento.files.CommonXml; |
14 |
| -import com.magento.idea.magento2plugin.magento.files.ModuleAclXml; |
15 |
| -import com.magento.idea.magento2plugin.magento.files.ModuleXml; |
| 13 | +import com.magento.idea.magento2plugin.magento.files.*; |
16 | 14 |
|
17 | 15 | import static com.intellij.patterns.PlatformPatterns.psiElement;
|
18 | 16 | import static com.intellij.patterns.StandardPatterns.string;
|
@@ -45,21 +43,37 @@ public XmlCompletionContributor() {
|
45 | 43 | );
|
46 | 44 |
|
47 | 45 | /* PHP Class completion provider */
|
| 46 | + |
| 47 | + // <randomTag xsi:type="completion"> |
48 | 48 | extend(CompletionType.BASIC, psiElement(XmlTokenType.XML_DATA_CHARACTERS)
|
49 | 49 | .withParent(XmlPatterns.xmlText().withParent(XmlPatterns.xmlTag().withChild(
|
50 | 50 | XmlPatterns.xmlAttribute().withName(CommonXml.SCHEMA_VALIDATE_ATTRIBUTE).withValue(string().oneOf(CommonXml.OBJECT))))
|
51 | 51 | ),
|
52 | 52 | new PhpClassCompletionProvider()
|
53 | 53 | );
|
54 | 54 |
|
| 55 | + // <randomTag class="completion"> |
55 | 56 | extend(CompletionType.BASIC, psiElement(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN)
|
56 | 57 | .inside(XmlPatterns.xmlAttribute().withName(CommonXml.ATTR_CLASS)),
|
57 | 58 | new PhpClassCompletionProvider()
|
58 | 59 | );
|
59 | 60 |
|
| 61 | + // <preference for="completion"> |
| 62 | + extend(CompletionType.BASIC, psiElement(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) |
| 63 | + .inside(XmlPatterns.xmlAttribute().withName(ModuleDiXml.PREFERENCE_ATTR_FOR)), |
| 64 | + new PhpClassCompletionProvider() |
| 65 | + ); |
| 66 | + |
| 67 | + // <type name="completion"> |
| 68 | + extend(CompletionType.BASIC, psiElement(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) |
| 69 | + .inside(XmlPatterns.xmlAttribute().withName(ModuleDiXml.PLUGIN_TYPE_ATTR_NAME) |
| 70 | + .withParent(XmlPatterns.xmlTag().withName(ModuleDiXml.PLUGIN_TYPE_TAG))), |
| 71 | + new PhpClassCompletionProvider() |
| 72 | + ); |
| 73 | + |
60 | 74 | /* File Path Completion provider */
|
61 | 75 | extend(CompletionType.BASIC, psiElement(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN)
|
62 |
| - .inside(XmlPatterns.xmlAttribute().withName("template")), |
| 76 | + .inside(XmlPatterns.xmlAttribute().withName(LayoutXml.XML_ATTRIBUTE_TEMPLATE)), |
63 | 77 | new FilePathCompletionProvider()
|
64 | 78 | );
|
65 | 79 |
|
|
0 commit comments