diff --git a/test/functional/Config.hs b/test/functional/Config.hs index 24af9869b4..cb8f381cc1 100644 --- a/test/functional/Config.hs +++ b/test/functional/Config.hs @@ -27,7 +27,6 @@ import qualified Language.LSP.Protocol.Lens as L import Language.LSP.Test as Test import System.FilePath (()) import Test.Hls -import Test.Hls.Command {-# ANN module ("HLint: ignore Reduce duplication"::String) #-} @@ -35,30 +34,9 @@ tests :: TestTree tests = testGroup "plugin config" [ -- Note: there are more comprehensive tests over config in hls-hlint-plugin -- TODO: Add generic tests over some example plugin - configParsingTests, genericConfigTests + genericConfigTests ] -configParsingTests :: TestTree -configParsingTests = testGroup "config parsing" - [ testCase "empty object as user configuration should not send error logMessage" $ runConfigSession "" $ do - let config = object [] - sendConfigurationChanged (toJSON config) - - -- Send custom request so server returns a response to prevent blocking - void $ sendNotification (SMethod_CustomMethod (Proxy @"non-existent-method")) Null - - logNot <- skipManyTill Test.anyMessage (message SMethod_WindowLogMessage) - - liftIO $ (logNot ^. L.params . L.type_) > MessageType_Error - || "non-existent-method" `T.isInfixOf` (logNot ^. L.params . L.message) - @? "Server sends logMessage with MessageType = Error" - ] - - where - runConfigSession :: FilePath -> Session a -> IO a - runConfigSession subdir = - failIfSessionTimeout . runSession hlsCommand fullCaps ("test/testdata" subdir) - genericConfigTests :: TestTree genericConfigTests = testGroup "generic plugin config" [