[vim/vim] filetype(sql): builtin SQLComplete requires third party plugin ? (Issue #18716)

10 views
Skip to first unread message

gcanat

unread,
Nov 10, 2025, 1:44:26 PM (yesterday) Nov 10
to vim/vim, Subscribed
gcanat created an issue (vim/vim#18716)

Edit a sql file, start typing something, trigger omnicomplete with

vim --clean
:e some_file.sql
iSELEC<c-x><c-o>

Error message:

SQLComplete:The dbext plugin must be loaded for dynamic SQL completion

I would expect it to work without external dependency, or else that omnifunc remains empty by default.

Did I miss something ?

vim version: 9.1.1900
os: Ubuntu 24.04.3


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18716@github.com>

Christian Brabandt

unread,
Nov 10, 2025, 3:17:05 PM (yesterday) Nov 10
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18716)

That is working as documented at :h sql-completion


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18716/3513736505@github.com>

Maxim Kim

unread,
Nov 10, 2025, 3:31:30 PM (yesterday) Nov 10
to vim/vim, Subscribed
habamax left a comment (vim/vim#18716)

I would expect it to work without external dependency, or else that omnifunc remains empty by default.

I had to empty it in my config as it breaks autocomplete.

While documented it is still feels wrong, but I didn’t report it.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18716/3513783046@github.com>

gcanat

unread,
Nov 10, 2025, 4:44:39 PM (yesterday) Nov 10
to vim/vim, Subscribed
gcanat left a comment (vim/vim#18716)

Would something like this be acceptable ?

diff --git a/runtime/autoload/sqlcomplete.vim b/runtime/autoload/sqlcomplete.vim
index adbdbab89..de2327b46 100644
--- a/runtime/autoload/sqlcomplete.vim
+++ b/runtime/autoload/sqlcomplete.vim
@@ -98,7 +98,7 @@
 " Set completion with CTRL-X CTRL-O to autoloaded function.
 " This check is in place in case this script is
 " sourced directly instead of using the autoload feature.
-if exists('&omnifunc')
+if exists('&omnifunc') && exists('g:loaded_dbext')
     " Do not set the option if already set since this
     " results in an E117 warning.
     if &omnifunc == ""


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18716/3514006909@github.com>

Maxim Kim

unread,
Nov 10, 2025, 6:19:40 PM (yesterday) Nov 10
to vim/vim, Subscribed
habamax left a comment (vim/vim#18716)

Would something like this be acceptable ?

I would say yes. I personally believe that sql autocomplete should have been fully implemented within dbext plugin as it just doesn't work without it anyway.

And what is the point in the autoloaded sqlcomplete.vim if it is loaded whenever sql file is opened not when actual completion happens.

ftplugin/sql.vim

    " Source it to determine its version
    runtime autoload/sqlcomplete.vim

But again, I can nullify it in my config which I did, so it is up to @chrisbra and team to decide.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18716/3514306928@github.com>

Christian Brabandt

unread,
12:17 PM (9 hours ago) 12:17 PM
to vim/vim, Subscribed

Closed #18716 as completed via b74ec15.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/18716/issue_event/20867852500@github.com>

Reply all
Reply to author
Forward
0 new messages