This guide covers IDE configurations, plugins, and settings optimized for Drupal development across popular IDEs and editors.
Drupal-Specific:
- Drupal Support - Core Drupal support with code completion and inspections
- Symfony Support - Essential for modern Drupal (built on Symfony)
- Composer Support - Composer integration
- Twig Support - Twig template engine support
Code Quality:
- PHP Inspections (EA Extended) - Advanced PHP inspections
- PHP Annotations - Better annotation support
- Deep Assoc Completion - Array completion
- PHP Toolbox - Additional PHP tools
Development Workflow:
- DDEV Integration - DDEV local development
- String Manipulation - Text manipulation tools
- AceJump - Quick navigation
- Code With Me - Collaborative coding
On the main menu go to Code > Detect Drupal Namespace roots
Add Drupal-specific file templates:
Drupal Module (.info.yml):
name: ${MODULE_NAME}
type: module
description: '${DESCRIPTION}'
package: Custom
core_version_requirement: ^9 || ^10 || ^11
dependencies:
- drupal:nodeDrupal Service (.services.yml):
services:
${MODULE_NAME}.${SERVICE_NAME}:
class: Drupal\${MODULE_NAME}\${CLASS_NAME}
arguments: ['@entity_type.manager', '@current_user']- Settings → Code Style → PHP
- Set to "Drupal" coding standards
- Enable "Use 'use' for classes from the current namespace"
- Set array formatting to align values
Add custom live templates for Drupal:
// Drupal hook implementation
/**
* Implements hook_$HOOK$().
*/
function $MODULE$_$HOOK$($PARAMETERS$) {
$END$
}
// Drupal service injection
public function __construct($PARAMETERS$) {
parent::__construct($PARAMETERS$);
$END$
}Editor → General:
- Enable "Show whitespaces"
- Set tab size to 2 spaces
- Enable "Ensure line feed at file end on Save"
Inspections:
- Enable all Drupal-specific inspections
- Configure PHPDoc inspections for Drupal standards
Install via Package Control:
- Drupal - Drupal syntax highlighting and snippets
- PHP-Twig - Twig template support
- SublimeLinter-php - PHP linting
- Composer - Composer support
- YAML Nav - YAML file navigation
{
"tab_size": 2,
"translate_tabs_to_spaces": true,
"ensure_newline_at_eof_on_save": true,
"trim_trailing_white_space_on_save": true,
"rulers": [80],
"word_wrap": false
}For all IDEs, configure:
- Indentation: 2 spaces (no tabs)
- Line endings: LF (Unix)
- Character encoding: UTF-8
- Max line length: 80 characters
- Trailing whitespace: Remove on save
- Final newline: Ensure present
Configure proper syntax highlighting for Drupal files:
.module→ PHP.install→ PHP.theme→ PHP.inc→ PHP.info.yml→ YAML.libraries.yml→ YAML.routing.yml→ YAML.services.yml→ YAML.twig→ Twig/HTML
Exclude unnecessary directories:
node_modules/vendor/web/sites/default/files/.git/- Build directories (
dist/,build/)
Store team IDE configurations in project:
.vscode/settings.jsonfor VS Code.idea/directory for PhpStorm (selective commits).editorconfigfor cross-IDE consistency
- PHP_CodeSniffer: Configure Drupal standards
- PHPStan: Set up Drupal-specific rules
- ESLint: Configure for Drupal JavaScript
- Stylelint: Set up for Drupal CSS/SCSS