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 <[email protected]> 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 <[email protected]>
> 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: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> > 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: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists