fix(lsp): use correct mason-lspconfig API for getting mappings

The mason-lspconfig plugin changed its API. The module
`mason-lspconfig.mappings` no longer has a `get_mason_map()`
function. Instead, the correct API is `require("mason-lspconfig").get_mappings()`
which returns a table with `lspconfig_to_mason` and `mason_to_lspconfig` keys.

This fixes the error:
  module 'mason-lspconfig.mappings' not found

Fixes #6710
This commit is contained in:
Prabhat Ranjan 2025-10-27 20:03:59 +05:30
parent cd745b14f8
commit a8b08388ed
No known key found for this signature in database
GPG key ID: 220FABF40FE966F5

View file

@ -222,7 +222,7 @@ return {
-- get all the servers that are available through mason-lspconfig
local have_mason = LazyVim.has("mason-lspconfig.nvim")
local mason_all = have_mason
and vim.tbl_keys(require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package)
and vim.tbl_keys(require("mason-lspconfig").get_mappings().lspconfig_to_package)
or {} --[[ @as string[] ]]
local mason_exclude = {} ---@type string[]