Postgres 语言服务器:首个版本发布
Postgres Language Server: Initial Release

原始链接: https://github.com/supabase-community/postgres-language-server

这个项目提供了一套全面的 Postgres 开发语言工具,核心是一个强大的语言服务器协议 (LSP) 实现。它利用 Postgres 自身的 `libpg_query` 来确保完美的语法兼容性,提供自动补全、语法错误高亮、类型检查(使用 `EXPLAIN` 的分析结果)和一个受 Squawk 启发的代码风格检查器。 基于服务器-客户端架构,其功能不仅可以通过 LSP 访问,还可以通过 CLI、HTTP API 或 WebAssembly 访问,从而提高了广泛的可访问性。项目的重点是完善这些核心功能并构建可靠的基础设施。该项目的设计灵感来自 Biome 的工具链结构和 Squawk 的代码风格检查器。欢迎贡献,未来的开发计划可以在 issues 和讨论区中找到。

Supabase团队发布了其Postgres语言服务器的初始版本,该项目历时两年。该服务器以独立二进制文件、npm包、VS Code扩展以及通过nvim-lspconfig和mason的方式提供,旨在改善Postgres开发体验。团队强调了他们采用务实方案的做法,并承认Biome项目对其开发过程产生了重大影响。一个关键特性——将tree-sitter与libpg_query集成——直接源于之前Hacker News帖子收到的反馈。团队鼓励用户测试该服务器,报告错误,提出建议并贡献Rust代码库。更多细节可以在链接的博文和安装指南中找到。
相关文章
  • (评论) 2024-06-10
  • Postgres.new:具有 AI 界面的浏览器内 Postgres 2024-08-14
  • (评论) 2024-08-13
  • (评论) 2024-08-14
  • 拉普塞 2024-02-19

  • 原文

    Postgres Language Server

    A collection of language tools and a Language Server Protocol (LSP) implementation for Postgres, focusing on developer experience and reliable SQL tooling.

    This project provides a toolchain for Postgres development, built on Postgres' own parser libpg_query to ensure 100% syntax compatibility. It is built on a Server-Client architecture with a transport-agnostic design. This means all features can be accessed not only through the Language Server Protocol, but also through other interfaces like a CLI, HTTP APIs, or a WebAssembly module. The goal is to make all the great Postgres tooling out there as accessible as possible, and to build anything that is missing ourselves.

    Currently, the following features are implemented:

    • Autocompletion
    • Syntax Error Highlighting
    • Type-checking (via EXPLAIN error insights)
    • Linter, inspired by Squawk

    Our current focus is on refining and enhancing these core features while building a robust and easily accessible infrastructure. For future plans and opportunities to contribute, please check out the issues and discussions. Any contributions are welcome!

    A big thanks to the following projects, without which this project wouldn't have been possible:

    • libpg_query: For extracting the Postgres' parser
    • Biome: For implementing a toolchain infrastructure we could copy from
    • Squawk: For the linter inspiration
    联系我们 contact @ memedata.com