-
Notifications
You must be signed in to change notification settings - Fork 225
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=Noneto the constructor ofProjecton line 83 below.python-lsp-server/pylsp/workspace.py
Lines 80 to 83 in cc6d398
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.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 istrue, 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.