27 lines
614 B
Lua
27 lines
614 B
Lua
local ok, hls = pcall(require, 'hls')
|
|
if not ok then
|
|
print("hls is not installed.")
|
|
return
|
|
end
|
|
|
|
if hls == nil then
|
|
return
|
|
end
|
|
|
|
hls.setup {
|
|
cmd = { "haskell-language-server-wrapper", '--lsp' },
|
|
filetypes = { "haskell", "lhaskell" },
|
|
root_dir = function (filepath)
|
|
return (
|
|
vim.util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath)
|
|
or vim.util.root_pattern('*.cabal', 'package.yaml')(filepath)
|
|
)
|
|
end,
|
|
settings = {
|
|
haskell = {
|
|
formattingProvider = "ormolu"
|
|
}
|
|
},
|
|
single_file_support = true,
|
|
}
|