magento2-phpstorm-plugin
magento2-phpstorm-plugin copied to clipboard
Update RegExUtil.java
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)
- Fixes magento/magento2-phpstorm-plugin#1517
Questions or comments
Contribution checklist (*)
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [x] All new or changed code is covered with integration/functional tests (if applicable)
- [x] All automated tests passed successfully (all builds are green)