[GitHub] groovy pull request #438: GROOVY-7948: fix completion of static imports in g...

2016-10-15 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/groovy/pull/438


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] groovy pull request #438: GROOVY-7948: fix completion of static imports in g...

2016-10-13 Thread blackdrag
Github user blackdrag commented on a diff in the pull request:

https://github.com/apache/groovy/pull/438#discussion_r83155709
  
--- 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 matches) {
+SortedSet collectImportedSymbols(final String importSpec) {
--- End diff --

we decided to be strict about such things in a bugfix release and 2.4.8 is 
one. So yeah, unless the method signature is made compatible no 2.4.x


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] groovy pull request #438: GROOVY-7948: fix completion of static imports in g...

2016-10-12 Thread jwagenleitner
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 matches) {
+SortedSet 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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] groovy pull request #438: GROOVY-7948: fix completion of static imports in g...

2016-10-05 Thread heenenee
GitHub user heenenee opened a pull request:

https://github.com/apache/groovy/pull/438

GROOVY-7948: fix completion of static imports in groovysh

Fixed completion of static imports; updated unit tests; did some 
refactorings in ImportsSyntaxCompletor; added comment explaining how imports 
are stored in Groovysh.  Also did some manual testing of completion 
functionality using groovysh.bat in a cleanly built binary distribution.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/heenenee/groovy GROOVY-7948

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/438.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #438


commit ff0a7208949a2d32a5be9732383436b98a36eb27
Author: Abraham Grief 
Date:   2016-10-05T18:32:43Z

GROOVY-7948: fix completion of static imports in groovysh




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---