Skip to content
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

rope: correctly handle null value for ropeFolder config #604

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

Conversation

osiewicz
Copy link

@osiewicz osiewicz commented Dec 1, 2024

In Zed we've tweaked defaults of pylsp for rope as we do not want it to create any files in users projects by default; we've happily passed null as an initialization option for ropeFolder only to find out that it is not handled correctly by plugin shim on pylsp side.

The faulty logic lies in the fact that dict.get returns None by default when a value is not present in dictionary, whereas it is also a valid user-provided value. Thus, when we check whether there's an user-supplied ropeFolder, we end up falling back to ropes default when said user provided value is null.

This PR fixes this issue by explicitly checking whether there's an user-provided ropeFolder and using that (regardless of it's value) if it's set.

In Zed we've tweaked defaults of pylsp for rope as we do not want it to create any files in users projects by default; we've happily passed null as an initialization option for ropeFolder only to find out that it is not handled correctly by plugin shim on pylsp side.

The faulty logic lies in the fact that dict.get returns None by default when a value is not present in dictionary, whereas it is also a valid user-provided value. Thus, when we check whether there's an user-supplied ropeFolder, we end up falling back to ropes default when said user provided value is null.
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.

1 participant