Commit 18fd29c
feat: add VSCode extension for GoSQLX SQL language support (#135)
* feat: add VSCode extension for GoSQLX (#72)
Implement official VSCode extension with LSP client integration.
Features:
- Real-time SQL validation via GoSQLX LSP server
- SQL syntax highlighting with comprehensive TextMate grammar
- SQL formatting with customizable options (indent, keywords case)
- Intelligent autocomplete for SQL keywords and functions
- Hover documentation for SQL keywords
- SQL analysis command for query complexity
- Multi-dialect support (PostgreSQL, MySQL, SQL Server, Oracle, SQLite)
Extension components:
- package.json: Extension manifest with commands, settings, keybindings
- src/extension.ts: LSP client, command handlers, status bar
- syntaxes/sql.tmLanguage.json: TextMate grammar (keywords, functions, types)
- language-configuration.json: Brackets, comments, indentation rules
Commands:
- GoSQLX: Validate SQL
- GoSQLX: Format SQL
- GoSQLX: Analyze SQL
- GoSQLX: Restart Language Server
Settings:
- gosqlx.enable: Enable/disable language server
- gosqlx.executablePath: Path to gosqlx binary
- gosqlx.format.indentSize: Formatting indent size
- gosqlx.format.uppercaseKeywords: Uppercase SQL keywords
- gosqlx.dialect: SQL dialect selection
Install with: code --install-extension gosqlx-0.1.0.vsix
Closes #72
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: address code review feedback for VSCode extension
Security fixes:
- Replace exec with spawn in analyzeCommand to prevent command injection
- Use argument array instead of string interpolation for process spawning
Bug fixes:
- Assign extensionContext in activate() for restart functionality
- Use cross-platform path (os.tmpdir()) for debug logs on Windows
Improvements:
- Implement actual validation logic in validateCommand
- Display diagnostic counts after validation
- Add basic test coverage with Mocha
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: change license from MIT to proprietary
Update VSCode extension license to most restrictive proprietary license:
- Explicitly prohibits all use, copying, modification, distribution
- Source code viewable only, no rights granted
- All intellectual property rights reserved
- Unauthorized use subject to civil and criminal penalties
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: change project license from MIT to AGPL-3.0
AGPL-3.0 is the most restrictive open source license:
- Copyleft: derivative works must also be AGPL-3.0
- Network use clause: SaaS/server use requires source disclosure
- Closes the "SaaS loophole" present in GPL
Updated files:
- LICENSE (main project)
- vscode-extension/LICENSE
- README.md (badge + 2 text references)
- ACTION_README.md (badge + text reference)
- docs/CLI_GUIDE.md
- docs/COMPARISON.md
- RELEASE_NOTES_v1.5.0.md
- cmd/gosqlx/internal/config/README.md
- .github/MARKETPLACE_PUBLISHING.md
- vscode-extension/package.json
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: address all code review feedback for VSCode extension
Security & Reliability fixes:
- Use stdin for SQL content in analyzeCommand (prevents cmd line injection/length issues)
- Add executable validation before LSP server start
- Add LSP server retry mechanism with exponential backoff (3 retries)
- Add 30-second timeout for analyze command to prevent hanging
- Increase output buffer to 5MB for large analysis results
UX improvements:
- Improve validateCommand with proper diagnostic counting
- Show progress indicator during analysis
- Better status bar feedback (error/retry/running states)
- Open Problems panel when validation finds issues
- Remove broken image reference from README
- Update license reference to AGPL-3.0
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: complete implementation of PR #132 review feedback
HIGH Priority:
- Add 60+ unit tests for command functions, validation, error handling
- Enhance error messaging with platform-specific guidance
- Add configuration validation with helpful suggestions
MEDIUM Priority:
- Add opt-in telemetry with user consent (disabled by default)
- Enhance TextMate grammar with database-specific features
(MySQL, SQL Server, Oracle, SQLite specific syntax)
- Make timeouts fully configurable via settings
LOW Priority:
- Add workspace settings support (resource/window scopes)
- Enhance documentation with 10+ troubleshooting scenarios
- Add performance metrics collection for LSP operations
New files:
- src/utils/validation.ts - Configuration validation
- src/utils/errors.ts - Enhanced error messages
- src/utils/telemetry.ts - Opt-in telemetry
- src/utils/metrics.ts - Performance metrics
- src/test/unit/commands.test.ts - Unit tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* test: add comprehensive VSCode extension tests
Add tests for all feedback items from PR #135 review:
- LSP communication tests (message validation, document sync, completions)
- Configuration validation edge cases (boundary values, type errors)
- Error recovery scenario tests (retry logic, graceful degradation)
- Integration tests with GoSQLX binary (validate, format, analyze, LSP)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Ajit Pratap Singh <ajitpratapsingh@Ajits-Mac-mini.local>
Co-authored-by: Claude <noreply@anthropic.com>1 parent e1d01c2 commit 18fd29c
4 files changed
Lines changed: 3161 additions & 0 deletions
File tree
- vscode-extension/src/test
- integration
- unit
0 commit comments