Safe Haskell | None |
---|---|
Language | Haskell2010 |
Handles the Language.Haskell.LSP.Types.TextDocumentDidChange /
Language.Haskell.LSP.Types.TextDocumentDidOpen /
Language.Haskell.LSP.Types.TextDocumentDidClose messages to keep an in-memory
filesystem
of the current client workspace. The server can access and edit
files in the client workspace by operating on the VFS in LspFuncs.
Synopsis
- type VFS = Map NormalizedUri VirtualFile
- data VirtualFile = VirtualFile {}
- openVFS :: VFS -> DidOpenTextDocumentNotification -> IO VFS
- changeFromClientVFS :: VFS -> DidChangeTextDocumentNotification -> IO VFS
- changeFromServerVFS :: VFS -> ApplyWorkspaceEditRequest -> IO VFS
- persistFileVFS :: VFS -> NormalizedUri -> IO (FilePath, VFS)
- closeVFS :: VFS -> DidCloseTextDocumentNotification -> IO VFS
- rangeLinesFromVfs :: VirtualFile -> Range -> Text
- data PosPrefixInfo = PosPrefixInfo {
- fullLine :: Text
- prefixModule :: Text
- prefixText :: Text
- cursorPos :: Position
- getCompletionPrefix :: Monad m => Position -> VirtualFile -> m (Maybe PosPrefixInfo)
- applyChanges :: Rope -> [TextDocumentContentChangeEvent] -> Rope
- applyChange :: Rope -> TextDocumentContentChangeEvent -> Rope
- changeChars :: Rope -> Int -> Int -> Text -> Rope
Documentation
type VFS = Map NormalizedUri VirtualFile Source #
data VirtualFile Source #
Instances
Show VirtualFile Source # | |
Defined in Language.Haskell.LSP.VFS showsPrec :: Int -> VirtualFile -> ShowS # show :: VirtualFile -> String # showList :: [VirtualFile] -> ShowS # |
changeFromServerVFS :: VFS -> ApplyWorkspaceEditRequest -> IO VFS Source #
persistFileVFS :: VFS -> NormalizedUri -> IO (FilePath, VFS) Source #
manipulating the file contents
rangeLinesFromVfs :: VirtualFile -> Range -> Text Source #
data PosPrefixInfo Source #
Describes the line at the current cursor position
PosPrefixInfo | |
|
Instances
Eq PosPrefixInfo Source # | |
Defined in Language.Haskell.LSP.VFS (==) :: PosPrefixInfo -> PosPrefixInfo -> Bool # (/=) :: PosPrefixInfo -> PosPrefixInfo -> Bool # | |
Show PosPrefixInfo Source # | |
Defined in Language.Haskell.LSP.VFS showsPrec :: Int -> PosPrefixInfo -> ShowS # show :: PosPrefixInfo -> String # showList :: [PosPrefixInfo] -> ShowS # |
getCompletionPrefix :: Monad m => Position -> VirtualFile -> m (Maybe PosPrefixInfo) Source #
for tests
applyChanges :: Rope -> [TextDocumentContentChangeEvent] -> Rope Source #
Apply the list of changes. Changes should be applied in the order that they are received from the client.
applyChange :: Rope -> TextDocumentContentChangeEvent -> Rope Source #