WIP: Move to vim.lsp
This commit is contained in:
parent
0b367e1656
commit
d3945cc621
9 changed files with 348 additions and 41 deletions
1
home/modules/nvim/config/lua/dnsc/lsp.lua
Normal file
1
home/modules/nvim/config/lua/dnsc/lsp.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
vim.lsp.enable("ts_ls")
|
||||
|
|
@ -9,6 +9,26 @@ vim.api.nvim_create_autocmd("TextYankPost", {
|
|||
pattern = "*",
|
||||
})
|
||||
|
||||
function root_pattern(...)
|
||||
local patterns = M.tbl_flatten({ ... })
|
||||
return function(startpath)
|
||||
startpath = M.strip_archive_subpath(startpath)
|
||||
for _, pattern in ipairs(patterns) do
|
||||
local match = M.search_ancestors(startpath, function(path)
|
||||
for _, p in ipairs(vim.fn.glob(table.concat({ escape_wildcards(path), pattern }, "/"), true, true)) do
|
||||
if vim.loop.fs_stat(p) then
|
||||
return path
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
if match ~= nil then
|
||||
return match
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function filter(arr, fn)
|
||||
if type(arr) ~= "table" then
|
||||
return arr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue