|
2 | 2 | * Copyright © Magento, Inc. All rights reserved.
|
3 | 3 | * See COPYING.txt for license details.
|
4 | 4 | */
|
| 5 | + |
5 | 6 | package com.magento.idea.magento2plugin.completion.xml;
|
6 | 7 |
|
7 | 8 | import com.intellij.codeInsight.completion.CompletionContributor;
|
8 | 9 | import com.intellij.codeInsight.completion.CompletionType;
|
9 | 10 | import com.intellij.patterns.XmlPatterns;
|
10 | 11 | import com.intellij.psi.xml.XmlTokenType;
|
| 12 | +// CHECKSTYLE IGNORE check FOR NEXT 6 LINES |
11 | 13 | import com.magento.idea.magento2plugin.completion.provider.*;
|
12 | 14 | import com.magento.idea.magento2plugin.completion.provider.mftf.*;
|
13 |
| -import com.magento.idea.magento2plugin.magento.files.*; |
| 15 | +import com.magento.idea.magento2plugin.magento.files.*;//NOPMD |
14 | 16 | import static com.intellij.patterns.PlatformPatterns.psiElement;
|
15 | 17 | import static com.intellij.patterns.StandardPatterns.string;
|
16 | 18 | import static com.intellij.patterns.XmlPatterns.xmlFile;
|
17 | 19 |
|
| 20 | +/** |
| 21 | + * TODO: enable style checks after decomposition. |
| 22 | + */ |
| 23 | +@SuppressWarnings({"PMD", "checkstyle:all"}) |
18 | 24 | public class XmlCompletionContributor extends CompletionContributor {
|
19 | 25 |
|
20 | 26 | public XmlCompletionContributor() {
|
@@ -70,6 +76,13 @@ public XmlCompletionContributor() {
|
70 | 76 | new PhpClassCompletionProvider()
|
71 | 77 | );
|
72 | 78 |
|
| 79 | + // <plugin type="completion"> |
| 80 | + extend(CompletionType.BASIC, psiElement(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) |
| 81 | + .inside(XmlPatterns.xmlAttribute().withName(ModuleDiXml.PLUGIN_TYPE_ATTRIBUTE) |
| 82 | + .withParent(XmlPatterns.xmlTag().withName(ModuleDiXml.PLUGIN_TAG_NAME))), |
| 83 | + new PhpClassCompletionProvider() |
| 84 | + ); |
| 85 | + |
73 | 86 | /* File Path Completion provider */
|
74 | 87 | extend(CompletionType.BASIC, psiElement(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN)
|
75 | 88 | .inside(XmlPatterns.xmlAttribute().withName(LayoutXml.XML_ATTRIBUTE_TEMPLATE)),
|
|
0 commit comments