Skip to content

Commit 45eacd5

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 45eacd5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ import Debug.Trace.Flags (userTracingEnabled)
163163
import qualified Development.IDE.Types.Exports as ExportsMap
164164
import HieDb.Types
165165
import Ide.Plugin.Config
166+
import Ide.Plugin.Properties (useProperty)
166167
import qualified Ide.PluginUtils as HLS
167168
import Ide.Types (PluginId)
168169

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

313321
getIdeOptionsIO :: ShakeExtras -> IO IdeOptions
314322
getIdeOptionsIO ide = do

0 commit comments

Comments
 (0)