11

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:\git\leetcode>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:\users\johan\anaconda3\envs\adventofcode\lib\site-packages
Requires: ipykernel, qtconsole, nbconvert, jupyter-console, notebook, ipywidgets
Required-by:

Python version:

(adventofcode) C:\git\leetcode>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)

3 Answers 3

6

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I created the question here first but realized that the best place would be on the vscode-jupyter github page. Thanks for answering.
4

I am able to rename variables in one cell by:

  1. Select the variable
  2. Right click and choose "Change All Occurrences"
  3. Change the variable name

2 Comments

This only works in a single cell
That's helpful. BUT be aware that it includes commented out code.
-3

Ctrl + F2 ~ Change All Occurrences

1 Comment

doens't work for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.