VS Code Syntax Buddy extension

This tool is for intelligent syntax correction of Python code and helps you write cleaner code with fewer errors.
Features
SyntaxBuddy offers the following features:
- Automatically adds missing colons (
:
) to control structures and function/class definitions.
- Inserts empty parentheses
()
for conditions that lack them and have no arguments.
- Fixes incomplete
def
statements (e.g., def my_func
→ def my_func():
).
- Adds
pass
to blocks with no body ( empty if
, def
, class
).
- Selectively fixes only the highlighted section of code.
- Supports folder-wide fixing for all
.py
files.
- Undo functionality to revert the last fix.
- Full support for Python keywords:
if
, elif
, else
, for
, while
, def
, class
, try
, except
, finally
, with
, async def
, match
, case
, async for
, async with
.
Before & After Examples:
Before:
def greet
if name
print("Hello", name)
After:
def greet():
if name():
print("Hello", name)
Before:
class MyClass:
def method():
if condition:
After:
class MyClass:
pass
def method():
pass
if condition:
pass
📦 Requirements
No external dependencies required.
Works out of the box with VS Code and Python files.
⚙️ Extension Settings
SyntaxBuddy includes a settings panel where you can customize its behavior.
To access settings:
- Press
Ctrl + Shift + T
to open the settings panel directly
or
- Press
Ctrl + Shift + P
and search for SyntaxBuddy: Settings
Available customizations:
- Disabling the comment section in code editing
- Disable automatic
pass
insertion
- Enable "check-only" mode (highlight issues without applying fixes)
- Save fix statistics to a
.json
file
- Automatically back up original files before fixing
- Switch between English and فارسی interface
All settings are accessible through VS Code’s built-in settings UI — no manual configuration required.
🐞 Known Issues
- Backup files are stored in
.syntaxbuddy_backup/
— clean manually if needed.
- Python code indents are not corrected.
⌨️ Keyboard Shortcuts
Action |
Shortcut (Windows/Linux) |
Shortcut (macOS) |
Fix current file |
Ctrl + Shift + ; |
Cmd + Shift + ; |
Open settings panel |
Ctrl + Shift + T |
Cmd + Shift + T |
Access other commands |
via Command Palette |
via Command Palette |
Use Ctrl + Shift + P
and search for:
SyntaxBuddy: Fix Syntax
SyntaxBuddy: Modify all Python files in a folder
SyntaxBuddy: Undo Fix
📣 Release Notes
0.0.1
Initial release with core syntax fixing features:
- Colon and parentheses insertion
pass
insertion
- Folder-wide fixing
- Undo functionality
- Settings panel