unison-cli-0.0.0
Safe HaskellNone
LanguageHaskell2010

Unison.Codebase.Editor.HandleInput.ShowDefinition

Synopsis

Documentation

handleShowDefinition :: OutputLocation -> ShowDefinitionScope -> NonEmpty (HashQualified Name) -> Cli () Source #

Handle a ShowDefinitionI input command, i.e. view or edit.

showDefinitions :: OutputLocation -> (HashQualified Name -> Bool) -> PrettyPrintEnvDecl -> Map TermReference (DisplayObject (Type Symbol Ann) (Term Symbol Ann)) -> Map TypeReference (DisplayObject () (Decl Symbol Ann)) -> [HashQualified Name] -> Cli () Source #

Show the provided definitions to console or scratch file. The caller is responsible for ensuring that the definitions include cycles if that's the desired behavior.

renderToFile :: (MonadIO m, Monoid a) => Codebase IO Symbol a -> (HashQualified Name -> Bool) -> (Text -> Text -> Bool -> IO ()) -> Maybe (Either (UnisonFile Symbol Ann) (TypecheckedUnisonFile Symbol a)) -> FilePath -> RelativeToFold -> PrettyPrintEnvDecl -> Map TermReference (DisplayObject (Type Symbol Ann) (Term Symbol Ann)) -> Map TypeReference (DisplayObject () (Decl Symbol Ann)) -> m Int Source #

Render definitions to a file. Returns whether anything was rendered. Definitions can be obtained via definitionsByName