microsoft / vscode

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

Find and Replace in Jupyter Notebooks #198434

Open shane-nichols opened 7 months ago

shane-nichols commented 7 months ago

Type: Bug

The standard behavior of find and replace (ctrl+F dialog) is to begin repalcement at the current cursor position, and within the active cell in the case of ipynb. In a VSC ipynb, replacement is always from the beginning of the file, i.e., first occurrence within the first cell containing a match.

VS Code version: Code 1.84.1 (2b35e1e6d88f1ce073683991d1eff5284a32690f, 2023-11-06T12:35:59.022Z) OS version: Windows_NT x64 10.0.19044 Modes:

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12800H (20 x 1805)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.69GB (15.26GB free)| |Process Argv|--crash-reporter-id e0a5712c-8da0-4aa3-997c-48f7702bae8f| |Screen Reader|no| |VM|0%|
Extensions (22) Extension|Author (truncated)|Version ---|---|--- vsc-python-indent|Kev|1.18.0 vscode-clangd|llv|0.1.24 black-formatter|ms-|2023.6.0 isort|ms-|2023.10.1 python|ms-|2023.20.0 vscode-pylance|ms-|2023.11.10 jupyter|ms-|2023.10.1003070148 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 remote-containers|ms-|0.321.0 remote-ssh|ms-|0.107.0 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.81.8 vscode-remote-extensionpack|ms-|0.24.0 remote-explorer|ms-|0.4.1 remote-server|ms-|1.5.0 even-better-toml|tam|0.19.2 cmake|twx|0.0.17 jinja|who|0.0.8 vscode-proto3|zxh|0.5.5
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263cf:30880073 vscaat:30438848 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyonecf:30548226 2e4cg342:30602488 f6dab269:30613381 showlangstatbar:30737416 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 synctok:30869157 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30871694 pythonregdiag2cf:30871583 pyreplss2:30879913 pythonmypyd1:30879173 pythoncet00cf:30874137 pythontbext0:30879054 dsvsc017cf:30880893 aa_t_chat:30882232 ```
VSCodeTriageBot commented 7 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.84.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

shane-nichols commented 7 months ago

This bug is worse than I first realized. Even if I manually increment the matches to the desired starting point, after clicking "Replace", the selection snaps back to the first match in the notebook. So find and replace is practically useless.