X-Git-Url: https://git.lukelau.me/?p=lsp-test.git;a=blobdiff_plain;f=src%2FLanguage%2FLSP%2FTest.hs;h=90000fd38936eb470e8a13448032466551d180e8;hp=89abfcf8b7a0c275c2903e9de9c9833c88b61bdf;hb=ad1d8fc387457dbcebcad90e0e6e6dbff62b6bba;hpb=cd644f52c5c564403b5f3b0a8652e7f4154f8d6a diff --git a/src/Language/LSP/Test.hs b/src/Language/LSP/Test.hs index 89abfcf..90000fd 100644 --- a/src/Language/LSP/Test.hs +++ b/src/Language/LSP/Test.hs @@ -62,6 +62,7 @@ module Language.LSP.Test , waitForDiagnosticsSource , noDiagnostics , getCurrentDiagnostics + , getIncompleteProgressSessions -- ** Commands , executeCommand -- ** Code Actions @@ -101,6 +102,7 @@ import Control.Monad.IO.Class import Control.Exception import Control.Lens hiding ((.=), List, Empty) import qualified Data.Map.Strict as Map +import qualified Data.Set as Set import qualified Data.Text as T import qualified Data.Text.IO as T import Data.Aeson @@ -534,6 +536,10 @@ getCodeActionContext doc = do getCurrentDiagnostics :: TextDocumentIdentifier -> Session [Diagnostic] getCurrentDiagnostics doc = fromMaybe [] . Map.lookup (toNormalizedUri $ doc ^. uri) . curDiagnostics <$> get +-- | Returns the tokens of all progress sessions that have started but not yet ended. +getIncompleteProgressSessions :: Session (Set.Set ProgressToken) +getIncompleteProgressSessions = curProgressSessions <$> get + -- | Executes a command. executeCommand :: Command -> Session () executeCommand cmd = do