Visual Studio Code Smart Drupal SnippetsThis extension adds rich language support for the Drupal Hooks API and Drupal Form and render elements to VS Code. This extension is intended as a successor to Drupal 8 Snippets. Usage & FeaturesType part of a snippet, press enter and/Or tab, and the snippet unfolds. Built from Drupal CoreHooks gathered by scraping the codebase of the latest minor versions of Drupal 9. This includes those that are marked as deprecated. Smart hook replacementSnippets will automatically replace the leading
Smart element replacementSnippets will automatically render the element array base on RenderElement or FormElement. Start by typing FormElement will have @FormElement
@RenderElement
@Element
Typing [type_name]
Smart service snippetWhile 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
Deprecated services
Tab StopsSnippets are formatted to have tab stops on values that need replaced like Hook Replacement
Element ReplacementFormElement have ServicesServices snippets provide a snake-cased, tab-stopped variable matching the service's name. On snippet insertion, the variable can be overwritten easily. Installation
ContributionsThis project is maintained on Github. Your bugs, feature requests, and pull requests are welcome. |









