Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSy4U-0005YL-RF for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Oct 2020 07:53:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kSy4T-0005Va-Og for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Oct 2020 07:53:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSy4T-0005VS-I8 for pgsql-hackers@lists.postgresql.org; Thu, 15 Oct 2020 07:53:09 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSy4R-0006ZG-91 for pgsql-hackers@postgresql.org; Thu, 15 Oct 2020 07:53:08 +0000 Received: from hnk.local (p1295030-ipngn4902funabasi.chiba.ocn.ne.jp [153.166.85.30]) by oss.nttdata.com (Postfix) with ESMTPSA id D077F62399; Thu, 15 Oct 2020 16:53:03 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: Feature improvement for FETCH tab completion From: Fujii Masao To: btnakamichin Cc: pgsql-hackers@postgresql.org References: <3a4f470b-f840-9918-8e99-2a43fe37510e@oss.nttdata.com> Message-ID: <52bf8779-20e8-5113-4b82-111569ee33c8@oss.nttdata.com> Date: Thu, 15 Oct 2020 16:53:03 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <3a4f470b-f840-9918-8e99-2a43fe37510e@oss.nttdata.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/09/25 21:46, Fujii Masao wrote: > > > On 2020/09/25 17:21, btnakamichin wrote: >> 2020-09-25 15:38 に Fujii Masao さんは書きました: >>> On 2020/09/25 14:24, btnakamichin wrote: >>>> Hello! >>>> >>>> I’d like to improve the FETCH tab completion. >>>> >>>> The FETCH tab completion . Therefore, this patch fixes the problem. >>>> >>>> Previous function completed one of FORWARD, BACKWARD, RELATIVE, ABSOLUTE, but now it completes one of FORWARD, BACKWARD, RELATIVE, ABSOLUTE, ALL, NEXT, PRIOR, FIRST, LAST and Corresponded to later IN and FROM clauses. >>> >>> Thanks for the patch! Here are review comments. >>> >>> +    /* Complete FETCH BACKWARD or FORWARD with one of ALL */ >>> +    else if (Matches("FETCH|MOVE", "BACKWARD|FORWARD")) >>> +        COMPLETE_WITH("ALL"); >>> >>> Not only "ALL" but also "FROM" and "IN" should be displayed here >>> because they also can follow "BACKWARD" and "FORWARD"? >>> >>>     else if (Matches("FETCH|MOVE", MatchAny, MatchAny)) >>> +    else if (Matches("FETCH|MOVE", "ABSOLUTE|BACKWARD|FORWARD|RELATIVE", >>> MatchAny)) >>> +        COMPLETE_WITH("FROM", "IN"); >>> >>> This change seems to cause "FETCH FORWARD FROM " to display "FROM" >>> and "IN". To avoid this confusing tab-completion, we should use something like >>> MatchAnyExcept("FROM|IN") here, instead? >>> >>> Regards, >> >> I’m Sorry, I forgot to include pgsql_hackers in the cc, so I resend it >> >> Thank you, I appreciate your comment. >> >> I have attached patch with newline. > > Thanks for updating the patch! > > The patch should include only the change of tab-complete for FETCH, > but accidentally it also includes DEALLOCATE that's proposed by you > in another thread. So I exclude DEALLOCATE part from the patch. > Attached is the updated version of the patch. Pushed. Thanks! Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION