mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-30 14:49:43 +02:00
Merge pull request #1250 from kylo252/fixup
chore: remove now-redundant utility function
This commit is contained in:
commit
c8d1b95712
2 changed files with 1 additions and 28 deletions
|
@ -203,7 +203,6 @@ table.insert(gls.right, {
|
||||||
local function get_attached_provider_name(msg)
|
local function get_attached_provider_name(msg)
|
||||||
msg = msg or "LSP Inactive"
|
msg = msg or "LSP Inactive"
|
||||||
local buf_clients = vim.lsp.buf_get_clients()
|
local buf_clients = vim.lsp.buf_get_clients()
|
||||||
local utils = require "utils"
|
|
||||||
if next(buf_clients) == nil then
|
if next(buf_clients) == nil then
|
||||||
return msg
|
return msg
|
||||||
end
|
end
|
||||||
|
@ -215,7 +214,7 @@ local function get_attached_provider_name(msg)
|
||||||
table.insert(buf_client_names, client.name)
|
table.insert(buf_client_names, client.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
utils.list_extend_unique(buf_client_names, null_ls_providers)
|
vim.list_extend(buf_client_names, null_ls_providers)
|
||||||
return table.concat(buf_client_names, ", ")
|
return table.concat(buf_client_names, ", ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -113,32 +113,6 @@ function utils.get_active_client_by_ft(filetype)
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Extends a list-like table with the unique values of another list-like table.
|
|
||||||
---
|
|
||||||
--- NOTE: This mutates dst!
|
|
||||||
---
|
|
||||||
--@see |vim.tbl_extend()|
|
|
||||||
---
|
|
||||||
--@param dst list which will be modified and appended to.
|
|
||||||
--@param src list from which values will be inserted.
|
|
||||||
--@param start Start index on src. defaults to 1
|
|
||||||
--@param finish Final index on src. defaults to #src
|
|
||||||
--@returns dst
|
|
||||||
function utils.list_extend_unique(dst, src, start, finish)
|
|
||||||
vim.validate {
|
|
||||||
dst = { dst, "t" },
|
|
||||||
src = { src, "t" },
|
|
||||||
start = { start, "n", true },
|
|
||||||
finish = { finish, "n", true },
|
|
||||||
}
|
|
||||||
for i = start or 1, finish or #src do
|
|
||||||
if not vim.tbl_contains(dst, src[i]) then
|
|
||||||
table.insert(dst, src[i])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return dst
|
|
||||||
end
|
|
||||||
|
|
||||||
function utils.unrequire(m)
|
function utils.unrequire(m)
|
||||||
package.loaded[m] = nil
|
package.loaded[m] = nil
|
||||||
_G[m] = nil
|
_G[m] = nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue