Skip to content

Commit

Permalink
#777 | Added code completion dtoClass Level Mapping tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mlytvyn authored Oct 29, 2023
1 parent 9694cbb commit c584972
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- Use single space after Header Mode [#761](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/761)
- Added shortcut `control + alt + backspace` for remove column action [#775](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/775)

### `OCC` enhancements
- Added code completion `dtoClass` Level Mapping tags [#777](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/777)

### `Cockpit NG` enhancements
- Improved detection of the `config` files [#760](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/760)
- Improved detection of the `widgets` files [#759](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/759)
Expand Down
3 changes: 2 additions & 1 deletion resources/META-INF/lang/beanSystem-dependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<dom.fileMetaData rootTagName="beans" stubVersion="9"
implementation="com.intellij.idea.plugin.hybris.system.bean.BSDomFileDescription"/>

<completion.contributor language="XML" implementationClass="com.intellij.idea.plugin.hybris.system.bean.codeInsight.completion.BSCompletionContributor"/>
<completion.contributor language="XML" order="before javaClassReference"
implementationClass="com.intellij.idea.plugin.hybris.system.bean.codeInsight.completion.BSCompletionContributor"/>

<lang.foldingBuilder language="XML" implementationClass="com.intellij.idea.plugin.hybris.system.bean.lang.folding.BeansXmlFoldingBuilder"/>
<codeInsight.lineMarkerProvider language="XML" implementationClass="com.intellij.idea.plugin.hybris.system.bean.codeInsight.daemon.BeansXmlBeanSiblingsLineMarkerProvider"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object BSLookupElementFactory {
else -> HybrisIcons.BS_BEAN
}
)
?.withCaseSensitivity(true)
?.withCaseSensitivity(false)

fun build(meta: BSMetaProperty) = meta.name
?.let { LookupElementBuilder.create(it) }
Expand Down
34 changes: 23 additions & 11 deletions src/com/intellij/idea/plugin/hybris/system/bean/psi/BSPatterns.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ package com.intellij.idea.plugin.hybris.system.bean.psi
import com.intellij.idea.plugin.hybris.common.HybrisConstants
import com.intellij.idea.plugin.hybris.system.bean.model.*
import com.intellij.idea.plugin.hybris.system.bean.model.Enum
import com.intellij.patterns.PlatformPatterns
import com.intellij.patterns.StandardPatterns
import com.intellij.patterns.XmlAttributeValuePattern
import com.intellij.patterns.XmlPatterns
import com.intellij.patterns.*
import com.intellij.psi.xml.XmlAttributeValue

object BSPatterns {

Expand Down Expand Up @@ -60,13 +58,27 @@ object BSPatterns {
)
.inside(beansXmlFile)

val BEAN_CLASS: XmlAttributeValuePattern = XmlPatterns.xmlAttributeValue(Bean.CLASS)
.withSuperParent(
2,
XmlPatterns.xmlTag()
.withLocalName(Beans.BEAN)
)
.inside(beansXmlFile)
val BEAN_CLASS: ElementPattern<XmlAttributeValue> = XmlPatterns.or(
XmlPatterns.xmlAttributeValue(Bean.CLASS)
.withSuperParent(
2,
XmlPatterns.xmlTag()
.withLocalName(Beans.BEAN)
)
.inside(beansXmlFile),

XmlPatterns.xmlAttributeValue("value")
.withSuperParent(
2,
XmlPatterns.xmlTag()
.withLocalName("property")
.withAttributeValue("name", "dtoClass")
.withParent(
XmlPatterns.xmlTag().withLocalName("bean")
)
)
.inside(springBeansXmlFile)
)

val ENUM_CLASS: XmlAttributeValuePattern = XmlPatterns.xmlAttributeValue(Enum.CLASS)
.withSuperParent(
Expand Down

0 comments on commit c584972

Please sign in to comment.