From 086f2afe93c467cfd10dfecd2bb26205060d0d65 Mon Sep 17 00:00:00 2001 From: Michael Lan <44309097+mizlan@users.noreply.github.com> Date: Thu, 29 Dec 2022 21:30:13 -0800 Subject: feat: add cabal support to hls (#2370) * add note for when to modify filetypes field * specify cabalfmt as the formatter for cabal files --- lua/lspconfig/server_configurations/hls.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/hls.lua b/lua/lspconfig/server_configurations/hls.lua index 54b45e98..e0d0e702 100644 --- a/lua/lspconfig/server_configurations/hls.lua +++ b/lua/lspconfig/server_configurations/hls.lua @@ -14,6 +14,7 @@ return { settings = { haskell = { formattingProvider = 'ormolu', + cabalFormattingProvider = 'cabalfmt', }, }, lspinfo = function(cfg) @@ -39,6 +40,14 @@ return { https://github.com/haskell/haskell-language-server Haskell Language Server + +If you are using HLS 1.9.0.0, enable the language server to launch on Cabal files as well: + +```lua +require('lspconfig')['hls'].setup{ + filetypes = { 'haskell', 'lhaskell', 'cabal' }, +} +``` ]], default_config = { -- cgit v1.2.3-70-g09d2