codeconsole opened a new pull request, #3310: URL: https://github.com/apache/groovy/pull/3310
https://issues.apache.org/jira/browse/GROOVY-12785 Since GROOVY-12448, groovysh and the Groovy Console complete through the language engine. For an unqualified name it offered keywords, snippets, locals, the members the file's own classes declare and workspace types, but nothing the implicit receiver inherits, so in groovysh `printl` + Tab stopped completing to `println` (Groovy 6.0.0's groovysh completes it). An unqualified name now also gets: - the members the enclosing class inherits; for a script, `Script`'s `print`, `println` and `printf` - the extension methods for it, such as `sleep` and `sprintf` ``` groovy> printl<Tab> -> println groovy> sle<Tab> -> sleep groovy> prin<Tab><Tab> -> print(Object) printf(String, Object...) println() ... ``` A script's top-level statements, which are not inside a method of the source, use the script class. Inside a static method the class's instance members are left out (`hashCode` is not offered), while the extension methods still are, as they are called on the `Class` object. Names already offered are skipped, and an unloaded class waits for two characters before the extension catalog is searched, as completion after a dot does. An empty prefix adds nothing. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
