diff options
| author | Ranjith Hegde <ranjithshegde@gmail.com> | 2022-08-23 16:03:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-23 07:03:20 -0700 |
| commit | fe7a6f41e59654db6bbc9eb2d084decc54b295e4 (patch) | |
| tree | c7967bb5b649ad7f8f00c697bedc2f60db9e507a /lua/lspconfig.lua | |
| parent | Revert "docs: vim.lsp.buf.formatting() is deprecated #2077 (diff) | |
| download | nvim-lspconfig-fe7a6f41e59654db6bbc9eb2d084decc54b295e4.tar nvim-lspconfig-fe7a6f41e59654db6bbc9eb2d084decc54b295e4.tar.gz nvim-lspconfig-fe7a6f41e59654db6bbc9eb2d084decc54b295e4.tar.bz2 nvim-lspconfig-fe7a6f41e59654db6bbc9eb2d084decc54b295e4.tar.lz nvim-lspconfig-fe7a6f41e59654db6bbc9eb2d084decc54b295e4.tar.xz nvim-lspconfig-fe7a6f41e59654db6bbc9eb2d084decc54b295e4.tar.zst nvim-lspconfig-fe7a6f41e59654db6bbc9eb2d084decc54b295e4.zip | |
feat!: 0.7 API update (#1984)
* switch to lua api for autocommands
* switch to nvim_create_user_command
* move to lua plugin initialization
NOTICE: Defining commands in server configurations will be deprecated in
future releases.
See `:help lspconfig.txt` to setup the same in an `on_attach` function.
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Diffstat (limited to 'lua/lspconfig.lua')
| -rw-r--r-- | lua/lspconfig.lua | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/lua/lspconfig.lua b/lua/lspconfig.lua index b46ef65d..1178202e 100644 --- a/lua/lspconfig.lua +++ b/lua/lspconfig.lua @@ -4,82 +4,6 @@ local M = { util = require 'lspconfig.util', } -M._root = {} - -function M.available_servers() - local servers = {} - for server, config in pairs(configs) do - if config.manager ~= nil then - table.insert(servers, server) - end - end - return servers -end - --- Called from plugin/lspconfig.vim because it requires knowing that the last --- script in scriptnames to be executed is lspconfig. -function M._root._setup() - M._root.commands = { - LspInfo = { - function() - require 'lspconfig.ui.lspinfo'() - end, - '-nargs=0', - description = '`:LspInfo` Displays attached, active, and configured language servers', - }, - LspLog = { - function() - vim.cmd(string.format('tabnew %s', vim.lsp.get_log_path())) - end, - '-nargs=0', - description = '`:LspLog` Opens the Nvim LSP client log.', - }, - LspStart = { - function(server_name) - if server_name then - if configs[server_name] then - configs[server_name].launch() - end - else - local buffer_filetype = vim.bo.filetype - for _, config in pairs(configs) do - for _, filetype_match in ipairs(config.filetypes or {}) do - if buffer_filetype == filetype_match then - config.launch() - end - end - end - end - end, - '-nargs=? -complete=custom,v:lua.lsp_complete_configured_servers', - description = '`:LspStart` Manually launches a language server.', - }, - LspStop = { - function(cmd_args) - for _, client in ipairs(M.util.get_clients_from_cmd_args(cmd_args)) do - client.stop() - end - end, - '-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids', - description = '`:LspStop` Manually stops the given language client(s).', - }, - LspRestart = { - function(cmd_args) - for _, client in ipairs(M.util.get_clients_from_cmd_args(cmd_args)) do - client.stop() - vim.defer_fn(function() - configs[client.name].launch() - end, 500) - end - end, - '-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids', - description = '`:LspRestart` Manually restart the given language client(s).', - }, - } - - M.util.create_module_commands('_root', M._root.commands) -end - local mt = {} function mt:__index(k) if configs[k] == nil then |
