Issue
The search/replace tool in VS Code Jupyter Notebooks is different from it with other type of files. First it doesn't come with the shortcut such as alt+w for "match whole word". Second, it always start from the first occurrence in the result list instead of the current position. Third, it doesn't come with "Find in selection" option, which makes the "replace all" function almost un-useful. Why is that and is there way to fix it?
Solution
Things are different because the implementation is not exactly the same as for find and replace for text documents as for Jupyter Notebook editors.
Match Whole Word should be supported. It works for me in VS Code 1.81. At least- the button in the find-widget does, but yeah- the keyboard shortcut does not work as it does for text document editors. I raised an issue ticket: https://github.com/microsoft/vscode/issues/192034.
Find in selection is an open feature-request: https://github.com/microsoft/vscode/issues/121218. Give it a thumbs up to show support for it, and subscribe to it to get notified about discussion and progress. Avoid making noisy comments like "+1" / "bump".
I can reproduce the behaviour with not going to the next occurrence from the cursor/caret/current-selection in find in VS Code 1.81. This might be related: https://github.com/microsoft/vscode-jupyter/issues/13088. Actually, https://github.com/microsoft/vscode/issues/154913 might be a better match to what you described. If not, raise an issue ticket about it. I tried searching for other existing related ones and had difficulty (I googled "
site:github.com vscode issues jupyter notebook find next occurrence -site:github.com/jupyterlab/jupyterlab/issues -site:github.com/jupyter/notebook/issues
").
More readings for the curious
Some related update history: https://code.visualstudio.com/updates/v1_81#_rich-content-search-for-closed-notebooks.
Some related docs: https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_search-through-notebook.
Some related history: https://devblogs.microsoft.com/python/notebooks-are-getting-revamped/.
More related history: https://github.com/microsoft/vscode/issues/140098.
An example of another historical difference from find with text documents: Option for seeding find string from editor on ctrl + f #20768.
Another difference (purportedly soon to be fixed in v1.85): Inconsistency in "Replace" between text files and notebooks #184290
Answered By - starball
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.