Skip to content

Commit a586121

Browse files
committed
Support initial generic config for plugins
This enables opt-in plugins, i.e. plugins that are not enabled by default
1 parent a0d18e6 commit a586121

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hls-test-utils/src/Test/Hls.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import GHC.IO.Handle
7373
import GHC.Stack (emptyCallStack)
7474
import Ide.Plugin.Config (Config, PluginConfig,
7575
cabalFormattingProvider,
76-
defConfig, formattingProvider,
76+
formattingProvider,
7777
plugins)
7878
import Ide.Types
7979
import Language.LSP.Test
@@ -135,13 +135,13 @@ goldenWithHaskellDoc plugin title testDataDir path desc ext act =
135135

136136

137137
runSessionWithServer :: PluginDescriptor IdeState -> FilePath -> Session a -> IO a
138-
runSessionWithServer plugin = runSessionWithServer' [plugin] def def fullCaps
138+
runSessionWithServer plugin = runSessionWithServer' [plugin] (defConfigForPlugins $ IdePlugins [plugin]) def fullCaps
139139

140140
runSessionWithServerFormatter :: PluginDescriptor IdeState -> String -> PluginConfig -> FilePath -> Session a -> IO a
141141
runSessionWithServerFormatter plugin formatter conf =
142142
runSessionWithServer'
143143
[plugin]
144-
def
144+
(defConfigForPlugins $ IdePlugins [plugin])
145145
{ formattingProvider = T.pack formatter
146146
, plugins = M.singleton (T.pack formatter) conf
147147
}
@@ -194,7 +194,7 @@ runSessionWithCabalServerFormatter :: PluginDescriptor IdeState -> String -> Plu
194194
runSessionWithCabalServerFormatter plugin formatter conf =
195195
runSessionWithServer'
196196
[plugin]
197-
(defConfig mempty)
197+
(defConfigForPlugins $ IdePlugins [plugin])
198198
{ cabalFormattingProvider = T.pack formatter
199199
, plugins = M.singleton (T.pack formatter) conf
200200
}

0 commit comments

Comments
 (0)