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

REPL tab completion shows methods in unsorted order #11488

Closed
alvinj opened this issue Feb 21, 2021 · 4 comments · Fixed by #11707
Closed

REPL tab completion shows methods in unsorted order #11488

alvinj opened this issue Feb 21, 2021 · 4 comments · Fixed by #11707

Comments

@alvinj
Copy link

alvinj commented Feb 21, 2021

Compiler version

3.0.0-RC1

Minimized code

Start the REPL, then type "a.", followed by a [Tab], then type y when prompted:

scala> "a".[tab]

Output

The output looks like this:

scala> "a".
toCharArray               stripSuffix               drop                      :+                                                                 
takeWhile                 seq                       coll                      combinations              stringPrefix                               
unapply                   tapEach                   dropRight                 compose                   strip                                      
toByte                    ##                        companion                 sizeIs                    split                                      
andThen                   intern                    notifyAll                 PermutationsItr           runWith                                    
patch                     getChars                  nonEmpty                  isInstanceOf              lengthCompare                              
iterator                  tail                      lastIndexOfSlice          lift                      toBoolean                                  
trim                      forall                    regionMatches             segmentLength             find                                       
prependedAll              maxByOption               isBlank                   stripLeading              
applyPreferredMaxLength                    toDouble                  sameElements              scanLeft                  
toIterator                reduceLeftOption                           sortBy                    maxOption                 
replaceAll                repr                      indexOf                                    mkString                  union                     
foldLeft                  prepended                 ==                                         equalsIgnoreCase          orElse                    
hasDefiniteSize           wait                      toLong                                     toFloatOption             findLast                  

I don’t show all the lines, but that’s how it starts.

Expectation

The Scala 2 REPL shows the same output in sorted order, which is much more helpful.

@griggt
Copy link
Contributor

griggt commented Mar 12, 2021

Upgrading to a more recent version of JLine (>= 3.18.0) seems to fix this.

griggt added a commit to griggt/dotty that referenced this issue Mar 12, 2021
Aligns with Scala 2.13.5: scala/scala#9467 and sbt 1.4.8: sbt/sbt#6366

Fixes scala#11488
@alvinj
Copy link
Author

alvinj commented Mar 14, 2021

I just tried to use this with the latest Scala nightly build (3.0.0-RC2-bin-20210313-66e180d-NIGHTLY), and I still see this problem. Is this something that should be working with the nightly build?

@griggt
Copy link
Contributor

griggt commented Mar 14, 2021

@alvinj What command are you using to launch the REPL when the problem is observed? If using sbt, is it 1.4.8 or newer?

@alvinj
Copy link
Author

alvinj commented Mar 14, 2021

@griggt I’m sorry, yes, I was using sbt v1.4.7 with the nightly build and launching the console through there. It works just fine when using sbt 1.4.8, where I see it’s using jLine 3.19.0. This is on macOS 10.14.x. Sorry to have bothered you, but it looks great, thank you!

michelou pushed a commit to michelou/dotty that referenced this issue Mar 15, 2021
Aligns with Scala 2.13.5: scala/scala#9467 and sbt 1.4.8: sbt/sbt#6366

Fixes scala#11488
romanowski pushed a commit to BarkingBad/dotty that referenced this issue Mar 23, 2021
Aligns with Scala 2.13.5: scala/scala#9467 and sbt 1.4.8: sbt/sbt#6366

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

Successfully merging a pull request may close this issue.

4 participants