jupyter-lsp / jupyterlab-lsp

Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
https://jupyterlab-lsp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.8k stars 149 forks source link

Support for the rename based on the whole project directory #1089

Open YongcaiHuang opened 4 months ago

YongcaiHuang commented 4 months ago

Elevator Pitch

Any plan for the rename based on the whole project directory including file rename (more like a refactoring feature). It's better to support both .ipynb and .py

Motivation

current rename function works within one file either .ipynb or .py. It's not that convenient when I want to rename a .py module or function/class in this module. Rather, I need to change all related reference.

Design Ideas

current IDE like vscode or pycharm has supported this. for example below video.

https://github.com/jupyter-lsp/jupyterlab-lsp/assets/97007177/4691c4b4-0ee1-4b91-bd5b-10bd9517df60

krassowski commented 4 months ago

That would be nice. I often think about it. Technically what is needed is support for workspace-wide edits and some UI. Alternatively it could be achieved by resolving https://github.com/jupyterlab-contrib/search-replace/issues/79 and using that extension.

YongcaiHuang commented 3 days ago

Additionally, other refactoring feature is missing, like extract variable or method, etc, and not very convenient when writing a project using jupyterlab. Maybe we can leverage more function in rope.

Also, Thanks for the alternative proposal of using search-replace. it's really great, but it different from refactoring feature (e.g. it cannot handle file rename and extraction, etc). BTW, search-replace cannot be used in jupyterlab-desktop (issue opened here)