mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 09:48:59 +02:00
fix(extras): better reasons as to why some extras are included in your config.
This commit is contained in:
parent
6efbdabd1b
commit
eeccbbc407
4 changed files with 45 additions and 5 deletions
|
@ -250,10 +250,30 @@ end
|
|||
---@param extra LazyExtra
|
||||
function X:extra(extra)
|
||||
if not extra.managed then
|
||||
self:diagnostic({
|
||||
message = "Not managed by LazyExtras (config)",
|
||||
severity = vim.diagnostic.severity.WARN,
|
||||
})
|
||||
---@type LazyExtra[]
|
||||
local parents = {}
|
||||
for _, x in ipairs(self.extras) do
|
||||
if x.enabled and vim.tbl_contains(x.imports, extra.module) then
|
||||
parents[#parents + 1] = x
|
||||
end
|
||||
end
|
||||
if #parents > 0 then
|
||||
local pp = vim.tbl_map(function(x)
|
||||
return x.name
|
||||
end, parents)
|
||||
self:diagnostic({
|
||||
message = "Required by " .. table.concat(pp, ", "),
|
||||
})
|
||||
elseif vim.tbl_contains(LazyVim.plugin.core_imports, extra.module) then
|
||||
self:diagnostic({
|
||||
message = "This extra is included by default",
|
||||
})
|
||||
else
|
||||
self:diagnostic({
|
||||
message = "Not managed by LazyExtras (config)",
|
||||
severity = vim.diagnostic.severity.WARN,
|
||||
})
|
||||
end
|
||||
end
|
||||
extra.row = self.text:row()
|
||||
local hl = extra.managed and "LazySpecial" or "LazyLocal"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue