Skip to content

[bugfix] [Tests] Test coverage for PHP class completion for backend model; bugfix for #126 #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Bugfix: PHP classes completion to the backend_model attribute and tag…
… not in the right files
  • Loading branch information
Vasilii Burlacu committed Apr 8, 2020
commit 0a4cdc2f2878586d93fdaf5e0c3c0fedaa899c12
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,19 @@ public XmlCompletionContributor() {
new PhpClassCompletionProvider()
);

// <backend_model>completion</backend_model>
extend(CompletionType.BASIC,
psiElement(XmlTokenType.XML_DATA_CHARACTERS)
.inside(XmlPatterns.xmlTag().withName(ModuleSystemXml.XML_TAG_BACKEND_MODEL)),
new PhpClassCompletionProvider()
// <backend_model>completion</backend_model> in system.xml
extend(CompletionType.BASIC, psiElement(XmlTokenType.XML_DATA_CHARACTERS)
.inside(XmlPatterns.xmlTag().withName(ModuleSystemXml.XML_TAG_BACKEND_MODEL)
.withParent(XmlPatterns.xmlTag().withName(ModuleSystemXml.FIELD_ELEMENT_NAME))
).inFile(xmlFile().withName(string().matches(ModuleSystemXml.FILE_NAME))),
new PhpClassCompletionProvider()
);

// <randomTag backend_model="completion">
// <randomTag backend_model="completion"> in config.xml
extend(CompletionType.BASIC, psiElement(XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN)
.inside(XmlPatterns.xmlAttribute().withName(ModuleConfigXml.XML_ATTRIBUTE_BACKEND_MODEL)),
new PhpClassCompletionProvider()
.inside(XmlPatterns.xmlAttribute().withName(ModuleConfigXml.XML_ATTRIBUTE_BACKEND_MODEL))
.inFile(xmlFile().withName(string().matches(ModuleConfigXml.FILE_NAME))),
new PhpClassCompletionProvider()
);

// <parameter source_model="completion">...</parameter> in widget.xml files.
Expand Down