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
3838 , persistVirtualFile
3939 , getVersionedTextDoc
4040 , reverseFileMap
41+ , snapshotVirtualFiles
4142
4243 -- * Diagnostics
4344 , publishDiagnostics
Original file line number Diff line number Diff line change @@ -380,6 +380,13 @@ getVirtualFiles = vfsData <$> getsState resVFS
380380
381381{-# INLINE getVirtualFiles #-}
382382
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+
383390-- | Dump the current text for a given VFS file to a temporary file,
384391-- and return the path to the file.
385392persistVirtualFile :: MonadLsp config m => NormalizedUri -> m (Maybe FilePath )
You can’t perform that action at this time.
0 commit comments