You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Brain Rebooting <si...@gmail.com> on 2020/03/30 15:04:22 UTC

Auto completion support for Database languages.

Dear Apache Netbeans,

Is there any possibility that Netbeans will support autocompletion for
database language like IntelliJ Idea in the near future?

Also, I'm pretty much satisfied with the normal autocompletion speed and
quality for java in Netbeans. It feels that autocompletion quality has been
increased compared to earlier versions.

I'm thinking about if Netbeans somehow attach autocompletion support for
database languages, then it will be a wow moment for most of the developer
and also there wouldn't be any reason for any developer to run IntelliJ
Idea.

Take my greetings.

Samiul Alom Sium
Associate of Science in computer science student at
University of the people, California, USA

AW: Re: Auto completion support for Database languages.

Posted by Christian Lenz <ch...@gmx.net>.
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 <eb...@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
> Ebresie@gmail.com
> > On March 31, 2020 at 5:48:17 AM CDT, Pete Whelpton <pe...@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, <ch...@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 <ni...@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 <
> > > mblaesing@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-unsubscribe@netbeans.apache.org
> > > > > For additional commands, e-mail: dev-help@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-unsubscribe@netbeans.apache.org
> > > For additional commands, e-mail: dev-help@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-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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





Re: Re: Auto completion support for Database languages.

Posted by Pete Whelpton <pe...@gmail.com>.
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 <eb...@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
> Ebresie@gmail.com
> > On March 31, 2020 at 5:48:17 AM CDT, Pete Whelpton <pe...@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, <ch...@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 <ni...@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 <
> > > mblaesing@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-unsubscribe@netbeans.apache.org
> > > > > For additional commands, e-mail: dev-help@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-unsubscribe@netbeans.apache.org
> > > For additional commands, e-mail: dev-help@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-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: Re: Auto completion support for Database languages.

Posted by Eric Bresie <eb...@gmail.com>.
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
Ebresie@gmail.com
> On March 31, 2020 at 5:48:17 AM CDT, Pete Whelpton <pe...@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, <ch...@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 <ni...@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 <
> > mblaesing@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-unsubscribe@netbeans.apache.org
> > > > For additional commands, e-mail: dev-help@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-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
> >

AW: Auto completion support for Database languages.

Posted by Christian Lenz <ch...@gmx.net>.
To 1: With Auto-popup you mean the Code completion Right? Yes there should be an Option to Change this. Atm every supported language has this Option (Code completion on ‚.‘ or whenever it is possible)

To 2: Yes, I don’t know whether the warning is in the Bottom of the statusbar, but I don’t think so. For me I would switch from the dialog to a notification. Then we have it in the Status bar. And if someone removes it, it can come up after a delay Maybe of 10 min to give him a hint (should be optional)

To 3: Yes Please wait…should not be used for if the Connection is lost. More the normal info like „no items available“. Don’t know the exact wording. But it should be as consistent as possible compared to the other languages.


Cheers

Chris



Von: Pete Whelpton
Gesendet: Dienstag, 31. März 2020 12:48
An: dev@netbeans.apache.org
Betreff: Re: Auto completion support for Database languages.

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, <ch...@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 <ni...@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 <
> mblaesing@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-unsubscribe@netbeans.apache.org
> > > For additional commands, e-mail: dev-help@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-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
>


Re: Auto completion support for Database languages.

Posted by Pete Whelpton <pe...@gmail.com>.
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, <ch...@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 <ni...@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 <
> mblaesing@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-unsubscribe@netbeans.apache.org
> > > For additional commands, e-mail: dev-help@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-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
>

AW: Auto completion support for Database languages.

Posted by Christian Lenz <ch...@gmx.net>.
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 <ni...@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 <mb...@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-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@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-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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





Re: Auto completion support for Database languages.

Posted by Pete Whelpton <pe...@gmail.com>.
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 <ni...@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 <mb...@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-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@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-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: Auto completion support for Database languages.

Posted by Tim Boudreau <ni...@gmail.com>.
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 <mb...@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-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
> --
http://timboudreau.com

Re: Auto completion support for Database languages.

Posted by Matthias Bläsing <mb...@doppel-helix.eu>.
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-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: Auto completion support for Database languages.

Posted by Tim Boudreau <ni...@gmail.com>.
I could coach someone through writing a plug-in too do that pretty easily,
if someone digs up an Antlr grammar for SQL (the piece-de-resistance would
be handling’s the different dialects - but basic SQL would be trivial to
implement).

-Tim

On Mon, Mar 30, 2020 at 11:04 AM Brain Rebooting <si...@gmail.com>
wrote:

> Dear Apache Netbeans,
>
> Is there any possibility that Netbeans will support autocompletion for
> database language like IntelliJ Idea in the near future?
>
> Also, I'm pretty much satisfied with the normal autocompletion speed and
> quality for java in Netbeans. It feels that autocompletion quality has been
> increased compared to earlier versions.
>
> I'm thinking about if Netbeans somehow attach autocompletion support for
> database languages, then it will be a wow moment for most of the developer
> and also there wouldn't be any reason for any developer to run IntelliJ
> Idea.
>
> Take my greetings.
>
> Samiul Alom Sium
> Associate of Science in computer science student at
> University of the people, California, USA
>
-- 
http://timboudreau.com