File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ module Ide.Plugin
16
16
, allLspCmdIds'
17
17
, getPid
18
18
, responseError
19
+ , getClientConfig
20
+ , getClientConfigAction
19
21
) where
20
22
21
23
import Control.Exception (SomeException , catch )
@@ -36,6 +38,7 @@ import Development.IDE.Types.Diagnostics as D
36
38
import Development.IDE.Types.Logger
37
39
import Development.Shake hiding ( Diagnostic , command )
38
40
import GHC.Generics
41
+ import Ide.Logger
39
42
import Ide.Plugin.Config
40
43
import Ide.Plugin.Formatter
41
44
import Ide.Types
@@ -592,4 +595,13 @@ getPrefixAtPos lf uri pos = do
592
595
getClientConfig :: LSP. LspFuncs Config -> IO Config
593
596
getClientConfig lf = fromMaybe Data.Default. def <$> LSP. config lf
594
597
598
+ -- | Returns the client configurarion stored in the IdeState.
599
+ -- You can use this function to access it from shake Rules
600
+ getClientConfigAction :: Action Config
601
+ getClientConfigAction = do
602
+ mbVal <- useNoFile_ GetClientSettings
603
+ logm $ " getClientConfigAction:clientSettings:" ++ show mbVal
604
+ case J. fromJSON <$> mbVal of
605
+ Just (J. Success c) -> return c
606
+ _ -> return Data.Default. def
595
607
-- ---------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments