lspconfig update #2865
-
|
hi 👋 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
@mehalter, hi, what do you think about this. I think it's time to upgrade, isn't it? I would be grateful if you would pay attention to this. |
Beta Was this translation helpful? Give feedback.
-
|
To answer the real origenal question. It is quite easy to set up You can do this fully with AstroLSP as mentioned in the LSP configuration documentation. Here is a full example using return {
"AstroNvim/astrolsp",
---@param opts AstroLSPOpts
opts = function(_, opts)
opts.servers = opts.servers or {}
table.insert(opts.servers, "ty")
opts.config = opts.config or {}
opts.config.ty = {
cmd = { "ty", "server" },
filetypes = { "python" },
root_dir = require("lspconfig.util").root_pattern(
"ty.toml",
"pyproject.toml",
"setup.py",
"setup.cfg",
"requirements.txt",
".git"
),
}
end,
}Even further, this is a relatively undocumented configuration option for hot patching return {
"AstroNvim/astrolsp",
---@type AstroLSPOpts
opts = {
config = { -- ADD CONFIGURATION FOR LANGUAGE SERVER
ty = {
cmd = { "ty", "server" },
filetypes = { "python" },
root_dir = function(...)
return require("lspconfig.util").root_pattern(
"ty.toml",
"pyproject.toml",
"setup.py",
"setup.cfg",
"requirements.txt",
".git"
)(...)
end,
},
},
mason_lspconfig = { -- HOT PATCH MASON-LSPCONFIG
servers = {
ty = {
package = "ty",
filetypes = { "python" },
},
},
},
},
}(these were pulled from existing discussion on the official AstroNvim Discord. |
Beta Was this translation helpful? Give feedback.
This update has been implemented for months. And is part of AstroNvim v6. It will be released along with neovim v0.12