, waitForDiagnosticsSource
, noDiagnostics
, getCurrentDiagnostics
+ , getIncompleteProgressSessions
-- ** Commands
, executeCommand
-- ** Code Actions
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
documentContents doc
where
- -- extract Uri out from DocumentChange
- documentChangeUri :: DocumentChange -> Uri
- documentChangeUri (InL x) = x ^. textDocument . uri
- documentChangeUri (InR (InL x)) = x ^. uri
- documentChangeUri (InR (InR (InL x))) = x ^. oldUri
- documentChangeUri (InR (InR (InR x))) = x ^. uri
-
checkDocumentChanges req =
let changes = req ^. params . edit . documentChanges
maybeDocs = fmap (fmap documentChangeUri) changes
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