-
Notifications
You must be signed in to change notification settings - Fork 224
Prevent creating empty .ropeproject with null conf #664
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
base: develop
Are you sure you want to change the base?
Prevent creating empty .ropeproject with null conf #664
Conversation
Hey @karimbenbourenane, thanks for your contribution! I have a quick question for you: how is this different from #604? Also, pinging @osiewicz about this (the author of #604). What do you think about this one? |
I sketched up a quick example of playground, but I feel like that'd regress us to before #604 (where you wouldn't be able to pass in null?)? |
It's different in that, the default configuration with zed will be |
@ccordoba12 see the case where In #604 the condition passes and the |
We do want to pass in |
@osiewicz I've done some digging into this issue and while I can confirm the issue exists here in pylsp, I don't agree with the proposed reason and solution for this issue by @karimbenbourenane. As you mentioned and tested by you, it would probably regress to before #604. I did test it and it seems that when the rope_config is being accessed in _rope_project_builder it doesn't have ropeFolder key at all, only the plugins python-lsp-server/pylsp/workspace.py Line 80 in 89265cd
Tracing it back to where the settings are being updated I found that Config.settings method returns incorrect settings object. python-lsp-server/pylsp/config/config.py Lines 149 to 150 in 89265cd
To confirm this, I've logged the value using this snippet: # LSP configuration
log.debug(f"{settings=}")
log.debug(f"{self._settings=}")
settings = _utils.merge_dicts(settings, self._settings)
log.debug(f"{settings=}") giving me the following result:
I didn't investigate, as of now, why |
When
ropeFolder
is defined in the configuration but set to null (as would happen with a default config generated by e.g. Zed editing a python file), avoid creating an empty and unused.ropeproject
directory. This change completes what I think was the goal of https://github.com/python-lsp/python-lsp-server/pull/604/files, where"ropeFolder": null
in the configuration still generates an empty and unused.ropeproject
folder.