Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdajK-0000V4-0D for pgadmin-hackers@arkaria.postgresql.org; Tue, 14 Feb 2017 10:53:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cdajJ-0007i0-JR for pgadmin-hackers@arkaria.postgresql.org; Tue, 14 Feb 2017 10:53:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cdajI-0007gC-Tv for pgadmin-hackers@postgresql.org; Tue, 14 Feb 2017 10:53:05 +0000 Received: from mail-it0-x22b.google.com ([2607:f8b0:4001:c0b::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cdajG-0005ZO-2w for pgadmin-hackers@postgresql.org; Tue, 14 Feb 2017 10:53:03 +0000 Received: by mail-it0-x22b.google.com with SMTP id 203so31273991ith.0 for ; Tue, 14 Feb 2017 02:53:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bAOQYMx67QOwOU/yXdsMJW3iSMC7NoVFB0HUoRrSZwQ=; b=G5D8lTqeNRQN/GOMSkxpfaTohxGeC1CTLLquax/5KR5Z2AhqOKA2VzBhp2+vW0shjl bSUVBKrZTk2VHkv5u9QnfztNT7LRr+pqSivY3kGLGjbByeCDzDjMwB00kUkRV24deKUO RC3GACwBG3kPvSSlyxkLOddi/VJJjDLuKaBndbdwV9XhyeCglVbJ4e3Q0uOJcc9aCm+D zQO5tWy/mquDQo3UIBfPuvvIqfKWbafG9926oYg3yMWitVs5rQgm9X4U2jSGtwttlaec ao86ip6hvnxvPeZ8myfMufKJbtIiqrK/bz6vi7KLqNOgzTNCSKXnf+HPNhpACkRURRy+ bd6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bAOQYMx67QOwOU/yXdsMJW3iSMC7NoVFB0HUoRrSZwQ=; b=L1lcZKyJ44T6CJSaK6itSBhMW1pssoaXFbZW5CZr26j9MDRcR3rOy5xTpq1X5CXp1B Uqk3D+dVas3NFcl+i4CvUuC1WplkwGZdVPhB1yJG8SzvCOA8fCMQS/dP8fQZ+8rV0ufX IozMS+C2EgiNkWiKL05aat/ElTY6lptV4tx98T54uEWMxJw10qWzz3XmbGp1sW7wcHCu tgooNDUeYfsZYfReTKinMIXGvj+qJ9o5FzCyWNGk7LYsMkZN6SVI9dJ9o2uQeA35QFnc Sggk8ALRitW9uFOEmH2f9UQO5EsfPbTGKGMHOPfh2UlJ+wMLEFzaLui4psIXuwuGCcv0 fj1A== X-Gm-Message-State: AMke39l3uq7a/oli9lSji7ZoMWTGA+UBXGezPFrpynLfd8MnJ5u8qztBTAOejJL7zoZIZsqruzDsLBIN/blIJQ== X-Received: by 10.36.121.75 with SMTP id z72mr2691436itc.94.1487069581052; Tue, 14 Feb 2017 02:53:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.224.198 with HTTP; Tue, 14 Feb 2017 02:53:00 -0800 (PST) In-Reply-To: References: From: Dave Page Date: Tue, 14 Feb 2017 10:53:00 +0000 Message-ID: Subject: Re: Autoformatting To: Raffi Holzer Cc: pgadmin-hackers Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org Hi On Mon, Feb 13, 2017 at 9:35 PM, Raffi Holzer wrote: > Hi Hackers, > We are looking into auto formatting SQL text in the SQL editor. However, > some users have expressed that this can be done in different ways. Are there > preferences in this community fo rhow autoformatting should be done? I think that really depends on the specific feature being discussed. For example, auto-indentation is very handy, and whilst it (and most formatting features) should be configurable, I suspect many people will leave it turned on. On the other hand, something like auto-upper-casing of keywords may be either automatic, or shortcut initiated, e.g. hit Ctrl+U to upper-case the word under the cursor. Perhaps you should start by listing the specific features? For reference, here's what pgAdmin 3 had: * The auto-indent feature will automatically indent text to the same depth as the previous line when you press return. * Block indent text by selecting two or more lines and pressing the Tab key. * Block outdent text that has been indented using the current tab settings using Shift+Tab. * Comment out SQL by selecting some text and pressing the Control+K. * Uncomment SQL by selecting some text starting with a comment and pressing Control+Shift+K. * Shift the selected text to upper case by pressing Control+U. * Shift the selected text to lower case by pressing Control+Shift+U. pgAdmin 4 currently has: * Auto-indent (not currently possible to disable it) I'd definitely like to see the rest (and anything else that seems useful) added, and made configurable where appropriate. I suspect the only ones that should be truly automatic are auto-indent and and upper-casing of keywords. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers