You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2016/01/29 23:34:02 UTC

groovy git commit: GROOVY-7740: Groovsh code-completion should display groovy jdk enhancements of String

Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 7d5f716f7 -> 220c4eef4


GROOVY-7740: Groovsh code-completion should display groovy jdk enhancements of String

Plus some other minimal improvements of displayed groovy jdk enhancements


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/220c4eef
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/220c4eef
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/220c4eef

Branch: refs/heads/GROOVY_2_4_X
Commit: 220c4eef4b4cdb4476a5ea23307434a5b49d613d
Parents: 7d5f716
Author: pascalschumacher <pa...@gmx.net>
Authored: Fri Jan 29 23:33:39 2016 +0100
Committer: pascalschumacher <pa...@gmx.net>
Committed: Fri Jan 29 23:33:39 2016 +0100

----------------------------------------------------------------------
 .../shell/completion/ReflectionCompletor.groovy | 31 ++++++++++++++++----
 1 file changed, 26 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/220c4eef/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ReflectionCompletor.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ReflectionCompletor.groovy b/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ReflectionCompletor.groovy
index fc06b2e..fa17ae7 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ReflectionCompletor.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ReflectionCompletor.groovy
@@ -447,9 +447,15 @@ class ReflectionCompletor {
                     'retainAll(', 'removeAll(',
                     'unique()', 'unique('
             ].findAll({it.startsWith(prefix)}).each({candidates.add(it)})
+            if (instance instanceof Collection) {
+                [
+                        'grep('
+                ].findAll({ it.startsWith(prefix) }).each({ candidates.add(it) })
+            }
             if (instance instanceof List) {
                 [
                         'collate(',
+                        'execute()', 'execute(',
                         'pop()',
                         'transpose()'
                 ].findAll({it.startsWith(prefix)}).each({candidates.add(it)})
@@ -478,19 +484,34 @@ class ReflectionCompletor {
         if (instance instanceof File) {
             [
                     'append(',
-                    'createTempDir(',
+                    'createTempDir()', 'createTempDir(',
                     'deleteDir()', 'directorySize()',
-                    'eachByte(', 'eachDir(', 'eachDirMatch(', 'eachDirRecurse(', 'eachFile(', 'eachFileMatch(', 'eachFileRecurse(',
-                    'eachLine(', 'eachObject(',
+                    'eachByte(', 'eachDir(', 'eachDirMatch(', 'eachDirRecurse(', 'eachFile(', 'eachFileMatch(', 'eachFileRecurse(', 'eachLine(',
                     'filterLine(',
-                    'getBytes()', 'getText()',
-                    'newInputStream()', 'newOutputStream()', 'newPrintWriter(', 'newReader(', 'newWriter(',
+                    'getBytes()', 'getText()', 'getText(',
+                    'newInputStream()', 'newOutputStream()', 'newPrintWriter()', 'newPrintWriter(', 'newReader()', 'newReader(', 'newWriter()', 'newWriter(',
                     'readBytes()', 'readLines(', 'renameTo(',
                     'setBytes(', 'setText(', 'size()', 'splitEachLine(',
                     'traverse(',
                     'withInputStream(', 'withOutputStream(', 'withPrintWriter(', 'withReader(', 'withWriter(', 'withWriterAppend(', 'write('
             ].findAll({it.startsWith(prefix)}).each({candidates.add(it)})
         }
+        if (instance instanceof String) {
+            [
+                    'capitalize()', 'center(', 'collectReplacements(', 'count(',
+                    'decodeBase64()', 'decodeHex()', 'denormalize()',
+                    'eachLine(', 'eachMatch(', 'execute()', 'execute(',
+                    'find(', 'findAll(',
+                    'isAllWhitespace()', 'isBigDecimal()', 'isBigInteger()', 'isDouble()', 'isFloat()', 'isInteger()', 'isLong()', 'isNumber()',
+                    'normalize()', 
+                    'padLeft(', 'padRight(',
+                    'readLines()', 'reverse()', 
+                    'size()', 'splitEachLine(', 'stripIndent(', 'stripMargin(',
+                    'toBigDecimal()', 'toBigInteger()', 'toBoolean()', 'toCharacter()', 'toDouble()', 'toFloat()', 'toInteger()',
+                    'toList()', 'toLong()', 'toSet()', 'toShort()', 'toURI()', 'toURL()',
+                    'tokenize(', 'tr('
+            ].findAll({it.startsWith(prefix)}).each({candidates.add(it)})
+        }
         if (instance instanceof Number) {
             [
                     'abs()',