{"id":13897230,"url":"https://github.com/python-rope/pylsp-rope","last_synced_at":"2025-07-17T14:30:39.842Z","repository":{"id":46136938,"uuid":"412984324","full_name":"python-rope/pylsp-rope","owner":"python-rope","description":"Extended refactoring capabilities for python-lsp-server using Rope","archived":false,"fork":false,"pushed_at":"2024-03-20T12:37:22.000Z","size":287,"stargazers_count":97,"open_issues_count":10,"forks_count":2,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-03-25T20:27:32.283Z","etag":null,"topics":["language-server-protocol","python","refactoring-tools","rope"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-rope.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-03T05:24:19.000Z","updated_at":"2024-06-08T23:30:58.651Z","dependencies_parsed_at":"2024-03-11T06:24:18.167Z","dependency_job_id":"46835f39-d6e4-44b1-984c-33fee26473b1","html_url":"https://github.com/python-rope/pylsp-rope","commit_stats":{"total_commits":172,"total_committers":2,"mean_commits":86.0,"dds":0.005813953488372103,"last_synced_commit":"cde82b3d52d01c235ad2e3d99f137d9a678db119"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-rope%2Fpylsp-rope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-rope%2Fpylsp-rope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-rope%2Fpylsp-rope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-rope%2Fpylsp-rope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-rope","download_url":"https://codeload.github.com/python-rope/pylsp-rope/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226270400,"owners_count":17598075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["language-server-protocol","python","refactoring-tools","rope"],"created_at":"2024-08-06T18:03:26.681Z","updated_at":"2024-11-25T03:30:44.603Z","avatar_url":"https://github.com/python-rope.png","language":"Python","readme":"# pylsp-rope\n\n[![Tests](https://github.com/python-rope/pylsp-rope/actions/workflows/run-test.yml/badge.svg)](https://github.com/python-rope/pylsp-rope/actions/workflows/run-test.yml) \n[![codecov](https://codecov.io/gh/python-rope/pylsp-rope/graph/badge.svg?token=LMO7PW0AEK)](https://codecov.io/gh/python-rope/pylsp-rope)\n\nExtended refactoring capabilities for Python LSP Server using\n[Rope](https://github.com/python-rope/rope).\n\nThis is a plugin for [Python LSP\nServer](https://github.com/python-lsp/python-lsp-server), so you also need to\nhave it installed.\n\npython-lsp-server already has basic built-in support for using Rope, but it's\ncurrently limited to just renaming and completion. Installing this plugin adds\nmore refactoring functionality to python-lsp-server.\n\n## Installation\n\nTo use this plugin, you need to install this plugin in the same virtualenv as\npython-lsp-server itself.\n\n``` bash\npip install pylsp-rope\n```\n\nThen run `pylsp` as usual, the plugin will be auto-discovered by\npython-lsp-server if you've installed it to the right environment. On Vim,\nrefer to [Rope in Vim or\nNeovim](https://github.com/python-rope/rope/wiki/Rope-in-Vim-or-Neovim). For\nother editors, refer to your IDE/text editor's documentation on how to setup a\nlanguage server. \n\n## Features\n\nThis plugin adds the following features to python-lsp-server:\n\nRename: \n\n- implemented: variables, classes, functions (disabled by default)\n- coming soon: modules, packages (disabled by default)\n\nCode Action:\n\n- extract method\n- extract variable \n- inline method/variable/parameter \n- use function \n- method to method object \n- convert local variable to field \n- organize imports \n- introduce parameter \n- generate variable/function/class from undefined variable \n\nRefer to [Rope documentation](https://github.com/python-rope/rope/blob/master/docs/overview.rst)\nfor more details on how these refactoring works.\n\n## Usage\n\n### Rename\n\nWhen Rename is triggered, rename the symbol under the cursor. If the symbol\nunder the cursor points to a module/package, it will move that module/package\nfiles.\n\n### Extract method\n\nVariants: \n\n- Extract method\n- Extract global method\n- Extract method including similar statements\n- Extract global method including similar statements\n\nWhen CodeAction is triggered and the cursor is on any block of code, extract\nthat expression into a method. Optionally, similar statements can also be\nextracted.\n\n### Extract variable\n\nVariants: \n\n- Extract variable\n- Extract global variable\n- Extract variable including similar statements\n- Extract global variable including similar statements\n\nWhen CodeAction is triggered and the cursor is on a expression, extract that\nexpression into a variable. Optionally, similar statements can also be\nextracted.\n\n### Inline\n\nWhen CodeAction is triggered and the cursor is on a resolvable Python variable,\nreplace all calls to that method with the method body.\n\n### Use function\n\nWhen CodeAction is triggered and the cursor is on the function name of a `def`\nstatement, try to replace code whose AST matches the selected function with a\ncall to the function.\n\n### Method to method object\n\nWhen CodeAction is triggered and the cursor is on the function name of a `def`\nstatement, create a callable class to replace that method. You may want to\ninline the method afterwards to remove the indirection.\n\n### Convert local variable to field\n\nWhen CodeAction is triggered wand the cursor is on a local variable inside a\nmethod, convert that local variable to an attribute.\n\n### Organize import\n\nTrigger CodeAction anywhere in a Python file to organize imports.\n\n### Introduce parameter\n\nWhen CodeAction is triggered and the cursor is selecting a Python variable or\nattribute, make that variable/attribute a parameter.\n\n### Generate code\n\nVariants:\n\n- [x] Generate variable\n- [x] Generate function\n- [x] Generate class\n- [ ] Generate module\n- [ ] Generate package\n\nWhen CodeAction is triggered and the cursor is on an undefined Python\nvariable, generate an empty variable/function/class/module/package for that\nname.\n\n## Configuration\n\nYou can enable rename support using pylsp-rope with workspace config key\n`pylsp.plugins.pylsp_rope.rename`. \n\nNote that this differs from the config key `pylsp.plugins.rope_rename.enabled`\nthat is used for the rope rename implementation using the python-lsp-rope's\nbuiltin `rope_rename` plugin. To avoid confusion, avoid enabling more than one\npython-lsp-server rename plugin. In other words, you should set both\n`pylsp.plugins.rope_rename.enabled = false` and `pylsp.plugins.jedi_rename.enabled = false` \nwhen pylsp-rope rename is enabled.\n\n## Caveat\n\nSupport for working on unsaved document is currently experimental, but it should work.\n\nThis plugin is in early development, so expect some bugs. Please report in\n[Github issue tracker](https://github.com/python-lsp/python-lsp-server/issues)\nif you had any issues with the plugin.\n\n## Developing\n\nSee [CONTRIBUTING.md](https://github.com/python-rope/pylsp-rope/blob/main/CONTRIBUTING.md).\n\n## Packaging status\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/python:pylsp-rope.svg)](https://repology.org/project/python:pylsp-rope/versions)\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/python:lsp-rope.svg)](https://repology.org/project/python:lsp-rope/versions)\n\n## Credits\n\nThis package was created with\n[Cookiecutter](https://github.com/audreyr/cookiecutter) from\n[python-lsp/cookiecutter-pylsp-plugin](https://github.com/python-lsp/cookiecutter-pylsp-plugin)\nproject template.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-rope%2Fpylsp-rope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-rope%2Fpylsp-rope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-rope%2Fpylsp-rope/lists"}