From cee582063d577ba96597fa55731cb36e5e05f0ac Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 11 Apr 2023 16:56:21 -0400 Subject: [PATCH] switching from sqls to sqlls since sqls is now deprecated --- README.md | 8 +++---- doc/navigator.txt | 8 +++---- lua/navigator/lspclient/clients_default.lua | 23 +++++---------------- lua/navigator/lspclient/servers.lua | 2 +- 4 files changed, 14 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index f1c7539..be446d9 100644 --- a/README.md +++ b/README.md @@ -301,7 +301,7 @@ require'navigator'.setup({ -- disable: a blacklist of language that will not be formatted on save -- function: function(bufnr) return true end to enable/disable lsp format on save format_options = {async=false}, -- async: disable by default, the option used in vim.lsp.buf.format({async={true|false}, name = 'xxx'}) - disable_format_cap = {"sqls", "lua_ls", "gopls"}, -- a list of lsp disable format capacity (e.g. if you using efm or vim-codeformat etc), empty {} by default + disable_format_cap = {"sqlls", "lua_ls", "gopls"}, -- a list of lsp disable format capacity (e.g. if you using efm or vim-codeformat etc), empty {} by default -- If you using null-ls and want null-ls format your code -- you should disable all other lsp and allow only null-ls. -- disable_lsp = {'pylsd', 'sqlls'}, -- prevents navigator from setting up this list of servers. @@ -390,7 +390,7 @@ Built clients: local servers = { "angularls", "gopls", "tsserver", "flow", "bashls", "dockerls", "julials", "pylsp", "pyright", "jedi_language_server", "jdtls", "lua_ls", "vimls", "html", "jsonls", "solargraph", "cssls", - "yamlls", "clangd", "ccls", "sqls", "denols", "graphql", "dartls", "dotls", + "yamlls", "clangd", "ccls", "sqlls", "denols", "graphql", "dartls", "dotls", "kotlin_language_server", "nimls", "intelephense", "vuels", "phpactor", "omnisharp", "r_language_server", "rust_analyzer", "terraformls", "svelte", "texlab", "clojure_lsp", "elixirls", "sourcekit", "fsautocomplete", "vls", "hls" @@ -406,14 +406,14 @@ Other than above setup, additional none default setup are used for following lsp - gopls - clangd - rust_analyzer -- sqls +- sqlls - lua_ls - pyright - ccls Please check [client setup](https://github.com/ray-x/navigator.lua/blob/26012cf9c172aa788a2e53018d94b32c5c75af75/lua/navigator/lspclient/clients.lua#L98-L234) -The plugin can work with multiple LSP, e.g sqls+gopls+efm. But there are cases you may need to disable some of the +The plugin can work with multiple LSP, e.g sqlls+gopls+efm. But there are cases you may need to disable some of the servers. (Prevent loading multiple LSP for same source code.) e.g. I saw strange behaviours when I use pylsp+pyright+jedi together. If you have multiple similar LSP installed and have trouble with the plugin, please enable only one at a time. diff --git a/doc/navigator.txt b/doc/navigator.txt index 43a83db..c3a52cc 100644 --- a/doc/navigator.txt +++ b/doc/navigator.txt @@ -301,7 +301,7 @@ Nondefault configuration example: -- disable: a blacklist of language that will not be formatted on save -- function: function(bufnr) return true end to enable/disable lsp format on save - disable_format_cap = {"sqls", "lua_ls", "gopls"}, -- a list of lsp disable format capacity (e.g. if you using efm or vim-codeformat etc), empty {} by default + disable_format_cap = {"sqlls", "lua_ls", "gopls"}, -- a list of lsp disable format capacity (e.g. if you using efm or vim-codeformat etc), empty {} by default disable_lsp = {'pylsd', 'sqlls'}, -- a list of lsp server disabled for your project, e.g. denols and tsserver you may -- only want to enable one lsp server -- to disable all default config and use your own lsp setup set @@ -358,7 +358,7 @@ Built clients: local servers = { "angularls", "gopls", "tsserver", "flow", "bashls", "dockerls", "julials", "pylsp", "pyright", "jedi_language_server", "jdtls", "lua_ls", "vimls", "html", "jsonls", "solargraph", "cssls", - "yamlls", "clangd", "ccls", "sqls", "denols", "graphql", "dartls", "dotls", + "yamlls", "clangd", "ccls", "sqlls", "denols", "graphql", "dartls", "dotls", "kotlin_language_server", "nimls", "intelephense", "vuels", "phpactor", "omnisharp", "r_language_server", "rust_analyzer", "terraformls", "svelte", "texlab", "clojure_lsp", "elixirls", "sourcekit", "fsautocomplete", "vls", "hls" @@ -374,14 +374,14 @@ Other than above setup, additional none default setup are used for following lsp * gopls * clangd * rust_analyzer -* sqls +* sqlls * lua_ls * pyright * ccls Please check client setup (https://github.com/ray-x/navigator.lua/blob/26012cf9c172aa788a2e53018d94b32c5c75af75/lua/navigator/lspclient/clients.lua#L98-L234) -The plugin can work with multiple LSP, e.g sqls+gopls+efm. But there are cases you may need to disable some of the +The plugin can work with multiple LSP, e.g sqlls+gopls+efm. But there are cases you may need to disable some of the servers. (Prevent loading multiple LSP for same source code.) e.g. I saw strange behaviours when I use pylsp+pyright+jedi together. If you have multiple similar LSP installed and have trouble with the plugin, please enable only one at a time. diff --git a/lua/navigator/lspclient/clients_default.lua b/lua/navigator/lspclient/clients_default.lua index 054c93c..a47729b 100644 --- a/lua/navigator/lspclient/clients_default.lua +++ b/lua/navigator/lspclient/clients_default.lua @@ -144,25 +144,12 @@ M.defaults = function() }, flags = { allow_incremental_sync = true, debounce_text_changes = 500 }, }, - sqls = { - filetypes = { 'sql' }, - on_attach = function(client, _) - client.server_capabilities.executeCommandProvider = client.server_capabilities.documentFormattingProvider - or true - highlight.diagnositc_config_sign() - require('sqls').setup({ picker = 'telescope' }) -- or default - end, + sqlls = { + cmd = { 'sql-language-server', 'up', '--method', 'stdio' }, + filetypes = { 'sql', 'mysql' }, + root_dir = util.root_pattern('.sqllsrc.json'), + on_attach = on_attach, flags = { allow_incremental_sync = true, debounce_text_changes = 500 }, - settings = { - cmd = { 'sqls', '-config', '$HOME/.config/sqls/config.yml' }, - -- alterantively: - -- connections = { - -- { - -- driver = 'postgresql', - -- datasourcename = 'host=127.0.0.1 port=5432 user=postgres password=password dbname=user_db sslmode=disable', - -- }, - -- }, - }, }, pyright = { diff --git a/lua/navigator/lspclient/servers.lua b/lua/navigator/lspclient/servers.lua index 5108aac..63b6b6c 100644 --- a/lua/navigator/lspclient/servers.lua +++ b/lua/navigator/lspclient/servers.lua @@ -19,7 +19,7 @@ return { 'yamlls', 'clangd', 'ccls', - 'sqls', + 'sqlls', 'denols', 'graphql', 'dartls',