File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ module Language.LSP.Server
38
38
, persistVirtualFile
39
39
, getVersionedTextDoc
40
40
, reverseFileMap
41
+ , snapshotVirtualFiles
41
42
42
43
-- * Diagnostics
43
44
, publishDiagnostics
Original file line number Diff line number Diff line change @@ -380,6 +380,13 @@ getVirtualFiles = vfsData <$> getsState resVFS
380
380
381
381
{-# INLINE getVirtualFiles #-}
382
382
383
+ -- | Take an atomic snapshot of the current state of the virtual file system.
384
+ snapshotVirtualFiles :: LanguageContextEnv c -> STM VFS
385
+ snapshotVirtualFiles env = vfsData <$> readTVar (resVFS $ resState env)
386
+
387
+ {-# INLINE snapshotVirtualFiles #-}
388
+
389
+
383
390
-- | Dump the current text for a given VFS file to a temporary file,
384
391
-- and return the path to the file.
385
392
persistVirtualFile :: MonadLsp config m => NormalizedUri -> m (Maybe FilePath )
You can’t perform that action at this time.
0 commit comments