Enhance your Drupal 10 development workflow with autocomplete and navigation support for projects using Single Directory Components (SDC) approach.
Developed during Learning Day at wunder.io.
The extension works by indexing the .twig components within components directories. Make sure to adjust the paths for the directories relative to the workspace (settings). Index is regenrated when a component (.twig) is saved.
Example:
"drupalSDCHelper.componentDirectories": [
"web/themes/custom/*/components/**",
"web/modules/custom/*/components/**"
]- Autocomplete Component IDs: Get suggestions for component IDs while typing
include,embed, orincludestatements in Twig files. - Go-to Definition: Use
Ctrl + Clickto navigate directly to the component's definition file.
- Open a Twig file in your Drupal project.
- Start typing an
includeorembedstatements and autofill options should be presented. - Press
Enterto accept a suggestion. - Hold
Ctrland click on a component ID to open its definition file.
Are you interested in improving this extension further? Feel free to contribute by creating a pull request at Github.
