atom-ide-scala icon indicating copy to clipboard operation
atom-ide-scala copied to clipboard

Completions don't (always) delete their prefix

Open Jasper-M opened this issue 5 years ago • 4 comments

ide-scala version: 0.9.0 metals version: 0.5.2 scala versions: 2.11.12, 2.12.8 operating systems: OSX, Windows

Steps to reproduce

  1. open a metals project
  2. create file src/main/scala/Foo.scala
  3. type
class Foo {
  java.time.Loc
}
  1. a popup has automatically appeared by now suggesting LocalDate, LocalTime, LocalDateTime, Clock.
  2. select LocalDateTime with arrows keys and accept
  3. text changes to
class Foo {
  java.time.LocLocalDateTime
}

If you now undo and retry the completion the Loc prefix gets deleted. If you select the completion with the cursor the Loc prefix gets deleted. If in the above scenario you select Clock the Loc prefix gets deleted.

Jasper-M avatar Jun 03 '19 13:06 Jasper-M

Same thing happens when you accept the first suggested completion with tab or enter, which is probably the most common situation.

Jasper-M avatar Jun 03 '19 14:06 Jasper-M

I've seen this on the previous version as well. I wonder if it is something with the plugin or Atom itself

cquiroz avatar Jun 03 '19 14:06 cquiroz

I guess it's some interplay between atom and the plugin. It doesn't seem to happen with completions—based on words previously used—that Atom itself suggests.

Jasper-M avatar Jun 03 '19 14:06 Jasper-M

Yes, it's a known problem. I think that this is a bug in atom-languageclient and I'm hoping that this PR will fix it: https://github.com/atom/atom-languageclient/pull/254

laughedelic avatar Jun 04 '19 22:06 laughedelic