Hey pete,

yes, options liek formatting, Code completion and other stuff is missing.


Cheers

Chris



Von: Pete Whelpton
Gesendet: Donnerstag, 2. April 2020 11:48
An: dev@netbeans.apache.org
Betreff: Re: Re: Auto completion support for Database languages.

Hi Eric,

/ide/db.sql.editor/src/org/netbeans/modules/db/sql/editor/completion
should get you started.  The auto pop-up logic is in the
getAutoQueryTypes() method of SQLCompletionProvider.java :)

I too assume the references to the . are related to aliases/column
names.  But why it is hard coded to only auto-popup after a ., I don't
know.  I replied to both Chris L's Jira and this thread querying this,
but never had any answers, so I'm guessing the reasoning behind that
decision is now lost?

AFAIK, there are no specific Code Completion, Folding or Formatting
Options in NB for SQL dialect.

Cheers!

P

On Thu, Apr 2, 2020 at 4:33 AM Eric Bresie <ebre...@gmail.com> wrote:
>
> Sorry away from my computer and couldn’t try this but...
>
> I was looking for Netbeans autocomplete and found a stack overflow article 
> (1) that got me wonder...could this be related to option setting of some 
> type? What options are available for SQL regarding triggers and pop ups (as 
> mentioned for the java equivalent)?
>
> Am I correct in saying the “.” Was to cause auto completion between say a 
> table alias or schema reference and the next part like column name or table? 
> In other languages assume this would be like having a java variable then a 
> delimitator token between class instance name and method or field tokens.
>
> Assume if no connection is define then it can’t auto correct with specific 
> tables or columns based on the connection. I suppose if no connection 
> available the db/table specific shouldn’t be available.
>
> Silly question but where in the code base is this autocomplete logic and/or 
> is there extensions in a db specific area of the code?
>
> (1) https://stackoverflow.com/questions/15330926/autocomplete-in-netbeans
>
> Eric Bresie
> ebre...@gmail.com
> > On March 31, 2020 at 5:48:17 AM CDT, Pete Whelpton <peedee...@gmail.com> 
> > wrote:
> > Thanks for the background, Chris!
> >
> > As well as the warning dialog pop-up about no SQL connection, I believe
> > Netbeans also logs the message to the status bar at the bottom?
> >
> > I think the ideal solution would be support for multiple SQL dialects (with
> > ability to add more via plugin), with the option to chose which dialect is
> > parsed from a drop-down on the SQL editor (similar to a SQL plugin I've
> > seen for IntelliJ)
> >
> > That seems a lot of work though, so a quick win to get the already included
> > SQL completion more visible / usable might be:
> >
> > 1) Change the auto pop-up logic so it pops up after first character typed
> > (and filters on this), rather than only after .
> >
> > 2) Remove the dialog about no SQL connection popping up, so the error is
> > just on the status bar at the bottom of NB?
> >
> > 3) Just klimming to code, I've got a feeling the code completion will hang
> > on completion (with the Please wait... message) after a . if no SQL
> > connection is made. So that should be handled gracefully.
> >
> > Thoughts, anyone?
> >
> > P
> >
> >
> > On Tue, 31 Mar 2020, 11:33 Christian Lenz, <christian.l...@gmx.net> wrote:
> >
> > > Hey Pete,
> > >
> > > I think your ticket https://issues.apache.org/jira/browse/NETBEANS-188 is
> > > dependent from the other with the missing Connection
> > > https://issues.apache.org/jira/browse/NETBEANS-189. So the Problem is, if
> > > 189 is not resolved, 188 doesn’t make sense. Because, as often as you 
> > > type,
> > > and the Code completion Comes up immediately, it Shows you the Dialog of
> > > missing Connection, when you have a simple SQL file w/o a Connection to a
> > > DB which is annoying.
> > >
> > >
> > > Cheers
> > >
> > > Chris
> > >
> > >
> > >
> > >
> > > Von: Pete Whelpton
> > > Gesendet: Dienstag, 31. März 2020 11:51
> > > An: dev@netbeans.apache.org
> > > Betreff: Re: Auto completion support for Database languages.
> > >
> > > One thing I noticed about the basic SQL completion in Netbeans, the
> > > getAutoQueryTypes(JTextComponent component, String typedText) method
> > > of SQLCompletionProvider.java starts with the following:
> > >
> > > if (!".".equals(typedText)) {
> > > return 0;
> > > }
> > >
> > > which means the Code Completion dialog won't pop-up automatically,
> > > except after a . character. So it will offer auto-completion for
> > > things like column names for fully qualified columns ([table].[column]
> > > etc.), but not SQL keywords - which can make it appear that Netbeans
> > > has no SQL completion at all! Code completion dialog, including SQL
> > > keywords, will still pop-up when hitting Ctrl-Space though...
> > >
> > > Chris L logged a Jira about it:
> > > https://issues.apache.org/jira/browse/NETBEANS-188
> > >
> > > I assumed that code was there for a reason, so was hesitant to remove
> > > it. But if there is no good reason to suppress the Code Completion
> > > dialog, perhaps that code should be removed? I'd be happy to do the
> > > PR.
> > >
> > >
> > > Also, the list of supported SQL keywords is very basic, and based on
> > > the SQL-99 Complete book. See
> > > /ide/dbapi/src/org/netbeans/modules/db/api/sql/SQLKeywords.java
> > >
> > > Hope that helps!
> > >
> > > P
> > >
> > >
> > > On Tue, Mar 31, 2020 at 12:42 AM Tim Boudreau <niftin...@gmail.com> wrote:
> > > >
> > > > Well, that shows how often I do SQL in anything other than a text 
> > > > console
> > > > :-)
> > > >
> > > > -Tim
> > > >
> > > > On Mon, Mar 30, 2020 at 4:04 PM Matthias Bläsing <
> > > mblaes...@doppel-helix.eu>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Am Montag, den 30.03.2020, 21:04 +0600 schrieb Brain Rebooting:
> > > > > > Is there any possibility that Netbeans will support autocompletion
> > > for
> > > > > > database language like IntelliJ Idea in the near future?
> > > > >
> > > > > there already is. Create a ".sql" file and connect to a DB. You will
> > > > > get SQL completion and syntax highlighting.
> > > > >
> > > > > It is currently tied to a connected DB, but it could be improved. An
> > > > > issue is already filed for this:
> > > > >
> > > > > https://issues.apache.org/jira/browse/NETBEANS-189
> > > > >
> > > > > Greetings
> > > > >
> > > > > Matthias
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> > > > > For additional commands, e-mail: dev-h...@netbeans.apache.org
> > > > >
> > > > > For further information about the NetBeans mailing lists, visit:
> > > > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > http://timboudreau.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> > > For additional commands, e-mail: dev-h...@netbeans.apache.org
> > >
> > > For further information about the NetBeans mailing lists, visit:
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > >
> > >
> > >
> > >
> > >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Reply via email to