egradle icon indicating copy to clipboard operation
egradle copied to clipboard

Incorrect and messy auto-complete when using Groovy GString inside build.gradle

Open ghost opened this issue 7 years ago • 2 comments

When I try to use Groovy GString anywhere in build.gradle, the auto-complete is messy.

Steps to reproduce

Issue 1

  1. In build.gradle file, try to type println "Hello ${user}".
  2. Some times, the moment you type the opening {, it is expanded incorrectly into this:
println "Hello $[  ]

Issue 2

  1. Delete the incorrect [ ] characters and try to type { again.
  2. Some times, the moment you type the opening { (again), it is expanded into an empty closure:
println "Hello ${

}

Expected When I type println "Hello ${, it should either show a list of possible values or at least not do anything (as opposed to issues reported above).

There is no pattern to the order in which the above issues happen. They just happen alternatively randomly, if that makes sense. But one of the two issues happens every single time I type the opening {.

Environment Setup

  • EGradle Editor 2.4.0
  • EGradle IDE 2.4.0
  • Eclipse - Version: Oxygen.3a Release (4.7.3a) - Build id: 20180405-1200
  • JDK 1.8.0_121
  • macOS High Sierra 10.13.4

ghost avatar May 30 '18 08:05 ghost

The problem is the auto create ending brackets. I am also not very happy sometimes...

But you can easily turn the feature off inside preferences: image

I hope this helps you.

de-jcup avatar May 30 '18 11:05 de-jcup

Turning off the 'Auto create ending brackets' setting, gets rid of the issue. Thanks for the workaround!

ghost avatar May 30 '18 11:05 ghost