diff options
| author | Raphael <glepnir@neovim.pro> | 2022-11-26 15:24:03 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-26 15:24:03 +0800 |
| commit | abe6c99c7489de2c317869cf5dea57a9595a0cca (patch) | |
| tree | 69df9aa0e69f35ba7d02605fa7e7dfe220cf0c99 /plugin | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-abe6c99c7489de2c317869cf5dea57a9595a0cca.tar nvim-lspconfig-abe6c99c7489de2c317869cf5dea57a9595a0cca.tar.gz nvim-lspconfig-abe6c99c7489de2c317869cf5dea57a9595a0cca.tar.bz2 nvim-lspconfig-abe6c99c7489de2c317869cf5dea57a9595a0cca.tar.lz nvim-lspconfig-abe6c99c7489de2c317869cf5dea57a9595a0cca.tar.xz nvim-lspconfig-abe6c99c7489de2c317869cf5dea57a9595a0cca.tar.zst nvim-lspconfig-abe6c99c7489de2c317869cf5dea57a9595a0cca.zip | |
perf: use alias api variable (#2260)
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/lspconfig.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua index 48c73fd4..0877cbd7 100644 --- a/plugin/lspconfig.lua +++ b/plugin/lspconfig.lua @@ -1,4 +1,4 @@ -local api = vim.api +local api, lsp = vim.api, vim.lsp if vim.g.lspconfig ~= nil then return @@ -40,7 +40,7 @@ end local get_clients_from_cmd_args = function(arg) local result = {} for id in (arg or ''):gmatch '(%d+)' do - result[id] = vim.lsp.get_client_by_id(tonumber(id)) + result[id] = lsp.get_client_by_id(tonumber(id)) end if vim.tbl_isempty(result) then return require('lspconfig.util').get_managed_clients() @@ -104,7 +104,7 @@ api.nvim_create_user_command('LspStop', function(info) local server_name = string.len(info.args) > 0 and info.args or nil if not server_name then - local servers_on_buffer = vim.lsp.get_active_clients { buffer = current_buf } + local servers_on_buffer = lsp.get_active_clients { buffer = current_buf } for _, client in ipairs(servers_on_buffer) do local filetypes = client.config.filetypes if filetypes and vim.tbl_contains(filetypes, vim.bo[current_buf].filetype) then @@ -123,7 +123,7 @@ end, { }) api.nvim_create_user_command('LspLog', function() - vim.cmd(string.format('tabnew %s', vim.lsp.get_log_path())) + vim.cmd(string.format('tabnew %s', lsp.get_log_path())) end, { desc = 'Opens the Nvim LSP client log.', }) |
