Skip to content

Commit a218779

Browse files
committed
Fix getOptions to honor LSP config overrides
This is a bit ugly, but we already do it in defaultMain I also realized I don't really understand the HLS config options anymore.
1 parent 8dfb998 commit a218779

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{-# LANGUAGE DerivingStrategies #-}
66
{-# LANGUAGE DuplicateRecordFields #-}
77
{-# LANGUAGE ExistentialQuantification #-}
8+
{-# LANGUAGE OverloadedLabels #-}
89
{-# LANGUAGE PolyKinds #-}
910
{-# LANGUAGE RankNTypes #-}
1011
{-# LANGUAGE RecursiveDo #-}
@@ -163,6 +164,7 @@ import Debug.Trace.Flags (userTracingEnabled)
163164
import qualified Development.IDE.Types.Exports as ExportsMap
164165
import HieDb.Types
165166
import Ide.Plugin.Config
167+
import Ide.Plugin.Properties (useProperty)
166168
import qualified Ide.PluginUtils as HLS
167169
import Ide.Types (PluginId)
168170

@@ -308,7 +310,14 @@ instance IsIdeGlobal GlobalIdeOptions
308310
getIdeOptions :: Action IdeOptions
309311
getIdeOptions = do
310312
GlobalIdeOptions x <- getIdeGlobalAction
311-
return x
313+
env <- lspEnv <$> getShakeExtras
314+
case env of
315+
Nothing -> return x
316+
Just env -> do
317+
config <- liftIO $ LSP.runLspT env HLS.getClientConfig
318+
return x{optCheckProject = pure $ checkProject config,
319+
optCheckParents = pure $ checkParents config
320+
}
312321

313322
getIdeOptionsIO :: ShakeExtras -> IO IdeOptions
314323
getIdeOptionsIO ide = do

0 commit comments

Comments
 (0)