Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Unison.LSP.VFS
Synopsis
- usingVFS :: forall a. StateT VFS Lsp a -> Lsp a
- getVirtualFile :: Lspish m => Uri -> MaybeT m VirtualFile
- getFileContents :: Lspish m => Uri -> MaybeT m (FileVersion, Text)
- vfsLogger :: LogAction (StateT VFS Lsp) (WithSeverity VfsLog)
- markFilesDirty :: (Foldable f, HasUri doc Uri) => f doc -> Lsp ()
- markAllFilesDirty :: Lsp ()
- identifierAtPosition :: Lspish m => Uri -> Position -> MaybeT m Text
- identifierSplitAtPosition :: Lspish m => Uri -> Position -> MaybeT m (Text, Text)
- completionPrefix :: Uri -> Position -> MaybeT Lsp (Range, Text)
- lspOpenFile :: TNotificationMessage 'Method_TextDocumentDidOpen -> Lsp ()
- lspCloseFile :: TNotificationMessage 'Method_TextDocumentDidClose -> Lsp ()
- lspChangeFile :: TNotificationMessage 'Method_TextDocumentDidChange -> Lsp ()
Documentation
usingVFS :: forall a. StateT VFS Lsp a -> Lsp a Source #
Some VFS combinators require Monad State, this provides it in a transactionally safe manner so we're sure we don't edit the same file in two different actions at the same time.
getVirtualFile :: Lspish m => Uri -> MaybeT m VirtualFile Source #
getFileContents :: Lspish m => Uri -> MaybeT m (FileVersion, Text) Source #
markFilesDirty :: (Foldable f, HasUri doc Uri) => f doc -> Lsp () Source #
Mark some files as needing to be checked.
markAllFilesDirty :: Lsp () Source #
Mark all files for re-checking.
We may want to do this when our names or perspective change.
identifierAtPosition :: Lspish m => Uri -> Position -> MaybeT m Text Source #
Returns the name or symbol which the provided position is contained in.
identifierSplitAtPosition :: Lspish m => Uri -> Position -> MaybeT m (Text, Text) Source #
Returns the prefix and suffix of the symbol which the provided position is contained in.
completionPrefix :: Uri -> Position -> MaybeT Lsp (Range, Text) Source #
Returns the prefix of the symbol at the provided location, and the range that prefix spans.
lspOpenFile :: TNotificationMessage 'Method_TextDocumentDidOpen -> Lsp () Source #
lspCloseFile :: TNotificationMessage 'Method_TextDocumentDidClose -> Lsp () Source #
lspChangeFile :: TNotificationMessage 'Method_TextDocumentDidChange -> Lsp () Source #