nvim-lspconfig/lsp/gn_language_server.lua
Shuhei Takahashi 6149d851b7
feat: gn_language_server #4276
This patch adds support for [gn-language-server](https://github.com/google/gn-language-server), a language server for GN (the build configuration language used in Chromium, Fuchsia, and other projects).

While `nvim-lspconfig` already includes a configuration for [`gnls`](https://github.com/neovim/nvim-lspconfig/blob/master/lsp/gnls.lua) by Microsoft, this is a separate implementation written from scratch in Rust. Unlike the Microsoft version, which primarily focuses on single-file analysis, this server analyzes the entire workspace for definitions and references. To my knowledge, it is currently the most powerful GN language server available.

It is the officially recommended language server for Chromium and Fuchsia:
- Chromium: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/vscode.md#recommended-extensions
- Fuchsia: https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/fuchsia.code-workspace#63
2026-01-08 16:05:31 -05:00

14 lines
322 B
Lua

---@brief
---
--- https://github.com/google/gn-language-server
---
--- A language server for GN, the build configuration language used in Chromium,
--- Fuchsia, and other projects.
---@type vim.lsp.Config
return {
cmd = { 'gn-language-server', '--stdio' },
filetypes = { 'gn' },
root_markers = { '.gn', '.git' },
}