Merge pull request #87 from bubba/bump-lsp 0.13.0.0
authorLuke Lau <luke_lau@icloud.com>
Sun, 14 Feb 2021 03:15:13 +0000 (03:15 +0000)
committerGitHub <noreply@github.com>
Sun, 14 Feb 2021 03:15:13 +0000 (03:15 +0000)
Bump lsp commit

ChangeLog.md
cabal.project
lsp-test.cabal
src/Language/LSP/Test.hs
test/dummy-server/Main.hs

index ee25df7f9e2f6d59c61abc2700b28e00d6dc7401..d82c78dedc4f30277626192776bbfaa74f2dada7 100644 (file)
@@ -1,5 +1,15 @@
 # Revision history for lsp-test
 
+## 0.13.0.0 -- 2021-02-14
+
+* Add support for lsp-types-1.1 (@wz1000)
+* Automatically respond to `workspace/applyEdit` and
+  `window/workDoneProgress/create` messages (@wz1000)
+
+## 0.12.0.0 -- 2021-01-25
+* Add `getIncompleteProgressSessions` to track ongoing progress sessions
+  (@wz1000)
+
 ## 0.11.0.0 -- 2020-05-14
 
 * Replace `openDoc'` with `createDoc` which now sends
index cc9722a6f7decb7a89a1d628fea6d84e0cd7936f..e125a7de096fe2039bedab64f6c040c8d2b803ce 100644 (file)
@@ -7,10 +7,10 @@ haddock-quickjump: True
 source-repository-package
     type: git
     location: https://github.com/alanz/lsp.git
-    tag: 96aad3d7cc64fe9e4e29c6bccb19a3ad5ff8926d
+    tag: b258a6921aeb188b64589f2d12727bbb9e66a93a
     subdir: lsp-types
 
 source-repository-package
     type: git
     location: https://github.com/alanz/lsp.git
-    tag: 96aad3d7cc64fe9e4e29c6bccb19a3ad5ff8926d
+    tag: b258a6921aeb188b64589f2d12727bbb9e66a93a
index a0775b3900acf8fd85bb840875bc1740aa8114a9..17ef4801fad5567b4dfda39e933df2732c527586 100644 (file)
@@ -1,5 +1,5 @@
 name:                lsp-test
-version:             0.11.0.7
+version:             0.13.0.0
 synopsis:            Functional test framework for LSP servers.
 description:
   A test framework for writing tests against
@@ -16,7 +16,7 @@ license-file:        LICENSE
 author:              Luke Lau
 maintainer:          luke_lau@icloud.com
 bug-reports:         https://github.com/bubba/lsp-test/issues
-copyright:           2020 Luke Lau
+copyright:           2021 Luke Lau
 category:            Testing
 build-type:          Simple
 cabal-version:       2.0
@@ -41,7 +41,7 @@ library
                      , parser-combinators:Control.Applicative.Combinators
   default-language:    Haskell2010
   build-depends:       base >= 4.10 && < 5
-                     , lsp-types >= 1.0.0.1 && < 1.1
+                     , lsp-types == 1.1.*
                      , aeson
                      , time
                      , aeson-pretty
@@ -82,7 +82,7 @@ executable dummy-server
   hs-source-dirs:      test/dummy-server
   ghc-options:         -W
   build-depends:       base >= 4.11 && < 5
-                     , lsp >= 1.0.0.1 && < 1.1
+                     , lsp == 1.1.*
                      , aeson
                      , unordered-containers
                      , directory
@@ -102,7 +102,7 @@ test-suite tests
   build-depends:       base >= 4.10 && < 5
                      , hspec
                      , lens
-                     , lsp-types >= 1.0.0.1 && < 1.1
+                     , lsp-types == 1.1.*
                      , lsp-test
                      , data-default
                      , aeson
index 62b3267366a2caf8edd1f2386c6d91648ad206d8..6c5c4a6674681b0a077352f9274864737eb1bad5 100644 (file)
@@ -371,7 +371,7 @@ sendResponse = sendMessage
 -- The initialize requests and responses are not included the session,
 -- so if you need to test it use this.
 initializeResponse :: Session (ResponseMessage Initialize)
-initializeResponse = initRsp <$> ask >>= (liftIO . readMVar)
+initializeResponse = ask >>= (liftIO . readMVar) . initRsp
 
 -- | /Creates/ a new text document. This is different from 'openDoc'
 -- as it sends a workspace/didChangeWatchedFiles notification letting the server
@@ -383,7 +383,7 @@ initializeResponse = initRsp <$> ask >>= (liftIO . readMVar)
 --
 -- @since 11.0.0.0
 createDoc :: FilePath -- ^ The path to the document to open, __relative to the root directory__.
-          -> String -- ^ The text document's language identifier, e.g. @"haskell"@.
+          -> T.Text -- ^ The text document's language identifier, e.g. @"haskell"@.
           -> T.Text -- ^ The content of the text document to create.
           -> Session TextDocumentIdentifier -- ^ The identifier of the document just created.
 createDoc file languageId contents = do
@@ -423,7 +423,7 @@ createDoc file languageId contents = do
 
 -- | Opens a text document that /exists on disk/, and sends a
 -- textDocument/didOpen notification to the server.
-openDoc :: FilePath -> String -> Session TextDocumentIdentifier
+openDoc :: FilePath -> T.Text -> Session TextDocumentIdentifier
 openDoc file languageId = do
   context <- ask
   let fp = rootDir context </> file
@@ -432,12 +432,12 @@ openDoc file languageId = do
 
 -- | This is a variant of `openDoc` that takes the file content as an argument.
 -- Use this is the file exists /outside/ of the current workspace.
-openDoc' :: FilePath -> String -> T.Text -> Session TextDocumentIdentifier
+openDoc' :: FilePath -> T.Text -> T.Text -> Session TextDocumentIdentifier
 openDoc' file languageId contents = do
   context <- ask
   let fp = rootDir context </> file
       uri = filePathToUri fp
-      item = TextDocumentItem uri (T.pack languageId) 0 contents
+      item = TextDocumentItem uri languageId 0 contents
   sendNotification STextDocumentDidOpen (DidOpenTextDocumentParams item)
   pure $ TextDocumentIdentifier uri
 
@@ -724,4 +724,4 @@ getCodeLenses tId = do
 --
 -- @since 0.11.0.0
 getRegisteredCapabilities :: Session [SomeRegistration]
-getRegisteredCapabilities = (Map.elems . curDynCaps) <$> get
+getRegisteredCapabilities = Map.elems . curDynCaps <$> get
index aee3449c11b5f4e578777d2a8ae3f497fa4414fd..6beee8bb3ecc17aacd43fe4783dc6dca1eb38b71 100644 (file)
@@ -6,6 +6,7 @@ import Control.Monad.Reader
 import Data.Aeson hiding (defaultOptions)
 import qualified Data.HashMap.Strict as HM
 import Data.List (isSuffixOf)
+import Data.String
 import Language.LSP.Server
 import Language.LSP.Types
 import System.Directory
@@ -106,7 +107,7 @@ handlers =
                         DidChangeWatchedFilesRegistrationOptions $
                           List
                             [ FileSystemWatcher
-                                (curDir </> "*.watch")
+                                (fromString $ curDir </> "*.watch")
                                 (Just (WatchKind True True True))
                             ]
                   Just token <- runInIO $