Skip to content

Commit

Permalink
feat!: use executables on $PATH (#738)
Browse files Browse the repository at this point in the history
* fix: use commands in environment variables instead of absolute paths

* fixup! fix: use commands in environment variables instead of absolute paths

---------

Co-authored-by: Jint-lzxy <[email protected]>
  • Loading branch information
Groveer and Jint-lzxy authored May 16, 2023
1 parent 42e816b commit 1b53c90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 2 additions & 5 deletions lua/core/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,9 @@ local function load_options()
if not isempty(conda_prefix) then
vim.g.python_host_prog = conda_prefix .. "/bin/python"
vim.g.python3_host_prog = conda_prefix .. "/bin/python"
elseif global.is_mac then
vim.g.python_host_prog = "/usr/bin/python"
vim.g.python3_host_prog = "/usr/local/bin/python3"
else
vim.g.python_host_prog = "/usr/bin/python"
vim.g.python3_host_prog = "/usr/bin/python3"
vim.g.python_host_prog = "python"
vim.g.python3_host_prog = "python3"
end

for name, value in pairs(global_local) do
Expand Down
8 changes: 4 additions & 4 deletions lua/modules/configs/tool/dap/dap-debugpy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ end

dap.adapters.python = {
type = "executable",
command = "/usr/bin/python",
command = "python",
args = { "-m", "debugpy.adapter" },
}
dap.configurations.python = {
Expand All @@ -22,13 +22,13 @@ dap.configurations.python = {
if not isempty(vim.env.CONDA_PREFIX) then
return vim.env.CONDA_PREFIX .. "/bin/python"
else
return "/usr/bin/python3"
return "python3"
end
end,
},
}

-- NOTE: for people using venv
-- NOTE: This setting is for people using venv
-- pythonPath = function()
-- -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
-- -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
Expand All @@ -41,6 +41,6 @@ dap.configurations.python = {
-- elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
-- return cwd .. "/.venv/bin/python"
-- else
-- return "/usr/bin/python"
-- return "python3"
-- end
-- end,
2 changes: 1 addition & 1 deletion lua/modules/configs/tool/dap/dap-lldb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local dap = require("dap")

dap.adapters.lldb = {
type = "executable",
command = "/usr/bin/lldb-vscode",
command = "lldb-vscode",
name = "lldb",
}
dap.configurations.cpp = {
Expand Down

0 comments on commit 1b53c90

Please sign in to comment.