TSQLRefineA lightweight Visual Studio Code extension that integrates TSQLRefine into your editor, providing real-time linting, auto-fixing, and formatting for T-SQL files. Features
For details, see Features. Quick Start1. Install TSQLRefine CLI
2. Install this extensionInstall TSQLRefine from the VS Code Marketplace, or search 3. Open a
|
| Command | Description |
|---|---|
TSQLRefine: Run |
Lint the current file |
TSQLRefine: Format |
Format the current file |
TSQLRefine: Fix |
Auto-fix issues in the current file |
Typical Use Cases
- Formatting and linting SQL files before committing
- Catching errors in stored procedures without running them
- Enforcing team-wide SQL style consistency
- Integrating static analysis into CI pipelines
Extension Settings
All settings are under the tsqlrefine namespace: executable path, lint behavior, timeouts, and feature toggles.
For the full settings reference and configuration examples, see Settings.
Supported Languages
This extension activates for files with the following language IDs:
sqltsqlmssql
Troubleshooting
"tsqlrefine not found"
- Verify installation:
tsqlrefine --version - If not in PATH, set
tsqlrefine.pathin settings - Restart VS Code after changing settings
Linting is slow or times out
- Increase timeout:
"tsqlrefine.timeoutMs": 30000 - Disable run-on-type:
"tsqlrefine.runOnType": false
Config file not being used
- Leave
configPathempty for auto-detection - Or set explicitly:
"tsqlrefine.configPath": "${workspaceFolder}/tsqlrefine.json"
Contributing
Issues and pull requests are welcome!
- Report issues at the GitHub repository
- See DEVELOPMENT.md for development guidelines
- Run
npm run verifyto execute the full check suite
About This Extension
This extension serves as an alternative to tsqlrefine-vscode-extension. The original extension references an outdated version of TSQLRefine, so this project was created to enable integration with the latest TSQLRefine releases.
License
MIT License - see the LICENSE file for details.