Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdedI-0007wa-4F for pgadmin-hackers@arkaria.postgresql.org; Tue, 14 Feb 2017 15:03:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cdedG-0008Iy-UB for pgadmin-hackers@arkaria.postgresql.org; Tue, 14 Feb 2017 15:03:06 +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 1cdedG-0008Iq-C9 for pgadmin-hackers@postgresql.org; Tue, 14 Feb 2017 15:03:06 +0000 Received: from mail-it0-x22f.google.com ([2607:f8b0:4001:c0b::22f]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cded8-0002ct-BR for pgadmin-hackers@postgresql.org; Tue, 14 Feb 2017 15:03:04 +0000 Received: by mail-it0-x22f.google.com with SMTP id c7so35538247itd.1 for ; Tue, 14 Feb 2017 07:02:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pivotal-io.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Tx9YVslCxzSZxG6Ra0MjtMR8bkQojc1R2nqm+0MKGh4=; b=yrt7/29FPFKAmYutYCdWUR389a6h0Xq9RG+bAUZjEr2v8nnynsFTCdlYsts6YgnUCN 0JD3rtmdoFlrzW0LvoJGk95l2uwCRQ8nGJXIwGkQXLOla1uguxUyVKP6SxeZJfQG33uV UoTBJtDGQH9vCBjeZjbeee9RDX0ZUt1wYMP9OAmg9vMT7uFBUnZqhT2sGotzTkSWgcuC KF3iAVethux6Bi/cP49HgTlphiTq4ISYlg3yRcyZoxmjk1FEbEEc5NbcUDWSJoFXftQv E/pHDefmec/NESAdBl67IlNaEizsKhuZc73oDBguAtSt+A9xRCDnyWgUByJ2VK14NSW0 5AUw== 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=Tx9YVslCxzSZxG6Ra0MjtMR8bkQojc1R2nqm+0MKGh4=; b=S7lmt+kd0V7YBnB3bvz9G8rmhNzY8+Pu2VkBBhUZdStawJfv0KiLPLg/Yc7p2z3zwv WwKvcvhq6mE2Bsz5yI40WQoCX4QPueqv5lzgO5rGfbKV+HFiw0fmWMExqoXm3uEonXgK L7/JHxTcOH+dirK04EV9pew7pCs/Xrjrj3AJ9qou6cctqGfIfH/COcddiz2wXpaUrFRQ GK1rNDE9Db+/YQdborCzZ3xqz7t12wT88mmEbVRQfdrILcRHMDx6j9IN4+GmDROU7sNz ybPgaVFKwbRt7fUfjbdj3IH4lkq6lhNPNXok5jCOHZA89UdTH+oiQ+8o+Q7uUkZpyhyR GnDA== X-Gm-Message-State: AMke39lLeLuP5ofVplJFNBB6h75VX/ocyuPMUf3EPsStNBt/SqxhuoM5bGVsXFkZbGurQYjLpRrT8Z92hhg5oujb X-Received: by 10.36.105.148 with SMTP id e142mr3861874itc.95.1487084562874; Tue, 14 Feb 2017 07:02:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.156.67 with HTTP; Tue, 14 Feb 2017 07:02:42 -0800 (PST) In-Reply-To: References: From: Raffi Holzer Date: Tue, 14 Feb 2017 10:02:42 -0500 Message-ID: Subject: Re: Autoformatting To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a113f6fde1f3da605487edbdd X-Pg-Spam-Score: -2.6 (--) 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 --001a113f6fde1f3da605487edbdd Content-Type: text/plain; charset=UTF-8 Hi Dave, When we were talking about auto formatting we were actually referring to a single button press doing all of these things to a large block of text. The use case here would be if you receive a large illegible query and paste it into the query editor it would either automatically auto-format or you would press a button and it would auto-format. We are trying to determine a few things. One, are there preferred formatting guidelines and two, how should this autoformatting be implemented? On a button press? Upon pasting in the text? On Tue, Feb 14, 2017 at 5:53 AM, Dave Page wrote: > 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 > -- Raffi Holzer Product Manager Pivotal Labs --001a113f6fde1f3da605487edbdd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dave,
=C2=A0When we were talking about auto formatt= ing we were actually referring to a single button press doing all of these = things to a large block of text. The use case here would be if you receive = a large illegible query and paste it into the query editor it would either = automatically auto-format or you would press a button and it would auto-for= mat. We are trying to determine a few things. One, are there preferred form= atting guidelines and two, how should this autoformatting be implemented? O= n a button press? Upon pasting in the text?

On Tue, Feb 14, 2017 at 5:53 AM, Dave= Page <dpage@pgadmin.org> wrote:
Hi

On Mon, Feb 13, 2017 at 9:35 PM, Raffi Holzer <rholzer@pivotal.io> wrote:
> Hi Hackers,
>=C2=A0 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



--
Raffi Holzer
Product Manager
Pivotal Labs
--001a113f6fde1f3da605487edbdd--