Skip to content

Remove support for rope #10440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mjbvz opened this issue Mar 5, 2020 · 15 comments · Fixed by #16877
Closed

Remove support for rope #10440

mjbvz opened this issue Mar 5, 2020 · 15 comments · Fixed by #16877
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality partner ask verified Verification succeeded

Comments

@mjbvz
Copy link

mjbvz commented Mar 5, 2020

Environment data

Steps to reproduce:

  1. Make python file dirty
  2. Then select some code and try running extract method

Expected behavior

It extracts the method

Actual behavior

A notification appears telling me to save the file. Why do I need to save? And if saving is really required for now, why don't you just save the file for me?

This current UX makes refactoring a pain

@mjbvz mjbvz added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Mar 5, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Mar 5, 2020
@karthiknadig
Copy link
Member

@kimadeline First we need to know if they are using rope. We need to see if we can pass string to rope.

@kimadeline
Copy link

Yup, Extract Method uses rope for refactoring, and it performs these actions on resources pointing to files inside a project (in our case, the workspace folder).

👉 We can't pass strings to rope, we have to work with a file.

Suggestions:

  • save the file automatically
  • copy the code in a temp file, perform the action there, and then replace the content of the current file

@kimadeline kimadeline added feature-refactoring feature-request Request for new features or functionality important Issue identified as high-priority and removed triage bug Issue identified by VS Code Team member as probable bug labels Mar 9, 2020
@DonJayamanne
Copy link

copy the code in a temp file, perform the action there, and then replace

Considering the fact that rope has not supported Python 3 for a while, I think its time consider dropping it. However we'd need to first find out whether this is a good idea, i.e. do users use this today, does it work without any problems (I don't think so, hasn't supported 3).
@brettcannon /cc

@brettcannon
Copy link
Member

We still get bug reports for it so some people seem to be at least attempting to use it. David said he is looking at refactoring support in Jedi.

As for whether we should just yank it now or wait I don't know without chatting with @luabud about it.

@luabud luabud removed the important Issue identified as high-priority label Mar 30, 2020
@kimadeline kimadeline removed their assignment Apr 1, 2020
@brettcannon brettcannon added area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. and removed feature-refactoring labels Apr 9, 2020
@luabud luabud changed the title Don't prompt user to save files during refactoring Remove support for rope Apr 9, 2020
@gramster
Copy link
Member

gramster commented Jun 30, 2020

If people are attempting to use it, but rope doesn't work for Python 3, we should just remove it, and add this back in the future when either Jedi or the language server supports it. Can we disable the functionality as a short-term change until we remove it?

@brettcannon
Copy link
Member

@gramster it doesn't work on all_ Python 3 code, but it could work on a subset so it isn't necessarily a total failure.

As for turning it off, we could just not wire it up in the extension and then rely on LSP to light it up when MPLS v1 provides the functionality.

@mcepl
Copy link

mcepl commented Jul 5, 2021

This whole bug is based on the wrong premise: rope has been supporting Python 3 for some time already. I (the only remaining something-like-maintainer of rope, https://github.com/python-rope/rope/ ) have no idea about VSCode (so I don't know how rope is weird into it), feel free to file issues for any bugs you find.

@melMass
Copy link

melMass commented Aug 27, 2021

Well, I think this is becoming more urgent now:
python-rope/rope#360

@brettcannon
Copy link
Member

Our current plan is to remove Rope in our 2021.10 release.

@brettcannon brettcannon added this to the September 2021 milestone Sep 1, 2021
@lieryan
Copy link

lieryan commented Sep 5, 2021

Hi all, rope is getting a new maintainer (me). Is there anything we can help fix here in rope for VSCode users that wants to continue to use rope for refactoring?

Rope 0.19.0 already has support for a lot of new Python 3.x syntaxes and I'm going to continue to further improving coverage of supported syntax, fix existing bugs, as well as improving usability and ease of use and integrations.

@melMass
Copy link

melMass commented Sep 5, 2021

Hi all, rope is getting a new maintainer (me)

Good news!
I think the decision to remove rope and ctags is unfortunately acted for 2021.1 (see the just released change log)...

@brettcannon Are you planning to replace the refactoring with something else than rope? (I'm using it a lot)

@gramster
Copy link
Member

gramster commented Sep 5, 2021 via email

@brettcannon
Copy link
Member

Rope has been replaced by JediLSP (Jedi behind LSP) and/or Pylance for refactoring.

As @gramster pointed out, probably the best option for those that wish to continue to use Rope would be to create a separate extension, and I would strongly recommend putting rope behind LSP. That way other editors could also use rope directly w/o much effort.

@kimadeline kimadeline added the verified Verification succeeded label Sep 28, 2021
@kimadeline
Copy link

Testing done as part of #17540

@lieryan
Copy link

lieryan commented Nov 23, 2021

Hi all, Rope should now be be usable again in VSCode and other editors that supports LSP using pylsp-rope. You'll want to install the pylsp-rope extension and configure your VSCode to use pylsp language server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality partner ask verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants