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: use JLine grouping feature to present choices in groups #12281

Open
SethTisue opened this issue Dec 9, 2020 · 4 comments

Comments

@SethTisue
Copy link
Member

SethTisue commented Dec 9, 2020

The main goal is to deemphasize deprecated methods and universal methods.

We attempted this for 2.13.3 but were blocked by JLine bugs (or so it seemed to me, I don't think I was just doing it wrong?). The situation may be improved in recent JLine releases, see e.g. jline/jline3#613 (comment). some old WIP on this https://github.com/SethTisue/scala/commits/jline3-group-based

We might also want to separate extension methods from built-in methods?

A stretch goal could be to use the Scaladoc groupings (idea from @martijnhoekstra)

@SethTisue
Copy link
Member Author

how to use a local build of JLine 3: mvn install from the JLine repo to publish to ~/m2, then edit our versions.properties, e.g.:

-jline.version=3.17.1
+jline.version=3.17.2-SNAPSHOT

then set Global / resolvers += Resolver.mavenLocal (but it won't work if you have -Dsbt.override.build.repos=true in your SBT_OPTS)

@SethTisue
Copy link
Member Author

SethTisue commented Dec 9, 2020

I rebased my WIP branch.

Regardless of whether we use JLine 3.17.1 or a locally built snapshot, the current behavior is as follows. When you first hit TAB, it works:

Screen Shot 2020-12-09 at 1 21 48 PM

but then as you soon as you tab into the groups, the groups vanish:

Screen Shot 2020-12-09 at 1 22 25 PM

which has been reported at jline/jline3#613

ah, but in jline/jline3@538b7fa the fix is that you have to explicitly ask for GROUP_PERSIST(false), let me try that

@SethTisue
Copy link
Member Author

okay GROUP_PERSIST(false) gives behavior that seems okay first, but then pretty quickly you discover that arrow key navigation is all messed up, both up/down arrow and left/right arrow behave weirdly (in different ways)

and that's jline/jline3#580 , which was closed, but not because it actually got fixed

@SethTisue
Copy link
Member Author

conclusion: I'm taking this off the 2.13.5 milestone and backlogging it. let's hope this eventually gets fixed upstream.

or, would a volunteer like to try and fix it upstream...?

@SethTisue SethTisue modified the milestones: 2.13.5, Backlog Dec 9, 2020
@SethTisue SethTisue removed their assignment Dec 9, 2020
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

1 participant