microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
165k stars 29.54k forks source link

Unexpected behaviour in search and replace #200296

Open Akatmks opened 1 year ago

Akatmks commented 1 year ago

Environment data

Expected behaviour

When you are doing search and replace in a Jupyter notebook, after you have replaced an item, you should be directed to the next item found in the notebook. (I'm not sure if search and replace should be global instead of limited to a cell in the first place but that's a separate question)

Actual behaviour

You are instead directed to the first or the second item in the notebook.

Steps to reproduce:

  1. Create a cell in an empty notebook and fill it with lines of # test.
  2. Move the cursor to any line other than line 1 or line 2.
  3. Put the cursor on the word test and press Ctrl+F.
  4. Type something to replace test with and click Replace.

Demostration

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

(Second test machine) ``` Visual Studio Code (1.74.2, undefined, desktop) Jupyter Extension Version: 2022.11.1003412109. Python Extension Version: 2022.20.1. No workspace folder opened. info 17:41:25.252: ZMQ install verified. User belongs to experiment group 'jupyterTest' User belongs to experiment group 'jupyterEnhancedDataViewer' info 17:41:26.121: LSP Notebooks experiment is disabled -- not using Pylance info 17:41:26.656: Find preferred kernel for Untitled-1.ipynb with metadata {"orig_nbformat":4} & preferred interpreter c:\Users\fakeuser\AppData\Local\Programs\Python\Python310\python.exe info 17:41:26.658: Find preferred kernel for Untitled-1.ipynb with metadata {"orig_nbformat":4} & preferred interpreter c:\Users\fakeuser\AppData\Local\Programs\Python\Python310\python.exe info 17:41:26.755: Find preferred kernel for Untitled-1.ipynb with metadata {"orig_nbformat":4} & preferred interpreter c:\Users\fakeuser\AppData\Local\Programs\Python\Python310\python.exe info 17:41:26.979: Got empty env vars with python c:\Users\fakeuser\AppData\Local\Programs\Python\Python310\python.exe in 257ms info 17:41:26.990: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe -m pip list > ~\AppData\Local\Programs\Python\Python310\python.exe -m pip list error 17:41:27.583: Live Notebook not available for Untitled-1.ipynb error 17:41:27.672: Live Notebook not available for Untitled-1.ipynb info 17:41:27.767: Preferred kernel .jvsc74a57bd0e59c0217e8c720443bc896acebb829783a61c427ceaf2efbd70f6a734520b4ac.c:\Users\fakeuser\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\fakeuser\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher is exact match or top match for non python kernels, (true, [object Object], false, undefined) info 17:41:27.770: PreferredConnection: .jvsc74a57bd0e59c0217e8c720443bc896acebb829783a61c427ceaf2efbd70f6a734520b4ac.c:\Users\fakeuser\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\fakeuser\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher found for NotebookDocument: Untitled-1.ipynb error 17:41:27.786: Live Notebook not available for Untitled-1.ipynb error 17:41:27.859: Live Notebook not available for Untitled-1.ipynb ```

vscodenpa commented 12 months ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.85.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!