diff --git a/CHANGELOG.md b/CHANGELOG.md index 2155c261f..99f0d2473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ - Changed Maven plugin id from `maven` to `org.jetbrains.idea.maven` [#879](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/879) - FlexibleSearch is not injected into Kotlin simple string literals [#882](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/882) - IntelliLang pattern fix applied multiple times on each project re-opening during the same session [#884](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/884) +- `Select ImpEx Statement` removes User Rights block [#898](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/898) ## [2023.3.2] diff --git a/src/com/intellij/idea/plugin/hybris/impex/actions/ImpExTableSelectAction.kt b/src/com/intellij/idea/plugin/hybris/impex/actions/ImpExTableSelectAction.kt index f69ffc7e2..ed11cbfb3 100644 --- a/src/com/intellij/idea/plugin/hybris/impex/actions/ImpExTableSelectAction.kt +++ b/src/com/intellij/idea/plugin/hybris/impex/actions/ImpExTableSelectAction.kt @@ -1,6 +1,6 @@ /* * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. - * Copyright (C) 2019-2023 EPAM Systems and contributors + * Copyright (C) 2019-2024 EPAM Systems and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -37,20 +37,17 @@ class ImpExTableSelectAction : AbstractImpExTableAction() { } override fun performCommand(project: Project, editor: Editor, element: PsiElement) { - if (element is ImpexUserRights) { - element.delete() - return - } - - val header = when (element) { - is ImpexHeaderLine -> element + val tableRange = when (element) { + is ImpexUserRights -> element.textRange + is ImpexHeaderLine -> element.tableRange is ImpexValueLine -> PsiTreeUtil.getPrevSiblingOfType(element, ImpexHeaderLine::class.java) + ?.tableRange ?: return else -> return } - with(header.tableRange) { + with(tableRange) { editor.selectionModel.setSelection(startOffset, endOffset) } }