MordFustang21 / ide-gopls

Atom integration with the Go language server (gopls)
MIT License
13 stars 5 forks source link

Fixes for autocomplete #17

Closed marcelkohl closed 2 years ago

marcelkohl commented 2 years ago

updated how changes are applied, instead of inserting changes it is now replaced as some suggestions from gopls are line removals.

Issue: response from gopls sometimes brings lines to be removed, and this removal was represented by "" (empty quotes) which in the previous procedure didn't work as expected.

Actually,

...
import (
  "time"
  "fmt"
)
...

Is wrongly updated to:

...
import (
  "tifmet"
  "fmos"
  "time"
)
...

Expectation: gopls range should be replaced by gopls suggestions and not inserted, giving the ability to "move" suggested lines

...
import (
  "fmt"   // moved up as gopls suggested
  "os"    // inserted suggestion
  "time"  // moved down
)
...

Result: textBuffer.setTextInRange is implemented instead of textBuffer.insert

MordFustang21 commented 2 years ago

Thanks for the improvement. Merged!