From abe6c99c7489de2c317869cf5dea57a9595a0cca Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 26 Nov 2022 15:24:03 +0800 Subject: perf: use alias api variable (#2260) --- plugin/lspconfig.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugin') 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.', }) -- cgit v1.2.3-70-g09d2