feat: add VSCode extension for GoSQLX#132
Conversation
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>
|
Claude finished @ajitpratap0's task —— View job VSCode Extension Code ReviewI'll conduct a comprehensive code review of the VSCode extension implementation. Let me analyze the code systematically: Review Tasks
Code Quality Assessment✅ StrengthsWell-structured TypeScript Code
Comprehensive Package Configuration
Rich Language Support
🚨 Critical Issues Found1. Security Vulnerability - Command Injection
|
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>
|
Claude finished @ajitpratap0's task —— View job VSCode Extension Code ReviewI'll conduct a comprehensive code review of the VSCode extension implementation. Let me analyze the code systematically: Review Tasks
Code Quality Assessment✅ StrengthsWell-structured TypeScript Code
Comprehensive Package Configuration
Rich Language Support
🚨 Critical Issues Found1. Security Vulnerability - Command Injection Risk
|
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>
|
Claude finished @ajitpratap0's task —— View job VSCode Extension Code ReviewI've conducted a comprehensive code review of the VSCode extension implementation. Here's my detailed analysis: Review Tasks
Code Quality Assessment✅ StrengthsWell-structured TypeScript Code
Comprehensive Package Configuration
Rich Language Support
🚨 Critical Issues Found1. Security Vulnerability - Command Injection Risk
|
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>
|
Claude finished @ajitpratap0's task —— View job VSCode Extension Code ReviewI've conducted a comprehensive code review of the VSCode extension implementation. Here's my detailed analysis: Review Tasks
Code Quality Assessment✅ StrengthsWell-structured TypeScript Code
Comprehensive Package Configuration
Rich Language Support
🚨 Critical Issues Found1. Security Risk - Command Line Length Vulnerability
|
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>
|
Claude finished @ajitpratap0's task —— View job VSCode Extension Code ReviewI've conducted a comprehensive code review of the VSCode extension implementation. Here's my detailed analysis: Review Tasks
Code Quality Assessment✅ StrengthsWell-structured TypeScript Code
Comprehensive Package Configuration
Rich Language Support
Robust Error Recovery & Validation
|
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>
|
Claude finished @ajitpratap0's task —— View job VSCode Extension Code ReviewI've conducted a comprehensive code review of the VSCode extension implementation. Here's my detailed analysis: Review Tasks
Code Quality Assessment✅ StrengthsWell-structured TypeScript Code
Comprehensive Package Configuration
Rich Language Support
Robust Error Recovery & Validation
Excellent Utility Modules
|
Root Cause Analysis: - CI runs `go test -race` which adds 3-5x overhead - Performance/timing tests (TestSustainedLoad_*, TestTokenizeContext_CancellationResponseTime) have strict throughput/timing requirements incompatible with race detection overhead - macOS CI runners showed failures due to this incompatibility Fix: - Add race detection skip to sustained load tests (following existing pattern in performance_regression_test.go:89-93) - Add raceEnabled constant to tokenizer package (race.go/norace.go) - Add skip to TestTokenizeContext_CancellationResponseTime This follows the established pattern in the codebase: - Race detection tests: Verify thread safety (speed irrelevant) - Performance tests: Measure throughput (race overhead unacceptable) Tests affected: - pkg/sql/parser: TestSustainedLoad_* (6 tests) - pkg/sql/tokenizer: TestTokenizeContext_CancellationResponseTime 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @ajitpratap0's task —— View job VSCode Extension Code Review
|
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>
* 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>

Summary
Implement official VSCode extension for GoSQLX with full LSP client integration.
Closes #72
Features
Real-time SQL Validation
SQL Formatting
Ctrl+Shift+F/Cmd+Shift+FSyntax Highlighting
Comprehensive TextMate grammar covering:
--and block/* */)$1and named:param)Intelligent Autocomplete
Additional Features
Extension Structure
Commands
GoSQLX: Validate SQLGoSQLX: Format SQLGoSQLX: Analyze SQLGoSQLX: Restart Language ServerSettings
gosqlx.enabletruegosqlx.executablePathgosqlxgosqlx.format.indentSize2gosqlx.format.uppercaseKeywordstruegosqlx.dialectgenericInstallation
Test Plan
Dependencies
gosqlxCLI tool installed and in PATH🤖 Generated with Claude Code