bug icon indicating copy to clipboard operation
bug copied to clipboard

REPL: grab bag of tab completion issues/improvements

Open SethTisue opened this issue 5 years ago • 8 comments

if something is a blocker for some 2.13.x release, remove it from here and give it its own ticket

doc: https://github.com/jline/jline3/wiki/Completion

on the PR Som wrote:

Tried it out. Did Jline completion always tab through alternatives? Some ordinary completion is broken, however, and will need repair.

(Actually I couldn't reproduce: c tab displayed cc and was stuck. Reminiscent of scala/bug#10914.)

I guess the val c: C used to be shown below the line as an explanatory result?

scala> class C defined class C

scala> val c = new C c: C = C@58a7dc4

scala> val c: C // c tab

SethTisue avatar Mar 05 '20 12:03 SethTisue

"Completion suggestions have changed when the cursor is midway through an identifier" (https://github.com/scala/scala/pull/8036#issuecomment-525145239)

SethTisue avatar Mar 05 '20 12:03 SethTisue

https://github.com/scala/scala/pull/7645#issuecomment-454269972: "I noticed that ^A ^E no longer go to line start/end all the time."

SethTisue avatar Mar 05 '20 15:03 SethTisue

Throwing into the grab bag:

scala> class Foo
class Foo

scala> val f = new Foo<tab>

fills to

scala> val f = new def <init>(): Foo

martijnhoekstra avatar Mar 25 '20 15:03 martijnhoekstra

That seems to be the same bug as https://github.com/scala/scala-dev/issues/696

lrytz avatar Mar 26 '20 14:03 lrytz

JShell does a nice thing where it shows whether the method has parameters or not:

jshell> class C { int x; void foo(int y) { }; void bar() { } }
|  replaced class C

jshell> new C().
bar()         equals(       foo(          getClass()    hashCode()    notify()      notifyAll()   
toString()    wait(         x             

there's x (field, no parens), bar() (nilary method), and foo( (method with at least one param)

SethTisue avatar Apr 14 '20 21:04 SethTisue

I closed https://github.com/scala/scala-dev/issues/698 with https://github.com/scala/scala/pull/8905 but there are still a number of ways the UX could be better; 698 has some commentary with details

SethTisue avatar Apr 22 '20 04:04 SethTisue

scala/scala#8905 indicates whether a method is nullary, nilary, or other by showing nothing, (), or (. @lrytz suggested that it ought to insert the parens for you when you chose that completion. I believe JLine does support this through the "suffix" field. Something to try.

SethTisue avatar Apr 22 '20 14:04 SethTisue

I just noticed 2.13.6 // print tab completion looked like

scala> 1 + 1 // print
(1).+(1) // : Int(2)

and now it does a weird thing where it does completions but with 2 columns (blank left column) and it prints wrong when highlighting the right column. These are 3 tabs, redrawing the line:

scala> 1 + 1 // print
                       (1).+(1) // : Int(2)
scala> 1 + 1 // print
                       (1).+(1) // : Int(2)
scala> 1 + 1 // print(1).+(1) // : Int(2)
                       (1).+(1) // : Int(2)

This is on WSL, so maybe something else is going on. Or maybe the improvement to regular completions introduced this behavior for // print completion. Not worth a ticket, however.

som-snytt avatar Apr 24 '22 04:04 som-snytt

Forgot the umbrella when I https://github.com/scala/bug/issues/12843 "Show me the parameters"

som-snytt avatar Oct 18 '23 21:10 som-snytt