Skip to content

CLI-009: Language Server Protocol (LSP) Implementation #76

@ajitpratap0

Description

@ajitpratap0

Summary

Implement LSP server for IDE integration (VSCode, Vim, Emacs, Neovim, etc.).

Problem

No LSP server - can't integrate with IDEs that support LSP.

Action Items

  1. Implement gosqlx lsp command

  2. LSP features (following LSP spec):

    • textDocument/didOpen: Track opened SQL files
    • textDocument/didChange: Incremental parsing
    • textDocument/publishDiagnostics: Syntax errors
    • textDocument/hover: Keyword/function documentation
    • textDocument/completion: Autocomplete keywords
    • textDocument/formatting: Format SQL
    • textDocument/definition: Go to table/column definition
    • textDocument/codeAction: Quick fixes
  3. Performance requirements:

    • Sub-second response time for diagnostics
    • Incremental parsing for large files
    • Low memory footprint
  4. Test with major editors:

    • VSCode
    • Vim/Neovim (via coc.nvim or native LSP)
    • Emacs (via lsp-mode)
    • Sublime Text
  5. Document integration for each editor

Acceptance Criteria

  • LSP server implemented following specification
  • Works with VSCode, Vim, Emacs, Sublime
  • Sub-second response time (<1s)
  • Integration guides for each editor
  • Diagnostic messages helpful

Technical Details

Priority: High
Effort: Large (80h / 2-3 months)
Phase: Phase 5 - Integrations & Ecosystem
Dependencies: None

Example Usage

# Start LSP server
gosqlx lsp --stdio

# VSCode settings.json
{
  "gosqlx.lsp.enable": true,
  "gosqlx.lsp.path": "gosqlx"
}

Related

Foundation for INT-001 (VSCode extension) and all IDE integrations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions