Sanchayan Maity
9a26ef9c10
Use the new vim.lsp.start API and LspAttach/Detach auto commands. Drop nvim-lspconfig in the process. LSP server specific configuration has been taken from nvim-lspconfig.
13 lines
492 B
Lua
13 lines
492 B
Lua
local root_files = { 'hie.yaml', 'stack.yaml', 'cabal.project', '*.cabal', 'package.yaml' }
|
|
local path = vim.fs.find(root_files, { type = "file" })
|
|
local root = vim.fs.dirname(path[1])
|
|
|
|
vim.lsp.start({
|
|
name = "hls",
|
|
cmd = { 'haskell-language-server-wrapper', '--lsp' },
|
|
root_dir = root,
|
|
filetypes = { 'haskell' },
|
|
single_file_support = true,
|
|
settings = { haskell = { formattingProvider = 'ormolu' } },
|
|
})
|