|
10 | 10 | import com.intellij.psi.xml.XmlTokenType;
|
11 | 11 | import com.magento.idea.magento2plugin.magento.files.MftfActionGroup;
|
12 | 12 | import com.magento.idea.magento2plugin.magento.files.MftfTest;
|
| 13 | +import com.magento.idea.magento2plugin.magento.files.UiComponentXml; |
13 | 14 | import com.magento.idea.magento2plugin.reference.provider.*;
|
14 | 15 | import com.magento.idea.magento2plugin.reference.provider.mftf.*;
|
15 | 16 | import com.magento.idea.magento2plugin.util.RegExUtil;
|
@@ -226,24 +227,38 @@ public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar)
|
226 | 227 |
|
227 | 228 | // <someXmlTag component="requireJsMappingKey" />
|
228 | 229 | registrar.registerReferenceProvider(
|
229 |
| - XmlPatterns.xmlAttributeValue().withParent( |
230 |
| - XmlPatterns.xmlAttribute().withName("component") |
231 |
| - ), |
232 |
| - new RequireJsPreferenceReferenceProvider() |
| 230 | + XmlPatterns.xmlAttributeValue().withParent( |
| 231 | + XmlPatterns.xmlAttribute().withName(UiComponentXml.XML_ATTRIBUTE_COMPONENT) |
| 232 | + ), |
| 233 | + new RequireJsPreferenceReferenceProvider() |
233 | 234 | );
|
234 | 235 |
|
235 | 236 | // <item name="component">requireJsMappingKey</item>
|
236 | 237 | registrar.registerReferenceProvider(
|
237 |
| - XmlPatterns.psiElement(XmlTokenType.XML_DATA_CHARACTERS).withParent( |
238 |
| - XmlPatterns.xmlText().withParent( |
239 |
| - XmlPatterns.xmlTag().withName("item").withChild( |
240 |
| - XmlPatterns.xmlAttribute().withValue(string().matches("component")) |
241 |
| - ).withChild( |
242 |
| - XmlPatterns.xmlAttribute().withName("name") |
243 |
| - ) |
244 |
| - ) |
245 |
| - ), |
246 |
| - new RequireJsPreferenceReferenceProvider() |
| 238 | + XmlPatterns.psiElement(XmlTokenType.XML_DATA_CHARACTERS).withParent( |
| 239 | + XmlPatterns.xmlText().withParent( |
| 240 | + XmlPatterns.xmlTag().withName(UiComponentXml.XML_TAG_ITEM).withChild( |
| 241 | + XmlPatterns.xmlAttribute().withValue(string().matches(UiComponentXml.XML_ATTRIBUTE_COMPONENT)) |
| 242 | + ).withChild( |
| 243 | + XmlPatterns.xmlAttribute().withName(UiComponentXml.XML_ATTRIBUTE_NAME) |
| 244 | + ) |
| 245 | + ) |
| 246 | + ), |
| 247 | + new RequireJsPreferenceReferenceProvider() |
| 248 | + ); |
| 249 | + |
| 250 | + // <item name="template">reference</item> |
| 251 | + registrar.registerReferenceProvider( |
| 252 | + XmlPatterns.psiElement(XmlTokenType.XML_DATA_CHARACTERS).withParent( |
| 253 | + XmlPatterns.xmlText().withParent( |
| 254 | + XmlPatterns.xmlTag().withName(UiComponentXml.XML_TAG_ITEM).withChild( |
| 255 | + XmlPatterns.xmlAttribute().withValue(string().matches(UiComponentXml.XML_ATTRIBUTE_TEMPLATE)) |
| 256 | + ).withChild( |
| 257 | + XmlPatterns.xmlAttribute().withName(UiComponentXml.XML_ATTRIBUTE_NAME) |
| 258 | + ) |
| 259 | + ) |
| 260 | + ), |
| 261 | + new FilePathReferenceProvider() |
247 | 262 | );
|
248 | 263 |
|
249 | 264 | registerReferenceForDifferentNesting(registrar);
|
|
0 commit comments