Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.3
-
None
-
Any
Description
Currently, Groovysh code completion completes far less expressions than it safely could. The main blocker is that the code that determines whether and what to complete iterates over the current line character by character and completes only java identifiers.
Suggest to use a GroovyLexer approach instead and complete any expression that does not have method invocations in the expression part before the cursor.
This allows completion of expressions like
"foo".
[1, 2, 3].
foo.bar.baz.
And multiline expressions like
x = [1,
2].
y = """start
end""".
Caveat: The expressions evaluated also include getters and operators, as well as expressions like
"foo"().
This can lead to undesired side effects and long running completion times, but this disadvantage is unlikely to occur and is outweighted by far by the advantages IMO.
Attachments
Issue Links
- relates to
-
GROOVY-6074 Import completion for all jar files on CLASSPATH
- Closed