hls-test-utils 1.5.0.0 → 1.6.0.0
raw patch · 2 files changed
+12/−12 lines, 2 filesdep ~ghcidePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: ghcide
API changes (from Hackage documentation)
+ Test.Hls.Util: GHC96 :: GhcVersion
- Test.Hls: runSessionWithServer' :: [PluginDescriptor IdeState] -> Config -> SessionConfig -> ClientCapabilities -> FilePath -> Session a -> IO a
+ Test.Hls: runSessionWithServer' :: IdePlugins IdeState -> Config -> SessionConfig -> ClientCapabilities -> FilePath -> Session a -> IO a
- Test.Hls: type PluginTestDescriptor b = Recorder (WithPriority b) -> PluginDescriptor IdeState
+ Test.Hls: type PluginTestDescriptor b = Recorder (WithPriority b) -> IdePlugins IdeState
Files
- hls-test-utils.cabal +2/−2
- src/Test/Hls.hs +10/−10
hls-test-utils.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: hls-test-utils-version: 1.5.0.0+version: 1.6.0.0 synopsis: Utilities used in the tests of Haskell Language Server description: Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>@@ -41,7 +41,7 @@ , directory , extra , filepath- , ghcide ^>=1.9+ , ghcide ^>= 1.10 , hls-graph , hls-plugin-api ^>=1.6 , lens
src/Test/Hls.hs view
@@ -176,7 +176,7 @@ -- ------------------------------------------------------------ -- | Plugin under test where a fitting recorder is injected.-type PluginTestDescriptor b = Recorder (WithPriority b) -> PluginDescriptor IdeState+type PluginTestDescriptor b = Recorder (WithPriority b) -> IdePlugins IdeState -- | Wrap a plugin you want to test, and inject a fitting recorder as required. --@@ -197,7 +197,7 @@ :: (Recorder (WithPriority b) -> PluginId -> PluginDescriptor IdeState) -> PluginId -> PluginTestDescriptor b-mkPluginTestDescriptor pluginDesc plId recorder = pluginDesc recorder plId+mkPluginTestDescriptor pluginDesc plId recorder = IdePlugins [pluginDesc recorder plId] -- | Wrap a plugin you want to test. --@@ -207,7 +207,7 @@ :: (PluginId -> PluginDescriptor IdeState) -> PluginId -> PluginTestDescriptor b-mkPluginTestDescriptor' pluginDesc plId _recorder = pluginDesc plId+mkPluginTestDescriptor' pluginDesc plId _recorder = IdePlugins [pluginDesc plId] -- | Initialise a recorder that can be instructed to write to stderr by -- setting the environment variable "HLS_TEST_PLUGIN_LOG_STDERR=1" before@@ -240,7 +240,7 @@ -- See 'runSessionWithServer'' for details. initialiseTestRecorder :: Pretty a => [String] -> IO (Recorder (WithPriority a), WithPriority (Doc ann) -> IO ()) initialiseTestRecorder envVars = do- docWithPriorityRecorder <- makeDefaultStderrRecorder Nothing Debug+ docWithPriorityRecorder <- makeDefaultStderrRecorder Nothing -- There are potentially multiple environment variables that enable this logger definedEnvVars <- forM envVars (\var -> fromMaybe "0" <$> lookupEnv var) let logStdErr = any (/= "0") definedEnvVars@@ -260,18 +260,18 @@ runSessionWithServer :: Pretty b => PluginTestDescriptor b -> FilePath -> Session a -> IO a runSessionWithServer plugin fp act = do recorder <- pluginTestRecorder- runSessionWithServer' [plugin recorder] def def fullCaps fp act+ runSessionWithServer' (plugin recorder) def def fullCaps fp act runSessionWithServerAndCaps :: Pretty b => PluginTestDescriptor b -> ClientCapabilities -> FilePath -> Session a -> IO a runSessionWithServerAndCaps plugin caps fp act = do recorder <- pluginTestRecorder- runSessionWithServer' [plugin recorder] def def caps fp act+ runSessionWithServer' (plugin recorder) def def caps fp act runSessionWithServerFormatter :: Pretty b => PluginTestDescriptor b -> String -> PluginConfig -> FilePath -> Session a -> IO a runSessionWithServerFormatter plugin formatter conf fp act = do recorder <- pluginTestRecorder runSessionWithServer'- [plugin recorder]+ (plugin recorder) def { formattingProvider = T.pack formatter , plugins = M.singleton (PluginId $ T.pack formatter) conf@@ -329,7 +329,7 @@ runSessionWithCabalServerFormatter plugin formatter conf fp act = do recorder <- pluginTestRecorder runSessionWithServer'- [plugin recorder]+ (plugin recorder) def { cabalFormattingProvider = T.pack formatter , plugins = M.singleton (PluginId $ T.pack formatter) conf@@ -354,7 +354,7 @@ -- -- For improved logging, make sure these plugins have been initalised with -- the recorder produced by @pluginTestRecorder@.- [PluginDescriptor IdeState] ->+ IdePlugins IdeState -> -- | lsp config for the server Config -> -- | config for the test session@@ -380,7 +380,7 @@ -- exists until old logging style is phased out logger = Logger $ \p m -> logger_ (WithPriority p emptyCallStack (pretty m)) - hlsPlugins = IdePlugins $ Test.blockCommandDescriptor "block-command" : plugins+ hlsPlugins = IdePlugins [Test.blockCommandDescriptor "block-command"] <> plugins arguments@Arguments{ argsIdeOptions, argsLogger } = testing (cmapWithPrio LogIDEMain recorder) logger hlsPlugins