diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/hls.lua | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lua/lspconfig/server_configurations/hls.lua b/lua/lspconfig/server_configurations/hls.lua index 32b3ea22..54b45e98 100644 --- a/lua/lspconfig/server_configurations/hls.lua +++ b/lua/lspconfig/server_configurations/hls.lua @@ -4,7 +4,12 @@ return { default_config = { cmd = { 'haskell-language-server-wrapper', '--lsp' }, filetypes = { 'haskell', 'lhaskell' }, - root_dir = util.root_pattern('*.cabal', 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml'), + root_dir = function(filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) + end, single_file_support = true, settings = { haskell = { @@ -34,10 +39,17 @@ return { https://github.com/haskell/haskell-language-server Haskell Language Server - ]], + ]], default_config = { - root_dir = [[root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml")]], + root_dir = [[ +function (filepath) + return ( + util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project')(filepath) + or util.root_pattern('*.cabal', 'package.yaml')(filepath) + ) +end + ]], }, }, } |
