Smart PHP Semicolon
Automatically adds semicolons to common PHP statements when you press Enter.
Features
- Automatically adds
; to common PHP statements.
- Keeps normal VS Code Enter behavior inside
{} blocks.
- Avoids duplicate semicolons.
- Skips control structures such as
if, else, foreach, while, and switch.
- Supports common statements such as
echo, return, throw, and function/method calls.
- Works only in PHP files.
Example
Without a semicolon:
$name = "John"
Press Enter:
$name = "John";
Control structures are left unchanged:
if ($name == "John") {
echo "Hello";
}
Settings
smartPhpSemicolon.enabled
Enable or disable automatic semicolon insertion.
Default:
true
smartPhpSemicolon.includeReturn
Choose whether return statements should automatically receive a semicolon.
Default:
true
Requirements
VS Code 1.85.0 or newer.
License
MIT
| |