diff options
author | kylo252 <[email protected]> | 2022-04-14 20:47:22 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-04-14 23:17:22 +0430 |
commit | 198577aa756acdbbacc81e3953bc7e790277a8e6 (patch) | |
tree | ebee970befa766a25a154b9f0620f9d258dee728 /lua/lvim/lsp/templates.lua | |
parent | 332e974b53d8053a7102f669141cdc054d3f20d5 (diff) |
refactor(lsp): cleanup servers' override configuration (#2243)
* refactor(lsp): cleanup override settings
- rename lsp.override to lsp.automatic_configuration.ignored_servers
- add lsp.automatic_configuration.ignored_filetypes
* chore(info): update override section
* refactor(lsp): rename ignored to skipped
* fix: better deprecation handling
* docs(lsp): add example for (un-)skipping servers
* refactor(lsp): allow installing overridden servers
* docs(lsp): update config_win.example.lua as well
* chore(lsp): update skipped_servers list
* fix(logger): less noise from client_is_configured
Diffstat (limited to 'lua/lvim/lsp/templates.lua')
-rw-r--r-- | lua/lvim/lsp/templates.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lua/lvim/lsp/templates.lua b/lua/lvim/lsp/templates.lua index eb05615e..38e68fb6 100644 --- a/lua/lvim/lsp/templates.lua +++ b/lua/lvim/lsp/templates.lua @@ -15,16 +15,22 @@ function M.remove_template_files() end end +local skipped_filetypes = lvim.lsp.automatic_configuration.skipped_filetypes +local skipped_servers = lvim.lsp.automatic_configuration.skipped_servers + ---Generates an ftplugin file based on the server_name in the selected directory ---@param server_name string name of a valid language server, e.g. pyright, gopls, tsserver, etc. ---@param dir string the full path to the desired directory function M.generate_ftplugin(server_name, dir) - if vim.tbl_contains(lvim.lsp.override, server_name) then + if vim.tbl_contains(skipped_servers, server_name) then return end - -- we need to go through lspconfig to get the corresponding filetypes currently - local filetypes = lvim_lsp_utils.get_supported_filetypes(server_name) or {} + -- get the supported filetypes and remove any ignored ones + local filetypes = vim.tbl_filter(function(ft) + return not vim.tbl_contains(skipped_filetypes, ft) + end, lvim_lsp_utils.get_supported_filetypes(server_name) or {}) + if not filetypes then return end |