-
Notifications
You must be signed in to change notification settings - Fork 13
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
Question about Project Settings and pyrightconfig.json #211
Comments
I'm not sure if you are confused about this or not but the location of the project file (which I believe you are calling "project settings" which is not entirely precise) is not really relevant. The settings in project file apply to folders defined by the That said, I don't think I fully understand your issue. Maybe it would be more clear to me if you would specify what the |
I notice a similar issue: When the root folder in Sublime does not contain the It could be solved if Above is how many other linters like |
@silverwind yours sounds more like a job of pyright rather than lsp-pyright. |
Many servers choose to limit lookup of configuration files to the root folder of the opened project. And there are often good reasons for that. For example check microsoft/pyright#1756 |
Yes, non-root config files are ultimately something for Some tools like Per-directory config files are a very useful pattern for many reasons, it's a shame some tools decide to not support it. |
This can work if configuration options apply only to the currently checked file. If some of the options are global in nature and apply to the whole project then it becomes undefined which configuration applies when. Or you end up with options that don't do anything and it's not obvious. It's just hard to support and in many cases doesn't make sense, depending on the architecture of the server. |
In case of multiple files, the nearest (e.g. more specific) config file could outweight the others. Of course, care needs to be taken in how the options are merged together (e.g. in some cases it makes sense to combine, in others to replace), but I think this is a solveable problem in general. For my use case specifically, it's not even multiple config files. I have projects in a subfolder whose parent folder is added to the Sublime's sidebar. I don't use workspaces or any of Sublime's config files at all as I want to be editor-agnostic. I'd like either LSP-pyright or pyright to find the closest config file. Currently this is only possible if I drag each individual project folder into ST, but that is cumbersome if you have hundrets of projects you switch between often. FWIW, |
My situation is a bit more unique I think, where I have a project within a project. |
Oh and nested pyrightconfigs would be great if supported - but obviously that is for pyright to sort not you guys |
Since this is something that can't be addressed by this package, there is no reason to keep it open. As for your setup, I feel that it's unnecessarily complicated. You could probably have those two projects completely separate and then add both as individual folders to the sidebar / project. And then to make Python resolve paths correctly, you could extend |
Hi!
Is it possible to use project specific settings in conjunction with pyrightconfig.json settings?
My setup is a bit convoluted:
I have a sub-project within the folder structure of my main project.
The sub-project folder structure starts from the same location as the main project as I have dependencies through out the main project that I want to be able to work with in the sub-project.
This means the pyrightconfig.json in the root of the main project defines the pyright settings for the sub-project.
To work around this, I am trying to add extraPaths to the project settings but the imports in sub-project are not being resolved unless I add them to the main project's pyrightconfig.json.
My structure is like so:
Main Project pyrightconfig.json:
And my project settings are:
Any advice would be appreciated!
The text was updated successfully, but these errors were encountered: