Protobuf has LSP support. You're welcome

Hacker News Top Tools

Summary

Buf announces the first fully-featured, production-grade LSP server for Protobuf, providing modern IDE support such as go to definition and code completion, powered by the Buf CLI.

No content available
Original Article
View Cached Full Text

Cached at: 08/16/26, 09:45 PM

# Protobuf finally has LSP support. You’re welcome. · Buf Source: [https://buf.build/blog/protobuf-lsp](https://buf.build/blog/protobuf-lsp) Buf is proud to announce the first fully\-featured, production\-grade LSP server for Protobuf\. The[Language Server Protocol](https://microsoft.github.io/language-server-protocol/)is the standard API for integrating language support into your favorite IDE or text editor, such as VSCode, IntelliJ, or Neovim\. An LSP server provides the smarts that power go to definition, code completion, finding references, and semantics\-aware syntax highlighting\. Before today, Protobuf lacked the same LSP support other major programming languages enjoy\. We don’t want to overstate our own work, but**this is a game\-changer for Protobuf development**: Protobuf now has modern IDE support for the first time, all powered by the[Buf CLI](https://buf.build/product/cli)\. At Buf, we believe that Protobuf is the best schema language, thanks to its established ecosystem of libraries and tools\. Protobuf shouldn’t just be the smart choice; it should be the easiest choice too\. This is why we’re releasing the Buf LSP server, as part of our family of tools that complete the Protobuf ecosystem, including[Protobuf\-ES](https://github.com/bufbuild/protobuf-es)\(used in Chromium\!\),[Protovalidate](https://protovalidate.com/),[ConnectRPC](https://connectrpc.com/), and the[Buf Schema Registry](https://buf.build/product/bsr)\. No matter your project or use\-case, developing with Protobuf should be the easy,*obvious*choice\. Here’s how you can try it out\! ## Installing the Buf LSP [VSCode](https://code.visualstudio.com/)is one of the most popular graphical editors available, and it has stellar LSP support \(LSP originated with VSCode\)\. To use the Buf LSP, just install the[Buf extension](https://marketplace.visualstudio.com/items?itemName=bufbuild.vscode-buf)\. This will automatically use your installed version of the[Buf CLI](https://buf.build/product/cli)\(which bundles the LSP server\), or install one if you need it\. [Neovim](https://neovim.io/)is Buf engineers’ favorite editor, and the Buf LSP works great with it, too\. All you need to do is install the Buf CLI, and configure Neovim to use it as an LSP server\. 1. Make sure you’ve installed the`nvim\-lspconfig`repository, which provides default LSP config options\. Follow the instructions[here](https://github.com/neovim/nvim-lspconfig?tab=readme-ov-file#install)\. 2. Add`lspconfig\.buf\_ls\.setup \{\}`to your`\.nvimrc`\. Alternatively, you can add the following somewhere in`init\.lua`\(or another config file, if you like\): ``` vim.lsp.config('buf-lsp', { cmd = { 'buf', 'lsp', 'serve' }, filetypes = { 'proto' }, root_markers = { 'buf.yaml', '.git' }, }) ``` Then, you can enable it with`vim\.lsp\.enable\('buf\-lsp'\)`in your`\.nvimrc`\. Learn more about LSP and Neovim[here](https://neovim.io/doc/user/lsp.html)\. If you’re using another editor, first find out how LSP integration works, and just make sure the`buf lsp serve`command gets run to spawn the server\. Buf already maintains a Protobuf compiler frontend \(the part that parses files and calls plugins, like`protoc`\), which we call[`protocompile`](https://github.com/bufbuild/protocompile)\. Our implementation isn’t just fully\-compliant, but it is much faster and more flexible than`protoc`\. Our compiler is so good that even Google is using it alongside`protoc`in some parts of its massive codebase\. To build the Buf LSP, we’ve taken`protocompile`to the next level\. We’ve developed a brand\-new,[query\-driven](https://rustc-dev-guide.rust-lang.org/query.html)frontend which enables incremental compilation and much better diagnostics\. For example, unlike`protoc`, we correctly diagnose a duplicate`repeated`modifier: ``` error: encountered more than one type modifier --> testdata/parser/type/repeated.proto:23:14 | 23 | repeated repeated M x4 = 4; | -------- ^^^^^^^^ help: consider removing this | | | first one is here ``` We designed a new AST and intermediate representation for precisely diagnosing these errors, instead of using`FileDescriptorProto`\. Its flexibility makes it easy for us to implement new language features as they are added to Protobuf, such as upcoming features in Editions 2024\. It is also memory\-efficient, so it can handle workspaces that include very large Buf modules\. ## Our commitment Our work on the Buf LSP is not done\. We are always improving our diagnostics, and we’re planning to add more features to the LSP server, too: - Adding`import`s as an automatic fix\. - Tighter integration with`buf\.yaml`\(such as automatically importing modules\)\. - Code completion and reference lookup for custom options\. - Automatic suggestion of field/enum numbers\. - Dedicated Protovalidate support, including syntax highlighting for CEL snippets\. At Buf, we will always push the boundary of what*you*can accomplish with Protobuf, enabling schema\-driven development for all\! If you want help enforcing standards on your organization’s data,[contact us](https://buf.build/contact)to see if Buf can help\. If building excellent developer tooling excites you, check out our[careers page](https://buf.build/careers)\!

Similar Articles

Protobuf-py: Protobuf for Python, without compromises

Hacker News Top

Buf announces protobuf-py, a new Protocol Buffers library for Python written from scratch that passes the full conformance suite, generates readable typed Python, and offers optional Rust acceleration for performance.

protocolbuffers/protobuf

GitHub Trending (daily)

Protocol Buffers is Google's language-neutral, platform-neutral data interchange format. This README provides installation instructions and usage guidelines for the protocol compiler and runtime.

Interactive refactoring in gopls

Lobsters Hottest

gopls v0.24.0 introduces interactive refactoring via a new proposed LSP capability for multi-step dialogs, allowing language servers to collect user input before computing edits — designed as an open standard in collaboration with the Dart team for all editors and languages.

Type Server Protocol

Hacker News Top

Pylance 是 Microsoft 为 Visual Studio Code 提供的快速、功能丰富的 Python 语言支持扩展,基于 Pyright 类型引擎,提供代码补全、类型检查、语义高亮及 Copilot Chat 技能等功能,并可通过多种设置自定义性能与功能。