magento / magento/magento2-phpstorm-plugin
Enhance XML Autocomplete for Magento 2 Configuration Files
- Dominant language
- Java
- Stars
- 463
- Forks
- 98
- Avg merge
- 1h 6m
- Merged PRs (30d)
- 3
Description
**Is your feature request related to a problem? Please describe.**
This request proposes improvements to the XML autocomplete functionality for various Magento 2 configuration files. Enhancing these autocompletions can significantly speed up development and improve the overall experience for developers working with Magento 2 projects.
**Describe the solution you'd like**
#### `di.xml`
- **`xsi:type` attribute**: Autocomplete for common Magento value types:
- `array`
- `object`
- `string`
- `boolean`
- `null`
- etc.

#### `db_schema.xml`
- **`column` `xsi:type` attribute**: Autocomplete for valid column data types:
- `int`
- `text`
- `varchar`
- `decimal`
- `date`
- `timestamp`
- etc.

#### Layout XML & UI Components (e.g., `layout/*.xml`, `ui_component/*.xml`)
- **``**: Enhance suggestions for valid `xsi:type` values (same list as in `di.xml`, plus any layout/UI-specific ones).

#### `csp_whitelist.xml`
- **`id` attribute**: Autocomplete known CSP directives:
- `script-src`
- `style-src`
- `img-src`
- `frame-src`
- etc.

#### `acl.xml`
- **`resource` `id` attribute**: Autocomplete existing ACL resources:
- `Magento_Backend::admin`
- `Magento_Backend::stores`
- `Magento_Catalog::catalog`
- etc.

#### `routes.xml`
- Autocomplete known frontNames and valid route IDs:
- `admin`
- `standard`

**Additional context**
Benefit to Developers:
- Reduces manual lookup of valid attribute values and resource IDs.
- Decreases the chance of typos and related errors.
- Aligns with Magento’s established XML structure and best practices.
**Additional potential for autocomplete can be found in other, less commonly used configuration files referenced in the documentation**:
https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/files/module-files#configuration-types-objects-and-interfaces
Contributor guide
Research direction
Review the Magento 2 configuration types documentation linked in the issue, then trace how the plugin handles XML files such as di.xml, db_schema.xml, layout/*.xml, ui_component/*.xml, csp_whitelist.xml, acl.xml, and routes.xml. Define the valid completion values for each context and verify that autocomplete appears only for the relevant attributes and elements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, php
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100