Commit 139ad0a
feat: add VSCode extension for GoSQLX (#132)
* 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>
* fix: skip timing-sensitive tests under race detection
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>
---------
Co-authored-by: Ajit Pratap Singh <ajitpratapsingh@Ajits-Mac-mini.local>
Co-authored-by: Claude <noreply@anthropic.com>1 parent b429e47 commit 139ad0a
34 files changed
Lines changed: 11039 additions & 31 deletions
File tree
- .github
- cmd/gosqlx/internal/config
- docs
- pkg/sql
- parser
- tokenizer
- vscode-extension
- images
- src
- test
- suite
- unit
- utils
- syntaxes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
| 438 | + | |
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
771 | 771 | | |
772 | 772 | | |
773 | 773 | | |
774 | | - | |
| 774 | + | |
775 | 775 | | |
776 | 776 | | |
777 | 777 | | |
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
943 | | - | |
| 943 | + | |
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
| 440 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
580 | | - | |
| 580 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
| |||
207 | 215 | | |
208 | 216 | | |
209 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
210 | 222 | | |
211 | 223 | | |
212 | 224 | | |
| |||
342 | 354 | | |
343 | 355 | | |
344 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
345 | 361 | | |
346 | 362 | | |
347 | 363 | | |
| |||
460 | 476 | | |
461 | 477 | | |
462 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
463 | 483 | | |
464 | 484 | | |
465 | 485 | | |
| |||
523 | 543 | | |
524 | 544 | | |
525 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
526 | 550 | | |
527 | 551 | | |
528 | 552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
| |||
0 commit comments