Update handling of LS dependencies

This commit is contained in:
2023-09-05 19:34:05 +02:00
committed by GitHub
parent eb1da79e6f
commit 3d87f08761
6 changed files with 39 additions and 4 deletions
+8 -2
View File
@@ -58,9 +58,15 @@ end
--- Asserts that a python module is installed
---@param mod string: The python module to check
function M.assert_python3_module_installed(mod)
function M.python3_module_is_installed(mod)
local resp = vim.system({ "python3", "-m", "pip", "show", mod, }):wait()
if not resp.code == 0 then
return resp.code == 0
end
--- Asserts that a python module is installed
---@param mod string: The python module to check
function M.assert_python3_module_installed(mod)
if not M.python3_module_is_installed(mod) then
error("Python3 module " .. mod .. " not installed:\n" .. resp.stdout .. "\n" .. resp.stderr)
end
end