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 1kLhNd-0008Kg-0K for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Sep 2020 06:38:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kLhNb-0007YW-Lv for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Sep 2020 06:38:51 +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 1kLhNb-0007VN-F8 for pgsql-hackers@lists.postgresql.org; Fri, 25 Sep 2020 06:38:51 +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 1kLhNZ-0006fF-77 for pgsql-hackers@postgresql.org; Fri, 25 Sep 2020 06:38:50 +0000 Received: from hnk.local (p2368131-ipbf2226funabasi.chiba.ocn.ne.jp [114.177.250.131]) by oss.nttdata.com (Postfix) with ESMTPSA id 7554862345; Fri, 25 Sep 2020 15:38:46 +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 To: btnakamichin , pgsql-hackers@postgresql.org References: From: Fujii Masao Message-ID: Date: Fri, 25 Sep 2020 15:38:46 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: 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 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, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION