|
|
@ -450,26 +450,22 @@ end |
|
|
|
-- |
|
|
|
-- @param langs The list of languages in the doomrc |
|
|
|
M.install_dap_clients = function(langs) |
|
|
|
-- TODO: finish the integration, see notes below |
|
|
|
|
|
|
|
-- selene: allow(undefined_variable) |
|
|
|
if packer_plugins and packer_plugins["dap-install"] and packer_plugins["dap-install"].loaded then |
|
|
|
-- NOTE: this doesn't work as lspinstall one, we will need to find other |
|
|
|
-- way to get the installed clients in a Lua table |
|
|
|
local installed_clients = require("dap-install.tools.tool_list").list_debuggers() |
|
|
|
if packer_plugins and packer_plugins["DAPInstall.nvim"] and packer_plugins["DAPInstall.nvim"].loaded then |
|
|
|
local installed_clients = require("dap-install.api.debuggers").get_installed_debuggers() |
|
|
|
-- NOTE: not all the clients follows the 'language_dbg' standard and this |
|
|
|
-- can give some problems to us |
|
|
|
local available_clients = vim.tbl_keys(require("dap-install.debuggers_list").debuggers) |
|
|
|
-- can give some problems to us (maybe?) |
|
|
|
local available_clients = vim.tbl_keys(require("dap-install.api.debuggers").get_debuggers()) |
|
|
|
|
|
|
|
for _, lang in ipairs(langs) do |
|
|
|
local lang_str = lang |
|
|
|
lang = lang:gsub("%s+%+lsp", ""):gsub("%s+%+debug", "") |
|
|
|
|
|
|
|
-- If the +debug flag exists and the language server is not installed yet |
|
|
|
-- If the +debug flag exists and the language client is not installed yet |
|
|
|
if lang_str:find("%+debug") and (not utils.has_value(installed_clients, lang .. "_dbg")) then |
|
|
|
-- Try to install the server only if there is a server available for |
|
|
|
-- Try to install the client only if there is a client available for |
|
|
|
-- the language, oterwise raise a warning |
|
|
|
if utils.has_value(available_clients, lang) then |
|
|
|
if utils.has_value(available_clients, lang .. "_dbg") then |
|
|
|
require("dap-install.tools.tool_install").install_debugger(lang .. "_dbg") |
|
|
|
else |
|
|
|
log.warn( |
|
|
|