Open TimChild opened 3 days ago
I think I'm facing the same issue on a computer running native Linux (openSUSE Tumbleweed). I cannot save the configuration file. (pyproject.toml)
I'll look into this by the end of this week.
Thank you both for reporting the problems. It is really nice to know that something I maintain have such dedicated users. So nice, in fact, that the debugging nightmares don't seem too bad after all.
@InSyncWithFoo -- Honestly, your plugin is the last hope Intellij has of keeping me as a user of pycharm at all. Their built in type checking/inference is hopeless. It's frustrating that they don't make you're life as a plugin maintainer a little easier too!
What happened?
Pyright runs, doesn't produce any obvious errors (is there a log somewhere that I can check for more details?) but doesn't seem to be using the
pyproject.toml
settings that are picked up when runningpyright
from wsl2 terminal directly.I went down a whole rabbit whole thinking it was just a filename conversion issue related to wsl2, but I'm not sure now... @InSyncWithFoo I'm hoping that you'll just be able to spot obvious to you given your recent work here where you "overcame a nightmare".
Steps to reproduce
Repository and poetry env live in WSL2, pycharm is being run from windows. Pyright is installed in poetry env.
First thing I noticed was that packages installed in the poetry env weren't being recognized, but further testing revealed that the whole pyproject.toml settings are being ignored (i.e. setting
reportXXX = false
in[tool.pyright]
has no effect on warnings shown.Setup and things I tried: Also tried setting the
configuration file
to thepyroject.toml
or apyrightconfig.json
file but whatever I selected wouldn't save (maybe that is actually a bug?). I don't think it should be necessary though since thepyproject.toml
should have been detected automatically by pyright (as it was when running from wsl terminal).In
pyproject.toml
I don't think thelanguage server
part does anything withCommand line
mode selected (right?).Things I also tried:
LSP4IJ
mode with thewsl -e /....
and with just/home/...
and withC:\\...
(and pyright installed in windows), but either it would fail starting up, or I would get an error related to path starting with//
(which I think came from running pyright from cmd/powershell, and the filenames being passed as//wsl.localhost/...
)Native LSP client
mode with the different options above -- Seemed to ignore the settings, but errored becausezsh:1: command not found: C:\Users\...\pyright-langserver.exe
andCommand line: C:\Users\...\pyright-langserver.exe --stdio\nStdIO connection closed\nExit code: 127
Tried these things before I realised the pyproject.toml was not being used at all...
venvPath
-- tried starting with//wsl.localhost/Ubuntu/home/....
,//wsl$/Ubuntu/home/...
extraPaths
-- with path to thesite-packages
directly (similar path styles to above)All in vain...
Seems like the Native LSP client mode could work given than the first command tried to run from
zsh
, if only I could point that to the pyright in wsl instead of the windows path, but I couldn't figure out where to configure that.Or is there a better solution I am missing altogether?
System: Win 11 PyCharm 2024.3 (Professional Edition) Build #PY-243.21565.199, built on November 12, 2024 pyright 1.1.389 (both in windows and poetry env)
Sorry to bring up PyCharm/WSL nightmare stuff again!
Relevant log output or stack trace
Operating system
Windows