unison-cli-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.LSP.FileAnalysis

Synopsis

Documentation

checkFileByUri :: (HasUri d Uri, Lspish m) => d -> m (Maybe FileAnalysis) Source #

Lex, parse, and typecheck a file using a VFS URI

checkFileContents :: Lspish m => Uri -> Text -> FileVersion -> Text -> MaybeT m FileAnalysis Source #

Lex, parse, and typecheck a file. This is split off for easier testing without needing to mock the VFS.

getFileDefLocations :: Uri -> MaybeT Lsp (Map Symbol (Set Ann)) Source #

Get the location of user defined definitions within the file

getFileNames :: Uri -> MaybeT Lsp Names Source #

Build a Names from a file if it's parseable.

If the file typechecks, generate names from that, otherwise, generate names from the parsed file. Note that the names for a parsed file contains only names for parts of decls, since we don't know references within terms before typechecking due to TDNR. This should be fine though, since those references will all be kept in the ABT as symbols anyways.

See UF.toNames and UF.typecheckedToNames for more info.