Two New Instances Of The Language Server Protocol
Written by Nikos Vaggalis   
Thursday, 01 May 2025

The first is in relation to Github Copilot and the second
to PostgreSQL. They enable seamless integration with any tool that supports the protocol.

The Language Server Protocol or LSP for short is what enables IDEs to act smart; auto completion, go to definition, documentation hovering, tip giving etc. LSP is an attempt to standardization, so that any IDE or tool with support of it can integrate features like the aforementioned ones for multiple languages, with minimal effort.

In the battle of the IDEs, till recently the choice in programming language would also direct the choice in the IDE to do development too. But with the advent of the LSP, which separates the language from the editor, the lines have been blurred because any IDE can nowadays support any given language. As such these days almost all IDEs work with LSP behind the scenes under a client-server model; Jetbrains' editors and VSCode are the most popular of those.

But the LSP support while inherently about programming languages, for instance for Perl there's Perl::LanguageServer, can be applicable to other use cases as well. Two of those we'll look into here.

The first is the recently announced by Microsoft Copilot Language Server SDK. This enables any editor or IDE to integrate with GitHub Copilot via LSP. This gives access to things like predicting what a developer might be going to type next based on what they have already typed, chatting with Copilot like you do with ChatGPT or generating commit messages with AI.

The second LSP instance and the more exciting one, is that of the PostgreSQL LSP by Supabase:

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

This initial server release supports the following:

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

and is available for VSCode and Neovim as plugins.

But LSP isn't restricted to IDEs; any tool can take advantage of it. As such the PostgreSQL LSP is available from CLI, HTTP APIs, or a WebAssembly modules. Behind the scenes, it uses the actual Postgres parser, libpg_query, something that guarantees 100% syntax compatibility with the PostgreSQL SQL dialect syntax.

Both can be installed with NPM. To integrate with the Copilot Language Server, download the latest release from npm:

npm install @github/copilot-language-server

To run the language server, platform-specific binaries are available in the native directory of the npm package. For example, for macOS on arm64:

./node_modules/@github/copilot-language-server/native/darwin-arm64/copilot-language-server --version

Communication then with the language server typically happens over stdio with --stdio. The language-server.js distribution additionally supports Node IPC with --node-ipc.

As far as the PostgreSQL one goes, run the following commands in a directory containing a package.json file.

npm add --save-dev --save-exact @postgrestools/postgrestools

Now you can use it via the command line in the shape of Postgres Tools, or a using a code editor that supports an LSP using the LSP Proxy which when executed, two processes will spawn:

a daemon that does execute the requested operations;
a server that functions as a proxy between the requests of the client - the editor - and the server - the daemon; If your editor is able to interact with a server and send JSON-RPC requests, you only need to configure the editor to run that command.

Full instructions on the links bellow.

 

More Information

Copilot LSP

PostgreSQL Tools/LSP

Related Articles

The Github Copilot Mega Thread

GitHub Copilot Gets Agent Mode

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Tailpipe - The Log Interrogation Game Changer
24/04/2025

By using the expressiveness of the SQL language, TailPipe makes querying log files as easy as doing "select * from logs;".



FSF Hackathon To Improve Free Software
18/05/2025

This year the Free Software Foundation is marking its 40th Anniversary and is running a global online Hackathon open to everyone in the free software community. For projects interested in partici [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info