Description
A user must set pylsp.rope.ropeFolder
to null
if they do not want to create a .ropeproject
directory. However, this is not possible in Neovim because Lua 5.1, which is used for setting up LSPs in Neovim, does not allow nil
values to be stored in tables. This issue can also arise in TOML, which lacks support for null values.
I have come up with two solutions.
-
Pass
ropefolder=None
to the constructor ofProject
on line 83 below.python-lsp-server/pylsp/workspace.py
Lines 80 to 83 in cc6d398
This method changes the default behavior when
pylsp.rope.ropeFolder
is unspecified. That is, the.ropeproject
directory will no longer be created by default, and if you wish to create it with the old default value, pass".ropeproject"
to thepylsp.rope.ropeFolder
. -
Create a new configuration key, e.g.
pylsp.rope.disableRopeFolder
.
If its value istrue
, the.ropeproject
directory will no longer be created. Most file formats that are used for LSP configuration (including Lua and TOML) should support boolean values, so this should work.