Skip to content
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

Added code completion dtoClass Level Mapping tags #777

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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