Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Rewrites of some codebase queries, but which check the scratch file for info first.
Synopsis
- markdownDocsForFQN :: Uri -> HashQualified Name -> Lsp [Text]
- getTypeOfReferent :: Uri -> Referent -> MaybeT Lsp (Type Symbol Ann)
- getTypeDeclaration :: Uri -> Id -> MaybeT Lsp (Decl Symbol Ann)
- refAtPosition :: Uri -> Position -> MaybeT Lsp LabeledDependency
- nodeAtPosition :: Uri -> Position -> MaybeT Lsp (SourceNode Ann)
- refInTerm :: Term v a -> Maybe LabeledDependency
- refInType :: Type v a -> Maybe TypeReference
- findSmallestEnclosingNode :: Pos -> Term Symbol Ann -> Maybe (SourceNode Ann)
- findSmallestEnclosingType :: Pos -> Type Symbol Ann -> Maybe (Type Symbol Ann)
- refInDecl :: Pos -> Decl Symbol Ann -> Maybe TypeReference
- data SourceNode a
Documentation
markdownDocsForFQN :: Uri -> HashQualified Name -> Lsp [Text] Source #
Renders all docs for a given FQN to markdown.
getTypeOfReferent :: Uri -> Referent -> MaybeT Lsp (Type Symbol Ann) Source #
Gets the type of a reference from either the parsed file or the codebase.
getTypeDeclaration :: Uri -> Id -> MaybeT Lsp (Decl Symbol Ann) Source #
Gets a decl from either the parsed file or the codebase.
refAtPosition :: Uri -> Position -> MaybeT Lsp LabeledDependency Source #
Returns a reference to whatever the symbol at the given position refers to.
nodeAtPosition :: Uri -> Position -> MaybeT Lsp (SourceNode Ann) Source #
Returns the ABT node at the provided position. Does not return Decl nodes.
refInTerm :: Term v a -> Maybe LabeledDependency Source #
Returns the reference a given term node refers to, if any.
findSmallestEnclosingNode :: Pos -> Term Symbol Ann -> Maybe (SourceNode Ann) Source #
Find the node in a term which contains the specified position, but none of its children contain that position.
findSmallestEnclosingType :: Pos -> Type Symbol Ann -> Maybe (Type Symbol Ann) Source #
Find the node in a type which contains the specified position, but none of its children contain that position. This is helpful for finding the specific type reference of a given argument within a type arrow that a position references.
refInDecl :: Pos -> Decl Symbol Ann -> Maybe TypeReference Source #
Returns the type reference the given position applies to within a Decl, if any.
I.e. if the cursor is over a type reference within a constructor signature or ability request signature, that type reference will be returned.
data SourceNode a Source #
Instances
Functor SourceNode Source # | |
Defined in Unison.LSP.Queries fmap :: (a -> b) -> SourceNode a -> SourceNode b # (<$) :: a -> SourceNode b -> SourceNode a # | |
Show (SourceNode a) Source # | |
Defined in Unison.LSP.Queries showsPrec :: Int -> SourceNode a -> ShowS # show :: SourceNode a -> String # showList :: [SourceNode a] -> ShowS # | |
Eq a => Eq (SourceNode a) Source # | |
Defined in Unison.LSP.Queries (==) :: SourceNode a -> SourceNode a -> Bool # (/=) :: SourceNode a -> SourceNode a -> Bool # |