F2 rename variable doesn't work in vscode + jupyter notebook + python
Question:
I can use the normal F2 rename variable functionality in regular python files in vscode. But not when editing python in a jupyter notebook.
When I press F2 on a variable in a jupyter notebook in vscode I get the familiar change variable window but when I press enter the variable is not changed and I get this error message:
No result. No result.
Is there a way to get the F2 change variable functionality to work in jupyter notebooks?
Here’s my system info:
jupyter module version
(adventofcode) C:gitleetcode>pip show jupyter
Name: jupyter
Version: 1.0.0
Summary: Jupyter metapackage. Install all the Jupyter components in one go.
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: [email protected]
License: BSD
Location: c:usersjohananaconda3envsadventofcodelibsite-packages
Requires: ipykernel, qtconsole, nbconvert, jupyter-console, notebook, ipywidgets
Required-by:
Python version:
(adventofcode) C:gitleetcode>python --version
Python 3.10.0
vscode version:
1.63.2 (user setup)
vscode Jupyter extension version (from the changelog in the extensions window):
2021.11.100 (November Release on 8 December 2021)
Answers:
Notice that you put up a bug report in GitHub and see this issue: Renaming variables didn’t work, the programmer replied:
Some language features are currently not supported in notebooks, but
we are making plans now to hopefully bring more of those online soon.
So please wait for this feature.
I am able to rename variables in one cell by:
- Select the variable
- Right click and choose "Change All Occurrences"
- Change the variable name
Ctrl + F2 ~ Change All Occurrences
I can use the normal F2 rename variable functionality in regular python files in vscode. But not when editing python in a jupyter notebook.
When I press F2 on a variable in a jupyter notebook in vscode I get the familiar change variable window but when I press enter the variable is not changed and I get this error message:
No result. No result.
Is there a way to get the F2 change variable functionality to work in jupyter notebooks?
Here’s my system info:
jupyter module version
(adventofcode) C:gitleetcode>pip show jupyter
Name: jupyter
Version: 1.0.0
Summary: Jupyter metapackage. Install all the Jupyter components in one go.
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: [email protected]
License: BSD
Location: c:usersjohananaconda3envsadventofcodelibsite-packages
Requires: ipykernel, qtconsole, nbconvert, jupyter-console, notebook, ipywidgets
Required-by:
Python version:
(adventofcode) C:gitleetcode>python --version
Python 3.10.0
vscode version:
1.63.2 (user setup)
vscode Jupyter extension version (from the changelog in the extensions window):
2021.11.100 (November Release on 8 December 2021)
Notice that you put up a bug report in GitHub and see this issue: Renaming variables didn’t work, the programmer replied:
Some language features are currently not supported in notebooks, but
we are making plans now to hopefully bring more of those online soon.
So please wait for this feature.
I am able to rename variables in one cell by:
- Select the variable
- Right click and choose "Change All Occurrences"
- Change the variable name
Ctrl + F2 ~ Change All Occurrences