✔️ Formatter
✔️ Click to go
✔️ Autocomplete
✔️ Syntax highlight
✔️ Blade components
✔️ Volt class-based
❌ Volt functional API
This plugin works with "PHP" language mode. Please, disable other related extensions that adds "Blade" language and restart VSCode.
Autocomplete
Make autocomplete smooth inside quotes as you type.
"editor.quickSuggestions": {
"strings": "on"
}
1) Make Voltage as default formatter for PHP.
"[php]": {
"editor.defaultFormatter": "robsontenorio.voltage"
}
2) Install Laravel Pint.
composer require --dev laravel/pint
3) Install Prettier dependencies.
yarn add --dev prettier prettier-plugin-blade@^2
4) Create a .prettierrc
file at root of your project.
{
"printWidth": 180,
"plugins": [
"prettier-plugin-blade"
],
"overrides": [
{
"files": [
"*.php"
],
"options": {
"parser": "blade"
}
}
]
}
5) Optionally, enable format on save.
"editor.formatOnSave": true,
Scan components
You do not need to do it manually.
But, just in case, you can hit Voltage: Scan components
from the command palette.
Let's keep pushing it, sponsor me ❤️
Follow me
@robsontenorio
Feedback
https://github.com/robsontenorio/voltage