mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 18:45:08 +02:00
fix: add deprecation notice for lvim.lang.foo.lsp (#1670)
This commit is contained in:
parent
48a6d859f3
commit
efd8f589b7
2 changed files with 27 additions and 0 deletions
|
@ -115,6 +115,11 @@ lvim.plugins = {
|
|||
|
||||
- inside LunarVim `:PackerUpdate`
|
||||
|
||||
## Breaking changes
|
||||
|
||||
- `lvim.lang.FOO.lsp` is no longer supported after #1584.
|
||||
You can either use `:NlspConfig` for most of the settings you might need, or override the setup by adding an entry to `lvim.lsp.override = { "FOO" }`.
|
||||
|
||||
## Resources
|
||||
|
||||
- [Documentation](https://www.lunarvim.org)
|
||||
|
|
|
@ -124,6 +124,26 @@ function M:init(opts)
|
|||
require("lsp.manager").init_defaults(supported_languages)
|
||||
end
|
||||
|
||||
local function deprecation_notice()
|
||||
local in_headless = #vim.api.nvim_list_uis() == 0
|
||||
if in_headless then
|
||||
return
|
||||
end
|
||||
|
||||
for lang, entry in pairs(lvim.lang) do
|
||||
local deprecated_config = entry["lsp"] or {}
|
||||
if not vim.tbl_isempty(deprecated_config) then
|
||||
local msg = string.format(
|
||||
"Deprecation notice: [lvim.lang.%s.lsp] setting is no longer supported. See https://github.com/LunarVim/LunarVim#breaking-changes",
|
||||
lang
|
||||
)
|
||||
vim.schedule(function()
|
||||
vim.notify(msg, vim.log.levels.WARN)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Override the configuration with a user provided one
|
||||
-- @param config_path The path to the configuration overrides
|
||||
function M:load(config_path)
|
||||
|
@ -137,6 +157,8 @@ function M:load(config_path)
|
|||
return
|
||||
end
|
||||
|
||||
deprecation_notice()
|
||||
|
||||
self.path = config_path
|
||||
|
||||
autocmds.define_augroups(lvim.autocommands)
|
||||
|
|
Loading…
Reference in a new issue