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 1oXePn-0005BH-2d for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Sep 2022 08:03:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXePl-0007uM-V4 for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Sep 2022 08:03:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXePl-0007uD-L7 for pgsql-hackers@lists.postgresql.org; Mon, 12 Sep 2022 08:03:33 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXePi-0005bn-Pa for pgsql-hackers@postgresql.org; Mon, 12 Sep 2022 08:03:33 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 1DEA460860; Mon, 12 Sep 2022 17:03:25 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.7 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 12 Sep 2022 17:03:25 +0900 From: Shinya Kato To: bt22kawamotok Cc: pgsql-hackers@postgresql.org Subject: Re: [PATCH]Feature improvement for MERGE tab completion In-Reply-To: References: <9f1ad2a87a58cd5e7d64f3993130958d@oss.nttdata.com> <359a46c295eae938d84552c11818ab62@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: Shinya11.Kato@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-09-12 15:53, bt22kawamotok wrote: >> else if (TailMatches("USING", MatchAny, "ON", MatchAny, "WHEN")) >> COMPLETE_WITH("MATCHED", "NOT MATCHED"); >> else if (TailMatches("USING", MatchAny, "AS", MatchAny, "ON", >> MatchAny, "WHEN")) >> COMPLETE_WITH("MATCHED", "NOT MATCHED"); >> else if (TailMatches("USING", MatchAny, MatchAny, "ON", MatchAny, >> "WHEN")) >> COMPLETE_WITH("MATCHED", "NOT MATCHED"); >> >> I thought it would be better to describe this section as follows, >> summarizing the conditions >> >> else if (TailMatches("USING", MatchAny, "ON", MatchAny, "WHEN") || >> TailMatches("USING", MatchAny, "AS", MatchAny, "ON", MatchAny, >> "WHEN") || >> TailMatches("USING", MatchAny, MatchAny, "ON", MatchAny, "WHEN")) >> COMPLETE_WITH("MATCHED", "NOT MATCHED"); >> >> There are similar redundancies in the tab completion of MERGE >> statement, so why not fix that as well? > > Thanks for your review. > > A new patch has been created to reflect the changes you indicated. Thanks for updating! Compile errors have occurred, so can you fix them? And I think we can eliminate similar redundancies in MERGE tab completion and I would like you to fix them. For example, else if (TailMatches("WHEN", "MATCHED")) COMPLETE_WITH("THEN", "AND"); else if (TailMatches("WHEN", "NOT", "MATCHED")) COMPLETE_WITH("THEN", "AND"); above statement can be converted to the statement below. else if (TailMatches("WHEN", "MATCHED") || TailMatches("WHEN", "NOT", "MATCHED")) COMPLETE_WITH("THEN", "AND"); -- Regards, -- Shinya Kato Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION