Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make it easier to use show/inspect/... from the REPL #418

Closed
smarter opened this issue Aug 28, 2018 · 3 comments
Closed

Make it easier to use show/inspect/... from the REPL #418

smarter opened this issue Aug 28, 2018 · 3 comments
Milestone

Comments

@smarter
Copy link
Contributor

smarter commented Aug 28, 2018

Right now it's a bit awkward:

$ mill -i
@ inspect(replApplyHandler.evaluator, "main.compile")()
[1/1] inspect 
main.compile(ScalaModule.scala:125)
Inputs:
[...]

It'd be nicer if we could do:

@ inspect("main.compile")()

Or even:

@ inspect(main.compile)()

(It would also be nice to avoid the extra () but that's a separate issue)

The first should be achievable by having the evaluator implicitly available in scope and changing the signature of show/inspect/... to take the evaluator implicitly. @lihaoyi on Gitter said:

Mill's routing macros do not support multiple arglists IIRC
but they can be made to do so'
the fork i use in Cask supports them

@lihaoyi
Copy link
Member

lihaoyi commented Aug 31, 2018

This can probably be done most easily by changing the code wrapper template to wrap the expression in an additional e.g. evalTask(...) call, which would leave T <!< Tasks alone and evaluate T <:< Tasks the same way that () does so

@lihaoyi
Copy link
Member

lihaoyi commented Aug 31, 2018

although it might still require patching ammonite's Preprocessor.scala to provide to appropriate hook for us to do this wrapping, since we may need to wrap at an expression level rather than at a block level so e.g. main.compile; main.test properly evaluates both tasks and stores their results in local bindings.

Apart from inspect and show, this would make working with the rest of Mill's tasks easier in the mill -i REPL as well

@lihaoyi
Copy link
Member

lihaoyi commented May 1, 2023

This is now moot since #2377 removed the build REPL entirely due to lack of usage

@lihaoyi lihaoyi closed this as completed May 1, 2023
@lihaoyi lihaoyi added this to the 0.11.0-M8 milestone May 1, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants