Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooks - need some explanations #183

Open
IstiCusi opened this issue Oct 31, 2024 · 0 comments
Open

Hooks - need some explanations #183

IstiCusi opened this issue Oct 31, 2024 · 0 comments

Comments

@IstiCusi
Copy link

Dear cultist, I tried to register as observer to changes in the choice of the python venv -- tried the hook but this is not started. Either I missinterprete the hook or i have a bug, that I do not understand. Could you please tell me the mistake in using the plugin hooks ?

--- @param venv_path string A string containing the absolute path to selected virtualenv
--- @param venv_python string A string containing the absolute path to python binary in selected venv
local function changed_python(venv_path, venv_python)
-local file = io.open("/tmp/venv_change.log", "a") -- /tmp ist ein Beispielpfad
-- file:write("changed_python wurde aufgerufen mit " .. venv_path .. "\n")
-- file:close()
-- vim.notify("Virtuelle Umgebung geändert auf: " .. venv_path, vim.log.levels.INFO)
-- end

return {
"linux-cultist/venv-selector.nvim",
-- dependencies = {
-- "neovim/nvim-lspconfig",
-- },
branch = "regexp",
config = function()
require("venv-selector").setup({
-- auto_refresh = true,
changed_venv_hooks = { changed_python },
settings = {
find_code_venvs = {
command = "fd '^python[0-9.]$' ~/.pyenv/versions --type x --exclude '/pkgs/*'",
},
},
lsp_auto_setup = false,
})
end,
keys = Phonon.venvKeys,
-- keys = {
-- { "nv", "VenvSelect" },
-- },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant