Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.5.2.Release
-
Fix Version/s: None
-
Component/s: Content Assist, Editor
-
Labels:None
-
Environment:STS 2.7.1, Linux
-
Number of attachments :
Description
I have code like this:
class A {
def b = {
def x = 1
println "The value is ."
}
}
If I place the cursor before the "." in the printed string and hit Ctrl+Space, I get "x" as one of the (many) suggestions for completion. If I select "x", that line will now look like this:
println "The value is x."
I would expect it to have looked like this:
println "The value is ${x}."
It doesn't really make sense to me to print out the name of a variable (or method) selected from the suggested completions. It makes more sense that the completion would add the "$
{" and "}", so that the value of the variable or method is printed. It might then be useful to keep the cursor inside the closing brace to allow a more complex expression to be entered, but with the option to hit Tab to move the cursor after the closing brace.
This suggested behaviour is a little different from the unwanted closing brace I reported in GRECLIPSE-1172, as there I typed the opening brace and had the option to automatically close braces turned off, while here I didn't type the opening brace and expect a little "GString expression template" to be inserted by the content assist feature.