mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
use new util
This commit is contained in:
parent
a45cd326ec
commit
acf3cca302
2 changed files with 4 additions and 36 deletions
|
@ -23,7 +23,7 @@
|
|||
servers = {
|
||||
hls = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.haskellPackages.haskell-language-server) "--debug"];
|
||||
cmd = [(getExe pkgs.haskellPackages.haskell-language-server) "--lsp"];
|
||||
filetypes = ["haskell" "lhaskell"];
|
||||
on_attach =
|
||||
mkLuaInline
|
||||
|
@ -51,29 +51,9 @@
|
|||
*/
|
||||
''
|
||||
function(bufnr, on_dir)
|
||||
local root_pattern = function(...)
|
||||
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.uv.fs_stat(p) then
|
||||
return path
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
if match ~= nil then
|
||||
return match
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
on_dir(root_pattern('hie.yaml', 'stack.yaml', 'cabal.project', '*.cabal', 'package.yaml')(fname))
|
||||
end
|
||||
on_dir(util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project', '*.cabal', 'package.yaml')(fname))
|
||||
end
|
||||
'';
|
||||
settings = {
|
||||
haskell = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue