Skip to content

gmr/postgres-lsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postgres-lsp

A Language Server Protocol (LSP) implementation for PostgreSQL and PL/pgSQL, built with tree-sitter-postgres and tower-lsp.

Features

  • Diagnostics — Parse errors from tree-sitter reported as LSP diagnostics
  • Semantic Tokens — Syntax highlighting via semantic token classification
  • Document Symbols — Outline of DDL statements (tables, functions, views, etc.)
  • Workspace Symbols — Search across all open files
  • Go to Definition — Navigate to table, function, type, and column definitions
  • Find References — Find all usages of a symbol across the workspace
  • Hover — Show definition source on hover
  • Completion — Context-aware completion for keywords, tables, columns, and functions
  • Folding Ranges — Collapse multi-line statements
  • Rename — Rename symbols across the workspace
  • PL/pgSQL Support — Parses PL/pgSQL function bodies with language injection

Building

cargo build

Requires the tree-sitter-postgres repository cloned as a sibling directory (../tree-sitter-postgres).

Usage

The server communicates over stdio:

cargo run -p pg-lsp

Configure your editor to use pg-lsp as the language server for .sql files.

License

BSD-3-Clause

About

Language Server for Postgres and PL/PgSQL

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors