You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently found out that if a Pipenv environment is defined in some sub directory, Pyright would recognize it and create a workspace folder for it. For instance, with two Pipenv environments in ~/T/d1/ and ~/T/d2/, cwd at ~/T and after opening a file in each directory, the output of :CocCommand workspace.showOutput shows
Workspace: /home/user/T/d1
Using python from /usr/bin/python
[Info - ...] Pyright language server 1.1.352 starting
[Info - ...] Server root directory: file:///home/user/git/coc-pyright/node_modules/pyright/dist
[Info - ...] Starting service instance "d1"
[Info - ...] Setting pythonPath for service "d1": "/usr/bin/python"
[Info - ...] Assuming Python version 3.11
[Info - ...] Found 1 source file
[Info - ...] Starting service instance "d2"
[Info - ...] Setting pythonPath for service "d2": "/usr/bin/python"
[Info - ...] Assuming Python version 3.11
[Info - ...] Found 1 source file
Hi,
I recently found out that if a Pipenv environment is defined in some sub directory, Pyright would recognize it and create a workspace folder for it. For instance, with two Pipenv environments in
~/T/d1/
and~/T/d2/
, cwd at~/T
and after opening a file in each directory, the output of:CocCommand workspace.showOutput
showsThis got me digging and found
coc-pyright/src/middleware.ts
Line 43 in c9b271a
coc-pyright/src/configSettings.ts
Line 27 in c9b271a
and
coc-pyright/src/configSettings.ts
Line 77 in c9b271a
Their combined effect is
this.workspaceRoot
like for instance Poetry (missingcwd: ...
)The following patch changes the behavior such that Pyright uses the virtual environment corresponding to the workspace folder the current file is in.
:CocCommand workspace.showOutput
:Motivating use case: start Neovim in a directory containing multiple projects. With this patch, Pyright behaves correctly in each.
What's the output of
:CocCommand pyright.version
[coc.nvim] coc-pyright 1.1.351 with Pyright 1.1.352
What's the output of
:CocCommand workspace.showOutput Pyright
see above
The text was updated successfully, but these errors were encountered: