nvim: after/ftplugin/cabal: Enable HLS on cabal files
Enabling HLS on cabal files allows us to format them using gq. HLS just uses the internal cabal-fmt plugin. https://haskell-language-server.readthedocs.io/en/latest/features.html#formatting
This commit is contained in:
parent
01e9c92051
commit
34a5bbdacb
2 changed files with 10 additions and 1 deletions
4
nvim/.config/nvim/after/ftplugin/cabal.lua
Normal file
4
nvim/.config/nvim/after/ftplugin/cabal.lua
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
local lsp_utils = require('lsp-utils')
|
||||||
|
local hls_config = lsp_utils.hls_config()
|
||||||
|
|
||||||
|
vim.lsp.start(hls_config)
|
|
@ -177,7 +177,12 @@ function M.hls_config()
|
||||||
root_dir = root_directory,
|
root_dir = root_directory,
|
||||||
filetypes = { 'haskell' },
|
filetypes = { 'haskell' },
|
||||||
single_file_support = true,
|
single_file_support = true,
|
||||||
settings = { haskell = { formattingProvider = 'ormolu' } },
|
settings = {
|
||||||
|
haskell = {
|
||||||
|
formattingProvider = 'ormolu' ,
|
||||||
|
cabalFormattingProvider = 'cabalfmt',
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue