From b11eb34cc9ad3141878cc810326ce7e2603090b0 Mon Sep 17 00:00:00 2001 From: Pavan Rikhi Date: Thu, 25 Mar 2021 12:35:49 -0400 Subject: [PATCH] Add CPP Options for Stylish Haskell & Brittany Formatters This fixes an issue where the `stylish-haskell` & `brittany` plugins weren't being added to the enabled plugins list, even if HLS was compiled with their specific flags or the `all-formatters` flag. Also removed the AGPL flag checking when adding the `brittany` plugin, since that is no longer defined anywhere. --- exe/Plugins.hs | 2 +- haskell-language-server.cabal | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/exe/Plugins.hs b/exe/Plugins.hs index 4672ab92b2..d6c37789fa 100644 --- a/exe/Plugins.hs +++ b/exe/Plugins.hs @@ -110,7 +110,7 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins #if retrie Retrie.descriptor "retrie" : #endif -#if AGPL && brittany +#if brittany Brittany.descriptor "brittany" : #endif #if class diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 37e87c4b31..739ca653ee 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -265,10 +265,12 @@ common ormolu common stylishHaskell if flag(stylishHaskell) || flag(all-formatters) build-depends: hls-stylish-haskell-plugin ^>= 1.0.0.0 + cpp-options: -DstylishHaskell common brittany if (flag(brittany) || flag(all-formatters)) build-depends: hls-brittany-plugin ^>= 1.0.0.0 + cpp-options: -Dbrittany executable haskell-language-server import: common-deps