Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Power mode seems to have gotten broken #4719

Open
1 task done
blast-hardcheese opened this issue May 23, 2019 · 10 comments
Open
1 task done

Power mode seems to have gotten broken #4719

blast-hardcheese opened this issue May 23, 2019 · 10 comments

Comments

@blast-hardcheese
Copy link

steps

Launch sbt
Run console
Type :power

problem

scala> :power
<console>:1: error: identifier expected but $XMLSTART$< found.
       import <none>._
              ^
<console>:12: error: not found: value intp
       import scala.tools.nsc._, scala.collection.JavaConverters._, intp.global.{ error => _, _ }, definitions.{ getClass => _, _ }, power.rutil._, replImplicits._, treedsl.CODE._
                                                                    ^
<console>:12: error: not found: value definitions
       import scala.tools.nsc._, scala.collection.JavaConverters._, intp.global.{ error => _, _ }, definitions.{ getClass => _, _ }, power.rutil._, replImplicits._, treedsl.CODE._
                                                                                                   ^
<console>:12: error: not found: value power
       import scala.tools.nsc._, scala.collection.JavaConverters._, intp.global.{ error => _, _ }, definitions.{ getClass => _, _ }, power.rutil._, replImplicits._, treedsl.CODE._
                                                                                                                                     ^
<console>:12: error: not found: value replImplicits
       import scala.tools.nsc._, scala.collection.JavaConverters._, intp.global.{ error => _, _ }, definitions.{ getClass => _, _ }, power.rutil._, replImplicits._, treedsl.CODE._
                                                                                                                                                    ^
<console>:12: error: not found: value treedsl
       import scala.tools.nsc._, scala.collection.JavaConverters._, intp.global.{ error => _, _ }, definitions.{ getClass => _, _ }, power.rutil._, replImplicits._, treedsl.CODE._
                                                                                                                                                                     ^
Power mode enabled. :phase is at typer.
import scala.tools.nsc._, intp.global._, definitions._
Try :help or completions for vals._ and power._

expectation

scala> :power
Power mode enabled. :phase is at typer.
import scala.tools.nsc._, intp.global._, definitions._
Try :help or completions for vals._ and power._

notes

I'd like to bisect between 1.1.1 and 1.1.2, though I can't do it at this point. I just wanted to raise awareness, as this breaks https://github.com/marconilanna/REPLesent at the sbt console

sbt version: 1.1.2+

@eed3si9n
Copy link
Member

@blast-hardcheese Thanks for the report.

@blast-hardcheese
Copy link
Author

@eed3si9n No worries! I'll give the bisect a shot ASAP. It's clearly not bothering anyone else, so I guess no rush 😄

@nkgm
Copy link

nkgm commented Apr 8, 2020

Any updates on this one? Would be really nice to be able to use :power in sbt console.

@blast-hardcheese
Copy link
Author

I tried to bisect SBT to figure out what broke, but I discovered that the problem was actually in one of the dependencies, and I didn't try too hard to get the rest of the SBT build environment working, as I figured I wouldn't need :power mode this year. I only use it for REPLesent, which is what I use to do slides from inside the Scala REPL.

I can't give any more insight than that, but am interested in this getting fixed as well, at some point this will become a serious problem for me.

@nkgm
Copy link

nkgm commented Apr 14, 2020

Thanks for the reply @blast-hardcheese. I am a little bit surprised that more people aren't smitten by this. Tools like :power and :javap are the reason why I'm using Scala REPL over Ammonite, and sbt console is pretty much the only viable way of running the REPL with dependencies in the classpath.

@ivan-awake
Copy link

Confirm, it's still broken on on 2.12

[info] Starting scala interpreter...
Welcome to Scala 2.12.10 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_241).
Type in expressions for evaluation. Or try :help.

scala> :power
<console>:1: error: identifier expected but $XMLSTART$< found.
       import <none>._
...

@ivan-awake
Copy link

@blast-hardcheese is there another way to set vals.isettings.maxPrintString?

@joshuaconner
Copy link

@ivan-awake i created a file ~/.sbt/1.0/plugins/console.sbt with the following content and it seems to work:

initialize ~= (_ => sys.props("scala.repl.maxprintstring") = "10000" )

(adapted from this SO comment by @SethTisue - thanks Seth!)

@vegerot
Copy link

vegerot commented Apr 6, 2021

Still broken for me

❯ sbt console
[info] Loading global plugins from /Users/maxcoplan/.sbt/1.0/plugins
[info] Loading settings for project example-build from plugins.sbt,buildSettings.sbt ...
[info] Loading project definition from /Users/maxcoplan/workspace/scala_coursera/example/project
[info] Loading settings for project example from assignment.sbt,build.sbt ...
[info] Set current project to progfun1-example (in build file:/Users/maxcoplan/workspace/scala_coursera/example/)
[info] Starting scala interpreter...
Welcome to Scala 2.13.0 (OpenJDK 64-Bit Server VM, Java 11.0.10).
Type in expressions for evaluation. Or try :help.

scala> :power
              ^
       error: identifier expected but $XMLSTART$< found.
Power mode enabled. :phase is at typer.
import scala.tools.nsc._, intp.global._, definitions._
Try :help or completions for vals._ and power._

scala> 1+1

       }}
         ^
<synthetic>:11: error: input ended while parsing XML

(To diagnose errors in synthetic code, try adding `// show` to the end of your input.)

scala> ;

scala> 1+1

       }}
         ^
<synthetic>:11: error: input ended while parsing XML

(To diagnose errors in synthetic code, try adding `// show` to the end of your input.)

scala>

@mvillafuertem
Copy link

Is there an update on this? I have the same errors with the latest sbt version. Thanks

[info] welcome to sbt 1.6.2 (Oracle Corporation Java 1.8.0_202)
...
[info] Starting scala interpreter...
Welcome to Scala 2.13.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_202).
Type in expressions for evaluation. Or try :help.

scala> :power
              ^
       error: identifier expected but $XMLSTART$< found.
Power mode enabled. :phase is at typer.
import scala.tools.nsc._, intp.global._, definitions._
Try :help or completions for vals._ and power._

scala> val a = 1

       }}
         ^
<synthetic>:11: error: input ended while parsing XML

(To diagnose errors in synthetic code, try adding `// show` to the end of your input.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants