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 C128318342 for ; Fri, 29 Jan 2016 20:04:09 +0000 (UTC) Received: (qmail 5776 invoked by uid 500); 29 Jan 2016 20:04:09 -0000 Delivered-To: apmail-groovy-commits-archive@groovy.apache.org Received: (qmail 5748 invoked by uid 500); 29 Jan 2016 20:04:09 -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 5739 invoked by uid 99); 29 Jan 2016 20:04:09 -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 20:04:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8839CE0A12; Fri, 29 Jan 2016 20:04:09 +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: <41a718a480f8432f99104da09337368c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: GROOVY-7739: Groovsh code-completion should display groovy jdk enhancements of java.io.file Date: Fri, 29 Jan 2016 20:04:09 +0000 (UTC) Repository: groovy Updated Branches: refs/heads/GROOVY_2_4_X c8a077e2e -> 17a41cfae GROOVY-7739: Groovsh code-completion should display groovy jdk enhancements of java.io.file Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/17a41cfa Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/17a41cfa Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/17a41cfa Branch: refs/heads/GROOVY_2_4_X Commit: 17a41cfae08e42f1de8c251e2b80b6b0fbc44a61 Parents: c8a077e Author: pascalschumacher Authored: Fri Jan 29 21:00:31 2016 +0100 Committer: pascalschumacher Committed: Fri Jan 29 21:03:51 2016 +0100 ---------------------------------------------------------------------- .../shell/completion/ReflectionCompletor.groovy | 21 ++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/17a41cfa/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 4af4889..86ef981 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 @@ -475,6 +475,23 @@ class ReflectionCompletor { 'take(', 'takeWhile(' ].findAll({it.startsWith(prefix)}).each({candidates.add(it)}) } + if (instance instanceof File) { + [ + 'append(', + 'createTempDir(', + 'deleteDir()', 'directorySize()', + 'eachByte(', 'eachDir(', 'eachDirMatch(', 'eachDirRecurse(', 'eachFile(', 'eachFileMatch(', 'eachFileRecurse(', + 'eachLine(', 'eachObject(', + 'filterLine(', + 'getBytes()', 'getText()', + 'leftShift(', + 'newInputStream()', 'newOutputStream()', 'newPrintWriter(', 'newReader(', '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 Number) { [ 'abs()', @@ -510,10 +527,6 @@ class ReflectionCompletor { return candidates } - - - - private static Collection addClassFieldsAndMethods(final Class clazz, final boolean includeStatic, final boolean includeNonStatic,