aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorTyler Fox <tbttfox@gmail.com>2021-11-11 12:48:01 -0800
committerGitHub <noreply@github.com>2021-11-11 21:48:01 +0100
commit35d4b08d60c17b79f8e16e9e66f0d7693c99d612 (patch)
treea726d71a445e5399c3b61b4580aaeed1dce036e0 /lua
parentfsautocomplete: don't use shell as an intermediary (#258) (diff)
downloadmason-35d4b08d60c17b79f8e16e9e66f0d7693c99d612.tar
mason-35d4b08d60c17b79f8e16e9e66f0d7693c99d612.tar.gz
mason-35d4b08d60c17b79f8e16e9e66f0d7693c99d612.tar.bz2
mason-35d4b08d60c17b79f8e16e9e66f0d7693c99d612.tar.lz
mason-35d4b08d60c17b79f8e16e9e66f0d7693c99d612.tar.xz
mason-35d4b08d60c17b79f8e16e9e66f0d7693c99d612.tar.zst
mason-35d4b08d60c17b79f8e16e9e66f0d7693c99d612.zip
installers/pip3: prioritize g:python3_host_prog if defined
Co-authored-by: William Boman <william@redwill.se>
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/installers/pip3.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/lua/nvim-lsp-installer/installers/pip3.lua b/lua/nvim-lsp-installer/installers/pip3.lua
index c8586eb3..b0eb4611 100644
--- a/lua/nvim-lsp-installer/installers/pip3.lua
+++ b/lua/nvim-lsp-installer/installers/pip3.lua
@@ -6,6 +6,7 @@ local platform = require "nvim-lsp-installer.platform"
local process = require "nvim-lsp-installer.process"
local settings = require "nvim-lsp-installer.settings"
local context = require "nvim-lsp-installer.installers.context"
+local log = require "nvim-lsp-installer.log"
local M = {}
@@ -48,9 +49,18 @@ end
function M.packages(packages)
local py3 = create_installer("python3", packages)
local py = create_installer("python", packages)
+ -- see https://github.com/williamboman/nvim-lsp-installer/issues/128
+ local installer_variants = platform.is_win and { py, py3 } or { py3, py }
+
+ local py3_host_prog = vim.g.python3_host_prog
+ if py3_host_prog then
+ log.fmt_debug("Found python3_host_prog (%s)", py3_host_prog)
+ table.insert(installer_variants, 1, create_installer(py3_host_prog, packages))
+ end
+
return installers.pipe {
context.promote_install_dir(),
- installers.first_successful(platform.is_win and { py, py3 } or { py3, py }), -- see https://github.com/williamboman/nvim-lsp-installer/issues/128
+ installers.first_successful(installer_variants),
}
end