groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-7948) tab completion for static imports in groovysh does not work
Date Wed, 12 Oct 2016 21:10:22 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-7948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15569883#comment-15569883
] 

ASF GitHub Bot commented on GROOVY-7948:
----------------------------------------

Github user jwagenleitner commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/438#discussion_r83096173
  
    --- Diff: subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ImportsSyntaxCompletor.groovy
---
    @@ -87,51 +78,49 @@ class ImportsSyntaxCompletor implements IdentifierCompletor {
             return foundMatch
         }
     
    -    private static final String STATIC_IMPORT_PATTERN = ~/^import static ([a-z0-9]+\.)+[A-Z][a-zA-Z0-9]*(\.(\*|[^.]+))?$/
    +    private static final String STATIC_IMPORT_PATTERN = ~/^static ([a-zA-Z_][a-zA-Z_0-9]*\.)+([a-zA-Z_][a-zA-Z_0-9]*|\*)$/
     
         /**
          * finds matching imported classes or static methods
    -     * @param prefix
    -     * @param importSpec
    -     * @param matches
    -     * @return
    +     * @param importSpec an import statement without the leading 'import ' or trailing
semicolon
    +     * @return all names matching the importSpec
          */
    -    void collectImportedSymbols(final String importSpec, final Collection<String>
matches) {
    +    SortedSet<String> collectImportedSymbols(final String importSpec) {
    --- End diff --
    
    While I don't think `collectImportedSymbols` was meant to be called outside this class
there is a chance it could be since it's a public method.  So to avoid a breaking change and
to have the chance to include this in the next 2.4 release (2.4.8) it would be necessary to
keep the `void collectImportedSymbols(String,Collection)` method.


> tab completion for static imports in groovysh does not work
> -----------------------------------------------------------
>
>                 Key: GROOVY-7948
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7948
>             Project: Groovy
>          Issue Type: Bug
>          Components: Groovysh
>    Affects Versions: 2.4.7
>            Reporter: Abraham Grief
>
> Currently, if I run groovysh, and enter the following:
> {noformat}
> class MyMath {
>     static int square(int x) {return x*x}
> }
> import static MyMath.*
> {noformat}
> Then enter {noformat}sq{noformat} followed by hitting the Tab key, groovysh does not
provided any possible auto-completions.
> Instead, hitting the Tab key should auto-complete to the square method in MyMath.
> I fixed this already in my local groovy installation and can submit it as a pull request
if that helps.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message