diff options
| author | Matthieu Coudron <teto@users.noreply.github.com> | 2021-08-06 17:41:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-06 11:41:29 -0400 |
| commit | c7ef8b9cf448173520953e8c4f311a376a5f5bd9 (patch) | |
| tree | e867ea6015c298fdefb0f4ea235381d1567ea6b9 /lua/lspconfig | |
| parent | docs: improve consistency of example configuration (#1063) (diff) | |
| download | nvim-lspconfig-c7ef8b9cf448173520953e8c4f311a376a5f5bd9.tar nvim-lspconfig-c7ef8b9cf448173520953e8c4f311a376a5f5bd9.tar.gz nvim-lspconfig-c7ef8b9cf448173520953e8c4f311a376a5f5bd9.tar.bz2 nvim-lspconfig-c7ef8b9cf448173520953e8c4f311a376a5f5bd9.tar.lz nvim-lspconfig-c7ef8b9cf448173520953e8c4f311a376a5f5bd9.tar.xz nvim-lspconfig-c7ef8b9cf448173520953e8c4f311a376a5f5bd9.tar.zst nvim-lspconfig-c7ef8b9cf448173520953e8c4f311a376a5f5bd9.zip | |
feat(lspinfo): display autostart status (#964)
Diffstat (limited to 'lua/lspconfig')
| -rw-r--r-- | lua/lspconfig/configs.lua | 1 | ||||
| -rw-r--r-- | lua/lspconfig/lspinfo.lua | 9 | ||||
| -rw-r--r-- | lua/lspconfig/util.lua | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/lua/lspconfig/configs.lua b/lua/lspconfig/configs.lua index 78377eac..07f940f9 100644 --- a/lua/lspconfig/configs.lua +++ b/lua/lspconfig/configs.lua @@ -92,6 +92,7 @@ function configs.__newindex(t, config_name, config_def) M.filetypes = config.filetypes M.handlers = config.handlers M.cmd = config.cmd + M._autostart = config.autostart -- In the case of a reload, close existing things. local reload = false diff --git a/lua/lspconfig/lspinfo.lua b/lua/lspconfig/lspinfo.lua index d12a9859..6cc13aea 100644 --- a/lua/lspconfig/lspinfo.lua +++ b/lua/lspconfig/lspinfo.lua @@ -47,6 +47,13 @@ return function() return cmd end + local function autostart_to_str(autostart) + local autostart_status = 'True' + if autostart == false then + autostart_status = 'Disabled' + end + return autostart_status + end local indent = ' ' local function make_client_info(client) local lines = { @@ -62,6 +69,7 @@ return function() indent .. '\troot: ' .. client.workspaceFolders[1].name, indent .. '\tfiletypes: ' .. table.concat(client.config.filetypes or {}, ', '), indent .. '\tcmd: ' .. remove_newlines(client.config.cmd), + indent .. '\tautostart: ' .. autostart_to_str(client._autostart), } if client.config.lspinfo then local server_specific_info = client.config.lspinfo(client.config) @@ -116,6 +124,7 @@ return function() indent .. '\tcmd: ' .. cmd, indent .. '\tcmd is executable: ' .. cmd_is_executable, indent .. '\tidentified root: ' .. (config.get_root_dir(buffer_dir) or 'None'), + indent .. '\tautostart: ' .. autostart_to_str(config._autostart), indent .. '\tcustom handlers: ' .. table.concat(vim.tbl_keys(config.handlers), ', '), } vim.list_extend(buf_lines, matching_config_info) diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 07b2afc4..8d60dc12 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -13,6 +13,7 @@ M.default_config = { settings = vim.empty_dict(), init_options = vim.empty_dict(), handlers = {}, + autostart = true, } -- global on_setup hook |
