Difficulty to write decimal numbers with code assist auto-activation enabled
Suppose you have code assist auto-activation enabled and you want to type:
def a = 12.0
def b = 5.0
When you've finished to type def a = 12.0 and hit Enter to go to the next line, now Greclipse replaces your input with: def a = 12.toUnsignedString0(arg0, arg1).
It's very annoying. I understand why it happens (I think it's due to #687), but I think that some kind of solution should be found. Maybe in this special case, the suggestion list could also suggest simple digits (from 0 to 9), with the digit you typed on top... Or simply disable auto-activation (even when enabled) for numbers...
A couple options exist for you:
- disable content assist auto-activation
- increase the delay for auto-activation
- disable substring matching for content assist proposals
- hit Esc key to cancel content assist proposals when typing floating-point literal
Sure. But 1-3 have an impact on the whole content assist experience in all contexts (Groovy and Java). Option 4 is what I must do now and I'm calling annoying, especially because in general I must do this here and there only with the Groovy editor :-(
The content assist was originally designed for Java, where there were no methods/properties for primitives or literals. So there was no conflict in this situation. If you start typing 0. in the Java Editor, there is only a literal as a valid possibility. Groovy adds not only methods for wrapper types and extension methods (DGMs), but also DSL suggestions. That means, content assist pops for 0. and if you want to type more of the literal but the additional numerals also match the substring of a method, what is the Groovy Editor supposed to do? It is suggesting the possibilities that are legal.
If the content assist popup is present, typing Enter will apply the selected proposal. If you want Enter to be a newline, you need to cancel the content assist popup with Esc.
IMHO, in this particular case, as I said, either the content assist should also propose digits (that is, in addition to toUnsignedString0(arg0, arg1) should also propose 0, 1, .. 9... a bit strange, I know, but effective, especially if suggestions are properly sorted by exact match on TOP), or prevent auto-activation for numbers even if it's enabled globally (if it's feasible), because it MUCH more likely that you want to type a decimal number than to type a method invocation on a number constant, I think. In the latter case, you can always hit Cltrl+Space to see the suggestions you already see now.
This is just one of the reasons I don't use auto-activation or substring matching. I find that more often they conflict with my intentions than help me achieve them.
For me auto activation is a must, I usually hit ctrl+space just when editing existing code (to insert/overwrite something). But in this particular case I think it's causing more trouble than benefit. Substring matching IMHO can be very useful in some less frequent cases, but only when you start to type at least 2 or 3 characters. Matching just one character as contained in a proposal is much less useful IMHO (and this is the reason why on the other issue I'm saying that substring matches should have lower priority than exact/prefix matches independently on the content grouping)