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

ImpEx: Ignore case for header line parameters #445

Merged
merged 1 commit into from
May 26, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- Added `Type System` related code completion and reference support for `Type` column [#437](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/437)
- Added `Type System` related code completion and reference support for `Target` column [#438](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/438)
- Added validation of the references to `Type System` [#439](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/439)
- Ignore case for header line parameters [#445](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/445)

### `FlexibleSearch` enhancements
- Added possibility to copy FlexibleSearch from the Java 15 text block `"""SELECT * FROM {Product}"""` [#428](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/428)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ protected void fillDomAttributesCompletions(
) {
final var typeCode = headerTypeName.getText();

resultSet.addAllElements(TSCompletionService.Companion.getInstance(project).getCompletions(typeCode));
resultSet.caseInsensitive()
.addAllElements(TSCompletionService.Companion.getInstance(project).getCompletions(typeCode));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ internal class ImpexTSAttributeReference(owner: ImpexAnyHeaderParameterNameMixin
?.let { metaModelService.findMetaItemByName(it) }
?.let { meta ->
meta.allAttributes
.find { it.name == featureName }
.find { it.name.equals(featureName, true) }
?.let { AttributeResolveResult(it) }
?: meta.allRelationEnds
.find { it.name == featureName }
.find { it.name.equals(featureName, true) }
?.let { RelationEndResolveResult(it) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ object TSLookupElementFactory {
.withStrikeoutness(meta.isDeprecated)
.withTypeText(meta.flattenType, true)
.withIcon(HybrisIcons.TS_ATTRIBUTE)
.withCaseSensitivity(true)

fun build(meta: TSMetaRelation.TSMetaRelationElement) = meta.qualifier
?.let {
Expand All @@ -78,23 +79,22 @@ object TSLookupElementFactory {
})
.withStrikeoutness(relationElement.isDeprecated)
.withTypeText(relationElement.flattenType, true)
.withCaseSensitivity(true)

fun build(meta: TSGlobalMetaEnum, lookupString: String?) = lookupString
?.let {
LookupElementBuilder.create(it)
.withTailText(if (meta.isDynamic) " (" + message("hybris.ts.type.dynamic") + ")" else "", true)
.withIcon(HybrisIcons.TS_ENUM)
.withCaseSensitivity(true)
}

fun buildAttribute(lookupString: String) = LookupElementBuilder.create(lookupString)
.withIcon(HybrisIcons.TS_ATTRIBUTE)
.withTypeText("String", true)

fun build(attribute: TSGlobalMetaItem.TSGlobalMetaItemAttribute, name: String) = LookupElementBuilder.create(name.trim { it <= ' ' })
.withIcon(HybrisIcons.TS_ATTRIBUTE)
.withTailText(if (attribute.isDynamic) " (" + message("hybris.ts.type.dynamic") + ')' else "", true)
.withStrikeoutness(attribute.isDeprecated)
.withTypeText(attribute.flattenType, true)
.withCaseSensitivity(true)

fun build(dom: EnumType) = dom.code.stringValue
?.let {
Expand All @@ -117,5 +117,6 @@ object TSLookupElementFactory {

fun buildCustomProperty(lookupString: String) = LookupElementBuilder.create(lookupString)
.withIcon(HybrisIcons.TS_CUSTOM_PROPERTY)
.withCaseSensitivity(true)

}