Skip to content

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

karimbenbourenane
Copy link

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.

@ccordoba12
Copy link
Member

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?

@osiewicz
Copy link
Contributor

osiewicz commented Jul 30, 2025

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?)?
https://www.online-python.com/Qg4WIZrYfk
I guess the bug might be in Zed and not in pylsp.

@karimbenbourenane
Copy link
Author

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?

It's different in that, the default configuration with zed will be "ropeFolder": null. In #604, this means that despite an explicitly stated null ropeFolder, it will generate an empty and unused .ropeproject directory any time the pylsp is used for example editing a python file. The change I submitted does not do that.

@karimbenbourenane
Copy link
Author

karimbenbourenane commented Jul 31, 2025

@ccordoba12 see the case where rope_config = {"ropeFolder": None}

In #604 the condition passes and the .ropeproject ends up getting generated anyway because of Project(self._root_path, ropefolder=None) being executed. In this proposed change (#664) None does not get passed as a named argument for ropeFolder when "ropeFolder" is a key in the rope_config with value set to None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants