Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(buf_ls): add buf_ls support #485

Merged
merged 8 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ local DEFAULT_SETTINGS = {
| HTMX | [`htmx`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#htmx) |
| Hypr | [`hyprls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#hyprls) |
| Java | [`ast_grep`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#ast_grep) |
| Java | [`harper_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#harper_ls) |
| Java | [`java_language_server`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#java_language_server) |
| Java | [`jdtls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#jdtls) |
| JavaScript | [`ast_grep`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#ast_grep) |
Expand Down Expand Up @@ -344,7 +345,7 @@ local DEFAULT_SETTINGS = {
| PICO-8 | [`pico8_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#pico8_ls) |
| PowerShell | [`powershell_es`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#powershell_es) |
| Prisma | [`prismals`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#prismals) |
| Protobuf | [`bufls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#bufls) |
| Protobuf | [`buf_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#buf_ls) |
| Protobuf | [`pbls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#pbls) |
| Puppet | [`puppet`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#puppet) |
| PureScript | [`purescriptls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#purescriptls) |
Expand All @@ -358,7 +359,6 @@ local DEFAULT_SETTINGS = {
| Python | [`pyre`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#pyre) |
| Python | [`pyright`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#pyright) |
| Python | [`ruff`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#ruff) |
| Python | [`ruff_lsp`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#ruff_lsp) |
| Python | [`sourcery`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#sourcery) |
| Raku | [`raku_navigator`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#raku_navigator) |
| Reason | [`reason_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#reason_ls) |
Expand Down Expand Up @@ -428,7 +428,6 @@ local DEFAULT_SETTINGS = {
| TypeScript | [`vtsls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vtsls) |
| Typespec | [`tsp_server`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#tsp_server) |
| Typst | [`tinymist`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#tinymist) |
| Typst | [`typst_lsp`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#typst_lsp) |
| Vala | [`vala_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vala_ls) |
| Verilog | [`hdl_checker`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#hdl_checker) |
| Veryl | [`veryl_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#veryl_ls) |
Expand Down
4 changes: 1 addition & 3 deletions doc/mason-lspconfig-mapping.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bicep-lsp bicep
biome biome
brighterscript bright_script
bsl-language-server bsl_ls
buf-language-server bufls
buf buf_ls
bzl bzl
cairo-language-server cairo_ls
clangd clangd
Expand Down Expand Up @@ -158,7 +158,6 @@ rome rome
rubocop rubocop
ruby-lsp ruby_lsp
ruff ruff
ruff-lsp ruff_lsp
rust-analyzer rust_analyzer
salt-lsp salt_ls
serve-d serve_d
Expand Down Expand Up @@ -204,7 +203,6 @@ typescript-language-server ts_ls
tsp-server tsp_server
twiggy-language-server twiggy_language_server
typos-lsp typos_lsp
typst-lsp typst_lsp
unocss-language-server unocss
v-analyzer v_analyzer
vacuum vacuum
Expand Down
4 changes: 1 addition & 3 deletions doc/server-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
| [biome](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#biome) | [biome](https://mason-registry.dev/registry/list#biome) |
| [bright_script](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#bright_script) | [brighterscript](https://mason-registry.dev/registry/list#brighterscript) |
| [bsl_ls](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#bsl_ls) | [bsl-language-server](https://mason-registry.dev/registry/list#bsl-language-server) |
| [bufls](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#bufls) | [buf-language-server](https://mason-registry.dev/registry/list#buf-language-server) |
| [buf_ls](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#buf_ls) | [buf](https://mason-registry.dev/registry/list#buf) |
| [bzl](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#bzl) | [bzl](https://mason-registry.dev/registry/list#bzl) |
| [cairo_ls](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#cairo_ls) | [cairo-language-server](https://mason-registry.dev/registry/list#cairo-language-server) |
| [clangd](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#clangd) | [clangd](https://mason-registry.dev/registry/list#clangd) |
Expand Down Expand Up @@ -155,7 +155,6 @@
| [rubocop](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#rubocop) | [rubocop](https://mason-registry.dev/registry/list#rubocop) |
| [ruby_lsp](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#ruby_lsp) | [ruby-lsp](https://mason-registry.dev/registry/list#ruby-lsp) |
| [ruff](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#ruff) | [ruff](https://mason-registry.dev/registry/list#ruff) |
| [ruff_lsp](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#ruff_lsp) | [ruff-lsp](https://mason-registry.dev/registry/list#ruff-lsp) |
| [rust_analyzer](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#rust_analyzer) | [rust-analyzer](https://mason-registry.dev/registry/list#rust-analyzer) |
| [salt_ls](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#salt_ls) | [salt-lsp](https://mason-registry.dev/registry/list#salt-lsp) |
| [serve_d](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#serve_d) | [serve-d](https://mason-registry.dev/registry/list#serve-d) |
Expand Down Expand Up @@ -201,7 +200,6 @@
| [tsp_server](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#tsp_server) | [tsp-server](https://mason-registry.dev/registry/list#tsp-server) |
| [twiggy_language_server](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#twiggy_language_server) | [twiggy-language-server](https://mason-registry.dev/registry/list#twiggy-language-server) |
| [typos_lsp](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#typos_lsp) | [typos-lsp](https://mason-registry.dev/registry/list#typos-lsp) |
| [typst_lsp](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#typst_lsp) | [typst-lsp](https://mason-registry.dev/registry/list#typst-lsp) |
| [unocss](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#unocss) | [unocss-language-server](https://mason-registry.dev/registry/list#unocss-language-server) |
| [v_analyzer](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#v_analyzer) | [v-analyzer](https://mason-registry.dev/registry/list#v-analyzer) |
| [vacuum](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vacuum) | [vacuum](https://mason-registry.dev/registry/list#vacuum) |
Expand Down
6 changes: 3 additions & 3 deletions lua/mason-lspconfig/mappings/filetype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ return {
plaintex = { "ltex", "texlab" },
postcss = { "tailwindcss", "unocss" },
prisma = { "prismals" },
proto = { "bufls", "clangd", "pbls" },
proto = { "buf_ls", "clangd", "pbls" },
ps1 = { "powershell_es" },
pug = { "emmet_language_server", "emmet_ls" },
puppet = { "puppet" },
purescript = { "purescriptls" },
python = { "ast_grep", "basedpyright", "dprint", "harper_ls", "jedi_language_server", "pylsp", "pylyzer", "pyre", "pyright", "ruff", "ruff_lsp", "snyk_ls", "sourcery" },
python = { "ast_grep", "basedpyright", "dprint", "harper_ls", "jedi_language_server", "pylsp", "pylyzer", "pyre", "pyright", "ruff", "snyk_ls", "sourcery" },
ql = { "codeqlls" },
quarto = { "ltex" },
r = { "r_language_server" },
Expand Down Expand Up @@ -213,7 +213,7 @@ return {
["typescript.tsx"] = { "angularls", "biome", "denols", "eslint", "rome", "ts_ls", "vtsls" },
typescriptreact = { "angularls", "biome", "cssmodules_ls", "denols", "dprint", "emmet_language_server", "emmet_ls", "eslint", "graphql", "harper_ls", "htmx", "rome", "sourcery", "tailwindcss", "ts_ls", "unocss", "vtsls" },
typespec = { "tsp_server" },
typst = { "tinymist", "typst_lsp" },
typst = { "tinymist" },
v = { "v_analyzer", "vls" },
vala = { "vala_ls" },
vb = { "omnisharp", "omnisharp_mono" },
Expand Down
4 changes: 1 addition & 3 deletions lua/mason-lspconfig/mappings/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ M.lspconfig_to_package = {
["biome"] = "biome",
["bright_script"] = "brighterscript",
["bsl_ls"] = "bsl-language-server",
["bufls"] = "buf-language-server",
["buf_ls"] = "buf",
["bzl"] = "bzl",
["cairo_ls"] = "cairo-language-server",
["clangd"] = "clangd",
Expand Down Expand Up @@ -158,7 +158,6 @@ M.lspconfig_to_package = {
["rubocop"] = "rubocop",
["ruby_lsp"] = "ruby-lsp",
["ruff"] = "ruff",
["ruff_lsp"] = "ruff-lsp",
["rust_analyzer"] = "rust-analyzer",
["salt_ls"] = "salt-lsp",
["serve_d"] = "serve-d",
Expand Down Expand Up @@ -205,7 +204,6 @@ M.lspconfig_to_package = {
["twiggy_language_server"] = "twiggy-language-server",
["typos_lsp"] = "typos-lsp",
["tinymist"] = "tinymist",
["typst_lsp"] = "typst-lsp",
["unocss"] = "unocss-language-server",
["v_analyzer"] = "v-analyzer",
["vacuum"] = "vacuum",
Expand Down
6 changes: 4 additions & 2 deletions scripts/lua/mason-scripts/mason-lspconfig/generate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ local function create_lspconfig_filetype_map()
local filetype_map = {}

for _, server_name in ipairs(_.keys(lspconfig_server_mapping.lspconfig_to_package)) do
local config =
assert(lspconfig[server_name], ("Failed to get config for %s"):format(server_name)).document_config
local config = assert(
lspconfig[server_name] and lspconfig[server_name].document_config,
("Failed to get config for %s"):format(server_name)
)
for _, filetype in ipairs(config.default_config.filetypes or {}) do
if not filetype_map[filetype] then
filetype_map[filetype] = {}
Expand Down
Loading