packages feed

hls-eval-plugin 2.1.0.0 → 2.2.0.0

raw patch · 2 files changed

+15/−17 lines, 2 filesdep ~ghcidedep ~hls-plugin-apidep ~hls-test-utilsPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: ghcide, hls-plugin-api, hls-test-utils

API changes (from Hackage documentation)

Files

hls-eval-plugin.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4 name:               hls-eval-plugin-version:            2.1.0.0+version:            2.2.0.0 synopsis:           Eval plugin for Haskell Language Server description:   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>@@ -67,10 +67,10 @@     , ghc     , ghc-boot-th     , ghc-paths-    , ghcide                == 2.1.0.0+    , ghcide                == 2.2.0.0     , hashable     , hls-graph-    , hls-plugin-api        == 2.1.0.0+    , hls-plugin-api        == 2.2.0.0     , lens     , lsp     , lsp-types@@ -112,7 +112,7 @@     , filepath     , hls-eval-plugin     , hls-plugin-api-    , hls-test-utils   == 2.1.0.0+    , hls-test-utils   == 2.2.0.0     , lens     , lsp-types     , text
test/Main.hs view
@@ -40,27 +40,27 @@ tests =   testGroup "eval"   [ testCase "Produces Evaluate code lenses" $-      runSessionWithServer evalPlugin testDataDir $ do+      runSessionWithServer def evalPlugin testDataDir $ do         doc <- openDoc "T1.hs" "haskell"         lenses <- getCodeLenses doc         liftIO $ map (preview $ command . _Just . title) lenses @?= [Just "Evaluate..."]   , testCase "Produces Refresh code lenses" $-      runSessionWithServer evalPlugin testDataDir $ do+      runSessionWithServer def evalPlugin testDataDir $ do         doc <- openDoc "T2.hs" "haskell"         lenses <- getCodeLenses doc         liftIO $ map (preview $ command . _Just . title) lenses @?= [Just "Refresh..."]   , testCase "Code lenses have ranges" $-      runSessionWithServer evalPlugin testDataDir $ do+      runSessionWithServer def evalPlugin testDataDir $ do         doc <- openDoc "T1.hs" "haskell"         lenses <- getCodeLenses doc         liftIO $ map (view range) lenses @?= [Range (Position 4 0) (Position 5 0)]   , testCase "Multi-line expressions have a multi-line range" $ do-      runSessionWithServer evalPlugin testDataDir $ do+      runSessionWithServer def evalPlugin testDataDir $ do         doc <- openDoc "T3.hs" "haskell"         lenses <- getCodeLenses doc         liftIO $ map (view range) lenses @?= [Range (Position 3 0) (Position 5 0)]   , testCase "Executed expressions range covers only the expression" $ do-      runSessionWithServer evalPlugin testDataDir $ do+      runSessionWithServer def evalPlugin testDataDir $ do         doc <- openDoc "T2.hs" "haskell"         lenses <- getCodeLenses doc         liftIO $ map (view range) lenses @?= [Range (Position 4 0) (Position 5 0)]@@ -212,7 +212,7 @@         not ("Baz Foo" `isInfixOf` output)          @? "Output includes instance Baz Foo"     ]   , testCase "Interfaces are reused after Eval" $ do-      runSessionWithServer evalPlugin testDataDir $ do+      runSessionWithServer def evalPlugin testDataDir $ do         doc <- openDoc "TLocalImport.hs" "haskell"         waitForTypecheck doc         lenses <- getCodeLenses doc@@ -231,13 +231,13 @@  goldenWithEval :: TestName -> FilePath -> FilePath -> TestTree goldenWithEval title path ext =-  goldenWithHaskellDoc evalPlugin title testDataDir path "expected" ext executeLensesBackwards+  goldenWithHaskellDoc def evalPlugin title testDataDir path "expected" ext executeLensesBackwards  -- | Similar function as 'goldenWithEval' with an alternate reference file -- naming. Useful when reference file may change because of GHC version. goldenWithEval' :: TestName -> FilePath -> FilePath -> FilePath -> TestTree goldenWithEval' title path ext expected =-  goldenWithHaskellDoc evalPlugin title testDataDir path expected ext executeLensesBackwards+  goldenWithHaskellDoc def evalPlugin title testDataDir path expected ext executeLensesBackwards  -- | Execute lenses backwards, to avoid affecting their position in the source file executeLensesBackwards :: TextDocumentIdentifier -> Session ()@@ -264,7 +264,7 @@   pure ()  evalLenses :: FilePath -> IO [CodeLens]-evalLenses path = runSessionWithServer evalPlugin testDataDir $ do+evalLenses path = runSessionWithServer def evalPlugin testDataDir $ do   doc <- openDoc path "haskell"   executeLensesBackwards doc   getCodeLenses doc@@ -298,12 +298,10 @@  goldenWithEvalConfig' :: TestName -> FilePath -> FilePath -> FilePath -> Config -> TestTree goldenWithEvalConfig' title path ext expected cfg =-    goldenWithHaskellDoc evalPlugin title testDataDir path expected ext $ \doc -> do-      sendConfigurationChanged (toJSON cfg)-      executeLensesBackwards doc+    goldenWithHaskellDoc cfg evalPlugin title testDataDir path expected ext executeLensesBackwards  evalInFile :: HasCallStack => FilePath -> T.Text -> T.Text -> IO ()-evalInFile fp e expected = runSessionWithServer evalPlugin testDataDir $ do+evalInFile fp e expected = runSessionWithServer def evalPlugin testDataDir $ do   doc <- openDoc fp "haskell"   origin <- documentContents doc   let withEval = origin <> e