Skip to content

REPL: tab completion: results are unordered when tabbing immediately after . #12280

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

Closed
SethTisue opened this issue Dec 9, 2020 · 3 comments
Closed
Assignees
Milestone

Comments

@SethTisue
Copy link
Member

if I type at least one character, completions are in alphabetical order, as expected:

scala 2.13.4> "foo".a<TAB>
addString(                 andThen(                   appendedAll(               applyOrElse(
aggregate(  (deprecated)   appended(                  apply(                     asInstanceOf (universal)

but if I tab immediately after ., they aren't:

scala 2.13.4> "foo".<TAB>
toCharArray()                       empty                               formatted(            (universal)               takeWhile(                          prefixLength(        (deprecated)   takeRight(                                      unapply(                            view                                filterNot(                                      toByte                              inits                               unzip(                                          andThen(                            toUpperCase()                       notify()              (universal)               patch(                              lazyZip(                            partitionMap(                                   iterator                            codePoints()                        toLongOption                                    prependedAll(                       last                                map(                                            toDouble                            unzip3(                             ++(                                             trim()                              count(                              :\(                  (deprecated)               mkString                            eq(                   (universal)   product(                                        sortBy(                             reverseIterator                     max(                                            equ
...

what the hell?

@SethTisue SethTisue added the repl label Dec 9, 2020
@SethTisue SethTisue added this to the Backlog milestone Dec 9, 2020
@SethTisue
Copy link
Member Author

I tried adding a little test to CompletionTest.scala, and it seems the results are coming back in order, internally: List(!=, ##, *, +, +, ++, ++, ++, ++, ++:, ++:, +:, +:, ->, /:, :+, :+, :++, :++, :\, <, <=, ==, >, >=, addString, addString, addString, aggregate, andThen, andThen, appended, appended, appendedAll, appendedAll, apply, applyOrElse, asInstanceOf, canEqual, capitalize, charAt, charStepper, chars, codePointAt, codePointBefore, codePointCount, codePointStepper, codePoints, collect, ...

so is actually this some weird JLine issue? maybe it will go away if we can make the grouping UI work, as part of #12272 ?

@jxnu-liguobin
Copy link
Member

It seams look good in 2.13.5.

@griggt
Copy link

griggt commented May 6, 2021

This reminds me of scala/scala3#11488 which was fixed by upgrading to JLine 3.19.0.

@SethTisue SethTisue modified the milestones: Backlog, 2.13.5 May 6, 2021
@SethTisue SethTisue self-assigned this May 6, 2021
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

3 participants