dotfiles/nvim/.config/nvim/after/ftplugin/haskell.lua

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
492 B
Lua
Raw Normal View History

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' } },
})