aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-07-03 14:45:08 -0700
committerMichael Lingelbach <m.j.lbach@gmail.com>2021-07-03 15:49:27 -0700
commitec11b85df73cce4edb2925cb7f1d0e8db3a07b1c (patch)
tree77d533dc9606ca7e9b30d1a96baebf3de325d2a8 /lua/lspconfig.lua
parent[docgen] Update CONFIG.md (diff)
downloadnvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.gz
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.bz2
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.lz
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.xz
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.zst
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.zip
ci: lint and format with stylua
Diffstat (limited to 'lua/lspconfig.lua')
-rw-r--r--lua/lspconfig.lua50
1 files changed, 25 insertions, 25 deletions
diff --git a/lua/lspconfig.lua b/lua/lspconfig.lua
index 798f6234..7d6ae4cf 100644
--- a/lua/lspconfig.lua
+++ b/lua/lspconfig.lua
@@ -1,7 +1,7 @@
-local configs = require 'lspconfig/configs'
+local configs = require "lspconfig/configs"
local M = {
- util = require 'lspconfig/util';
+ util = require "lspconfig/util",
}
local script_path = M.util.script_path()
@@ -18,31 +18,31 @@ function M._root._setup()
M._root.commands = {
LspInfo = {
function()
- require('lspconfig/lspinfo')()
- end;
- "-nargs=0";
- description = '`:LspInfo` Displays attached, active, and configured language servers';
- };
+ require "lspconfig/lspinfo"()
+ end,
+ "-nargs=0",
+ description = "`:LspInfo` Displays attached, active, and configured language servers",
+ },
LspStart = {
function(server_name)
if server_name then
- require('lspconfig')[server_name].autostart()
+ require("lspconfig")[server_name].autostart()
else
local buffer_filetype = vim.bo.filetype
for client_name, config in pairs(configs) do
if config.filetypes then
for _, filetype_match in ipairs(config.filetypes) do
if buffer_filetype == filetype_match then
- require('lspconfig')[client_name].autostart()
+ require("lspconfig")[client_name].autostart()
end
end
end
end
end
- end;
- "-nargs=? -complete=custom,v:lua.lsp_complete_configured_servers";
- description = '`:LspStart` Manually launches a language server.';
- };
+ end,
+ "-nargs=? -complete=custom,v:lua.lsp_complete_configured_servers",
+ description = "`:LspStart` Manually launches a language server.",
+ },
LspStop = {
function(client_id)
if not client_id then
@@ -53,10 +53,10 @@ function M._root._setup()
client.stop()
end
end
- end;
- "-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids";
- description = '`:LspStop` Manually stops the given language client.';
- };
+ end,
+ "-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids",
+ description = "`:LspStop` Manually stops the given language client.",
+ },
LspRestart = {
function(client_id)
local clients
@@ -64,21 +64,21 @@ function M._root._setup()
if client_id == nil then
clients = vim.lsp.buf_get_clients(0)
else
- clients = {vim.lsp.get_client_by_id(tonumber(client_id))}
+ clients = { vim.lsp.get_client_by_id(tonumber(client_id)) }
end
for _, client in ipairs(clients) do
local client_name = client.name
client.stop()
vim.defer_fn(function()
- require('lspconfig')[client_name].autostart()
+ require("lspconfig")[client_name].autostart()
end, 500)
end
- end;
- "-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids";
- description = '`:LspRestart` Manually restart the given language client.';
- };
- };
+ end,
+ "-nargs=? -complete=customlist,v:lua.lsp_get_active_client_ids",
+ description = "`:LspRestart` Manually restart the given language client.",
+ },
+ }
M.util.create_module_commands("_root", M._root.commands)
end
@@ -88,7 +88,7 @@ function mt:__index(k)
if configs[k] == nil then
-- dofile is used here as a performance hack to increase the speed of calls to setup({})
-- dofile does not cache module lookups, and requires the absolute path to the target file
- pcall(dofile, script_path .. 'lspconfig/' .. k .. ".lua")
+ pcall(dofile, script_path .. "lspconfig/" .. k .. ".lua")
end
return configs[k]
end