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 of Project on line 83 below.
|
if "ropeFolder" in rope_config: |
|
self.__rope = Project(self._root_path, ropefolder=rope_folder) |
|
else: |
|
self.__rope = Project(self._root_path) |
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 the pylsp.rope.ropeFolder.
-
Create a new configuration key, e.g. pylsp.rope.disableRopeFolder.
If its value is true, 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.
A user must set
pylsp.rope.ropeFoldertonullif they do not want to create a.ropeprojectdirectory. However, this is not possible in Neovim because Lua 5.1, which is used for setting up LSPs in Neovim, does not allownilvalues 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=Noneto the constructor ofProjecton line 83 below.python-lsp-server/pylsp/workspace.py
Lines 80 to 83 in cc6d398
This method changes the default behavior when
pylsp.rope.ropeFolderis unspecified. That is, the.ropeprojectdirectory 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 is
true, the.ropeprojectdirectory 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.