This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 103287 - Preserve formating in SQL text
Summary: Preserve formating in SQL text
Status: NEW
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: John Baker
: 108904 (view as bug list)
Depends on:
Reported: 2007-05-03 21:47 UTC by Pavel Buzek
Modified: 2008-02-27 07:47 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2007-05-03 21:47:17 UTC
(excerpt from email discussion) Do not overwrite the text of query when it is
edited visually unless the result it really different, preserve formating - for
example preserve lower case, end of line, things like select * from "foo"
instead of list of columns, order of columns in select, etc.

Correcting table/column names is good, ideally with a hint or an action, but the
editor also changes for example keywords to all capitals which is a bit too much
for me. It looks even worse when the View Data generates the select statement in
lower case - it should be consistent.

Replacing "*" with column names, to allow users to remove individual columns - 
as soon as you start adding/removing you have to change this, but if I
copy/paste select * and do not change something there is no reason.

Modify EOL formatting to enhance readibility: Note how many different styles are
there for Java (see the new Java Code panel in Tools | Options, for example),
why should we assume that there is only one correct style for SQL? I am not
saying we need complex options for SQL, but there may be more then one
reasonable style.

More importantly, I think that modifying users code w/o asking can be very
annoying. We cannot Save the query in visual editor so consider for example the
use case when the user copies some existing SQL into visual editor to tweak it a
bit and wants to copy it back to her .sql file.

In other editors we have "Reformat Code" which is IMO a better approach - makes
it easy but does not force the user. It should be added to SQL editor, ideally,
especially if we already have the implementation. Generation of new code is
different, there I think formatting it automatically is appropriate.
Comment 1 _ jimdavidson 2007-07-17 01:01:22 UTC
*** Issue 108904 has been marked as a duplicate of this issue. ***