You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Out of the box, the source and browse utilities are broken:
$ amm --no-home-predef
Loading...
Welcome to the Ammonite Repl 2.5.2 (Scala 2.13.8 Java 11.0.12)
@ source(new java.util.ArrayList())
cmd0.sc:1: could not find implicit value for parameter pprinter: pprint.PPrinter
val res0 = source(new java.util.ArrayList())
^
Compilation Failed
@ val what = "ever"
what: String = "ever"
@ browse(what)
cmd1.sc:1: could not find implicit value for parameter pp: pprint.PPrinter
val res1 = browse(what)
^
Compilation Failed
Presumably (?) Ammonite provided an implicit pretty printer instance in scope by default in the past which satisfied these, but it no longer does so.
For browse this is essentially a duplicate of #906, I propose that this issue supersedes it with the expanded scope of source and emphasis that these utilities should not be broken out of the box on examples given in the docs—it's a UX problem more than a documentation one.
Workaround
For browse we can give a PPrinter or define one in implicit scope:
source needs an additional CodeColors implicit. Aside from defining one from scratch I didn't find a convenient workaround, I ran into what looks like a broken macro—reference to browseSourceCommand that appears it should be browseSource now:
@ implicit val replPPrinter: pprint.PPrinter = repl.pprinter()
@ import repl.codeColorsImplicit
import repl.codeColorsImplicit
@ source(show(res1))
cmd10.sc:1: value browseSourceCommand is not a member of object ammonite.compiler.tools.SourceRuntime
val res10 = source(show(res1))
^
Compilation Failed
The text was updated successfully, but these errors were encountered:
Problem
Out of the box, the
source
andbrowse
utilities are broken:Presumably (?) Ammonite provided an implicit pretty printer instance in scope by default in the past which satisfied these, but it no longer does so.
For
browse
this is essentially a duplicate of #906, I propose that this issue supersedes it with the expanded scope ofsource
and emphasis that these utilities should not be broken out of the box on examples given in the docs—it's a UX problem more than a documentation one.Workaround
For
browse
we can give aPPrinter
or define one in implicit scope:source
needs an additionalCodeColors
implicit. Aside from defining one from scratch I didn't find a convenient workaround, I ran into what looks like a broken macro—reference tobrowseSourceCommand
that appears it should bebrowseSource
now:The text was updated successfully, but these errors were encountered: