Return-Path: X-Original-To: apmail-groovy-commits-archive@minotaur.apache.org Delivered-To: apmail-groovy-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E1EAB18B38 for ; Fri, 29 Jan 2016 22:34:03 +0000 (UTC) Received: (qmail 13193 invoked by uid 500); 29 Jan 2016 22:34:03 -0000 Delivered-To: apmail-groovy-commits-archive@groovy.apache.org Received: (qmail 13169 invoked by uid 500); 29 Jan 2016 22:34:03 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 13090 invoked by uid 99); 29 Jan 2016 22:34:03 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jan 2016 22:34:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EA3E3E0A12; Fri, 29 Jan 2016 22:34:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pascalschumacher@apache.org To: commits@groovy.apache.org Message-Id: <192e7e0523a846e88e4424224f10df4e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: GROOVY-7740: Groovsh code-completion should display groovy jdk enhancements of String Date: Fri, 29 Jan 2016 22:34:02 +0000 (UTC) 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 Authored: Fri Jan 29 23:33:39 2016 +0100 Committer: pascalschumacher 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()',