Skip to content

No way to disable .ropeproject directory on Lua and Neovim #622

Open
@mamekoro

Description

@mamekoro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions