magento / magento2-phpstorm-plugin

PHPStorm Plugin for Magento 2
Open Software License 3.0
436 stars 102 forks source link

Update RegExUtil.java #2348

Closed LouisdeLooze closed 1 month ago

LouisdeLooze commented 1 month ago

Updating theme regex to support dashes.

Description (*) According to the Magento devdocs:

The folder name conventionally matches naming used in the theme's code: any alphanumeric set of characters, as the vendor sees fit, is acceptable. This convention is merely a recommendation, so nothing prevents naming this directory in another way.

The current regex limits the themes to: match group is_participating start end content
1 0 yes 0 21 frontend/Vendor/theme
2 0 yes 44 74 frontend/Vendor/custom9_theme9
3 0 yes 106 136 frontend/Vendor/custom9_theme9
4 0 yes 137 159 frontend/Vendor/custom
5 0 yes 196 225 frontend/Vendor/custom9Theme9
The adapted regex allows the themes to be: match group is_participating start end content
1 0 yes 0 21 frontend/Vendor/theme
2 0 yes 22 43 frontend/Vendor/Theme
3 0 yes 44 74 frontend/Vendor/custom9_theme9
4 0 yes 75 105 frontend/Vendor/Custom9_theme9
5 0 yes 106 136 frontend/Vendor/custom9_theme9
6 0 yes 137 165 frontend/Vendor/custom-theme
7 0 yes 166 195 frontend/Vendor/Custom9Theme9
8 0 yes 196 225 frontend/Vendor/custom9Theme9
9 0 yes 226 247 frontend/vendor/theme
10 0 yes 248 269 frontend/vendor/Theme
11 0 yes 270 300 frontend/vendor/custom9_theme9
12 0 yes 301 331 frontend/vendor/Custom9_theme9
13 0 yes 332 362 frontend/vendor/custom9_theme9
14 0 yes 363 391 frontend/vendor/custom-theme
15 0 yes 392 421 frontend/vendor/Custom9Theme9
16 0 yes 422 451 frontend/vendor/custom9Theme9

Thanks @sdouma for the regex!

Fixed Issues (if relevant)

  1. Fixes magento/magento2-phpstorm-plugin#1517

Questions or comments

Contribution checklist (*)

LouisdeLooze commented 1 month ago

Hi @VitaliyBoyko Just tried running the test again locally from both clean branches,

VitaliyBoyko commented 1 month ago

@LouisdeLooze thank you. Will check it. Could you please create a backport PR to the 5.3.1-develop branch?