AckslD / swenv.nvim

Tiny plugin to quickly switch python virtual environments from within neovim without restarting.
206 stars 29 forks source link

Issues with pyright #4

Closed julkip closed 1 year ago

julkip commented 1 year ago

I have run into some issues using pyright (with nvim-lsp) in combination with swenv.nvim. When I use swenv to switch my venv I see that the correct venv is running in lualine and my toggleterm is also using the correct venv. But code checking or completion with lsp does not work. Doing :LspRestart does not help.

When I source cd into my project folder, source the venv by hand and then start nvim from there the lsp is working as expected.

julkip commented 1 year ago

Upon some further investigation I found a way not to solve, but to circumvent this issue. When I use pylsp instead of pyright everything works just as expected.

AckslD commented 1 year ago

Hi @julkip, hmm strange, it does work for me. What is your setup for lsp, pyright etc?

AckslD commented 1 year ago

Closing since no reply

palandovalex commented 6 months ago

i also have this problem. Pyright config.

        → pyright.disableLanguageServices              default: false
        → pyright.disableOrganizeImports               default: false
        → pyright.disableTaggedHints                   default: false
        → python.analysis.autoImportCompletions        default: true
        → python.analysis.autoSearchPaths              default: true
        → python.analysis.diagnosticMode               default: "openFilesOnly"
        → python.analysis.diagnosticSeverityOverrides
        → python.analysis.exclude                      default: []
        → python.analysis.extraPaths                   default: []
        → python.analysis.ignore                       default: []
        → python.analysis.include                      default: []
        → python.analysis.logLevel                     default: "Information"
        → python.analysis.stubPath                     default: "typings"
        → python.analysis.typeCheckingMode             default: "standard"
        → python.analysis.typeshedPaths                default: []
        → python.analysis.useLibraryCodeForTypes       default: true
        → python.pythonPath                            default: "python"
        → python.venvPath                              default: ""

pyright has stock empty config file. By the way, this problem prevented me from bringing "poetry" support to mind.

AckslD commented 6 months ago

What's your LSP config?