pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

Refactoring support

Open neel04 opened this issue 7 months ago • 1 comments

Describe the Bug

Are there any plans for adding extensive refactoring support, similar to the ROPE plugin for PyLSP?

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

neel04 avatar May 26 '25 12:05 neel04

Thanks for reaching out! I've copied the features here for tracking the individual ones:

Rename:

  • [x] implemented: variables, classes, functions (disabled by default)
  • [ ] coming soon: modules, packages (disabled by default)

Code Action:

  • [ ] extract method
  • [ ] extract variable
  • [ ] inline method/variable/parameter
  • [ ] use function
  • [ ] method to method object
  • [ ] convert local variable to field
  • [ ] organize imports
  • [ ] introduce parameter
  • [ ] generate variable/function/class from undefined variable

lolpack avatar May 27 '25 12:05 lolpack

hi @neel04, we added basic rename support in 0.22.0, please try it out and let us know your thoughts!

i'll rename this issue to "complicated refactoring"

kinto0 avatar Jul 01 '25 15:07 kinto0

PyCharm refactoring features: https://www.jetbrains.com/help/pycharm/refactoring-source-code.html

  • [ ] Change signature
  • [ ] Convert to Package and Module
  • [ ] Extract/Introduce refactorings
  • [ ] Inline
  • [ ] Invert boolean
  • [ ] Copy and move refactorings
  • [ ] Pull members up, push members down
  • [ ] Rename refactorings
  • [ ] Safe delete

lolpack avatar Jul 24 '25 12:07 lolpack