About

Developer tooling is crucial for developer productivity. Language Server Protocol, in particular, allow language features to be communicated to editors without having to rely on hacky editor magic.

However, current implementations of the protocol do not adequately support the meteoric rise in demand for code completion via LLMs. LLMs are prone to hallucination, and existing methods such as exhaustive retrieval and RAG are limited by token size and inconsistency. Approaching this with a language semantics-based retrieval can have benefits over unstructured approaches, but LSP currently do not expose an interface for static retrieval.

We propose a conservative addendum to the Language Server Protocol, ChatLSP, to address this issue. ChatLSP defines new LSP methods that abstracts over static retrieval algorithms. Being a part of LSP allows for different editors and language developers to support this feature easily. We plan on working with language developers to provide language-specific static retrieval algorithms.