Skip to content

Commit

Permalink
Fix getOptions to honor LSP config overrides
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pepeiborra committed Nov 26, 2021
1 parent 8dfb998 commit 45eacd5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ghcide/src/Development/IDE/Core/Shake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ import Debug.Trace.Flags (userTracingEnabled)
import qualified Development.IDE.Types.Exports as ExportsMap
import HieDb.Types
import Ide.Plugin.Config
import Ide.Plugin.Properties (useProperty)
import qualified Ide.PluginUtils as HLS
import Ide.Types (PluginId)

Expand Down Expand Up @@ -308,7 +309,14 @@ instance IsIdeGlobal GlobalIdeOptions
getIdeOptions :: Action IdeOptions
getIdeOptions = do
GlobalIdeOptions x <- getIdeGlobalAction
return x
env <- lspEnv <$> getShakeExtras
case env of
Nothing -> return x
Just env -> do
config <- liftIO $ LSP.runLspT env HLS.getClientConfig
return x{optCheckProject = pure $ checkProject config,
optCheckParents = pure $ checkParents config
}

getIdeOptionsIO :: ShakeExtras -> IO IdeOptions
getIdeOptionsIO ide = do
Expand Down

0 comments on commit 45eacd5

Please sign in to comment.