Visual Studio Code Smart Drupal Snippets
Usage & Features
Type part of a snippet, press enter and/Or tab, and the snippet unfolds.
Built from Drupal Core
Hooks gathered by scraping the codebase of the latest minor versions of Drupal 9. This includes those that are marked as deprecated.
Smart hook replacement
Snippets will automatically replace the leading
Smart element replacement
Snippets will automatically render the element array base on RenderElement or FormElement. Start by typing
FormElement will have
Smart service snippet
While services with global methods allow IDEs to suggest methods and properties, those retrieved using the \Drupal::service() method do not. Service snippets provide a easy access to all core services in a datatyped variable allowing intellisense suggestions.
Services without datatyping
Services with datatyping
Snippets are formatted to have tab stops on values that need replaced like
Services snippets provide a snake-cased, tab-stopped variable matching the service's name. On snippet insertion, the variable can be overwritten easily.
This project is maintained on Github.
Your bugs, feature requests, and pull requests are welcome.