Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create document wide search and replace feature for file editor/notebooks #1074

Closed
ellisonbg opened this issue Oct 11, 2016 · 36 comments · Fixed by #5795
Closed

Create document wide search and replace feature for file editor/notebooks #1074

ellisonbg opened this issue Oct 11, 2016 · 36 comments · Fixed by #5795
Assignees
Labels
enhancement pkg:notebook status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Design and UX tag:Feature Parity tag:Search and Replace
Milestone

Comments

@ellisonbg
Copy link
Contributor

In the classic notebook, both the file editor and notebooks have document wide search/replace. We need to create a new plugin that offers a UI for doing this in the file browser and notebook.

We should probably create a general plugin that does this that uses a new API that documents can expose for search/replace.

@StevenCHowell
Copy link

It would be great if there was a way to have a "find and replace" option for a single cell, in addition to the entire document.

jerome-nexedi pushed a commit to jerome-nexedi/jupyterlab that referenced this issue Jun 16, 2017
… & jump to line

Only because Ctrl+Shit-F, the default keybinding for search and replace
is already assinged to toggle file browser.

This local to the current editor, so not good enough for
jupyterlab#1074
@dfan14051
Copy link

This is a feature that I've been hoping for. Is anyone actively working on it? If not, how hard would it be to implement for a first-time contributor to the project?

@blink1073
Copy link
Member

Hi @dfan14051, the WIP table of contents PR #3949 is a good example of the level of complexity required and about what it might look like.

@billgreenwald
Copy link

Is there a way to accomplish this while work is tabled? The current find and replace is disabled from what I can tell

@blink1073
Copy link
Member

Hi @billgreenwald, unfortunately there is not.

@cramjaco
Copy link

cramjaco commented Mar 9, 2018

@billgreenwald I have had success opening files with jupyter notebook, in parallel with jupyter lab (eg just navigating to the file from eg localhost:8888/tree/MyDir. Find and replace is then available from the Find menu. Total pain to jump back and fourth but useful for that critical find-replace job.

@Carreau
Copy link
Contributor

Carreau commented Apr 2, 2018

I would suggest promoting that to one of the beta, it is deeply needed.
Also add ability to input unicode in the F&R menu.

@billgreenwald
Copy link

@cramjaco thanks for the suggestion, I ended up doing this for my find a replace. I also agree that having it in lab in some form during beta would be great

@SergiyKolesnikov
Copy link

SergiyKolesnikov commented Jun 22, 2018

I currently launch the classic notebook with Help -> Launch Classic Notebook and do find-and-replace there.

It would be great if this feature in JupyterLab had the same functionality as in classic Jupyter.

@idoDavid
Copy link

Is there any WIP on this?

@blink1073
Copy link
Member

Hi @idoDavid, to my knowledge no one is currently working on this.

@jandrewtorres
Copy link
Contributor

@blink1073 @ellisonbg I'd like to work on this document/notebook-wide search-replace plugin. Has there been any discussion as to the UI for this feature?

Potential options:

  • A modal over the notebook (just like the original notebook).
  • Like the texteditor, have it appear at top of the notebook when toggled (by the Edit > Find and Replace... dropdown-menu option or Cmd + F shortcut).

I'm going to try and get the functionality going with minimal UI before worrying about it too much. Any thoughts / input much appreciated :)

@blink1073
Copy link
Member

Hi @jandrewtorres, there hasn't been any design discussion that I'm aware of. Another option is to use a side bar item. My preference would be to not have a modal for this.

cc @tgeorgeux

@jandrewtorres
Copy link
Contributor

@blink1073 Awesome. I'm went forward with the sidebar today. It feels pretty natural. The same sidebar panel might be a good place for more document-wide commands/actions in the future.

@blink1073
Copy link
Member

cc @tgeorgeux for design input, this is a must-have for 1.0.

@jasongrout
Copy link
Contributor

@jandrewtorres - I'm curious, did you publish your code anywhere?

@jasongrout jasongrout self-assigned this Nov 27, 2018
@aschlaep
Copy link
Member

Based on discussions with @jasongrout @afshin and @ellisonbg, I'm going to start building out a first pass at single-document search. We've decided to go with a model where search providers that can handle different document types are registered and queried by a search extension that handles the UI. I'll start by building out a simple prototype UI for single-document search and mock out the infrastructure before we begin diving into the specific details of the API.

@simonnier
Copy link

when will global find and replace work? It is already 2019-3-7, and "find and replace" is still grey out in my jupyterlab

@aschlaep
Copy link
Member

aschlaep commented Mar 7, 2019

My apologies, I linked my PR that added just the search part to this issue, which caused it to get closed. I missed that this issue asks for search and replace. I'm starting work on search and replace either today or tomorrow.

@simonnier
Copy link

@aschlaep Thank you so much. Looking forward to it.

@Baukebrenninkmeijer
Copy link

Where is the search and replace located? I don't seem to have it in either commands or extensions. Using ctrl+f/g first opens up a different search bar in the cell and then opens up the google chrome search bar. I'm on version 0.35.5.

image

@ian-r-rose
Copy link
Member

@Baukebrenninkmeijer Find/replace is currently available in the 1.0.0a3 prerelease.

@Baukebrenninkmeijer
Copy link

@ian-r-rose Aaah alright. Looking forward to it!

@LukaPitamic
Copy link

LukaPitamic commented Jun 12, 2019

Hi guys, is there any progress on search & replace. I don't know if it's just me, but close to 50% of all code development (aside from starting up with initial lines of course) is restructuring code which include A LOT of find/replace functionality.

I love JupyterLab but from my understanding (which might be totally wrong, it wouldn't be the first time ;), the only way to go about it - is to open document in JupyterNotebook, do the renaming (very smoothly I must say), save, go back to JupyterLab, and run the code there to be sure everything is as expected. In reality usually it doesn't go as smoothly so going back and forward between JupyterLab and JupyterNotebook is something I noticed myself wasting a lot of precious time.

Is there any other way to do this I'm not aware of.

@blink1073
Copy link
Member

Hi @LukaPitamic, this feature is available today using pip install --upgrade --pre jupyterlab. We'll have a final release out within the next week.

@LukaPitamic
Copy link

@blink1073 AWESOME!!!! Thank you so much!

@LukaPitamic
Copy link

@blink1073 I have installed it the way you suggested, but all I can see is Find functionality inside code cell being upgraded, but no Find & Replace functionality.

I was talking about the one which is evoked in Jupyter Notebook in command mode, by selecting cells and pressing key F.
Or am I missing something?

@blink1073
Copy link
Member

The separate "Replace" menu was removed in #6350. If you press the arrow on the left it expands to a replace dialog:

image

@LukaPitamic
Copy link

@blink1073 got it! Thank you very much.

@blink1073
Copy link
Member

👍

@austinmw
Copy link

austinmw commented Jul 24, 2019

@blink1073 is there a single-cell find-replace-all option?

@tgeorgeux
Copy link
Contributor

@austinmw not at this point. If you think one would be useful I would open an issue.

@billgreenwald
Copy link

billgreenwald commented Aug 5, 2019

I can't find a way to modify the hotkey (in the keyboard shortcuts it is listed as empty; I am trying to modify the entry for "command": "editmenu:find") which means that I can't use my browsers built in find anymore since they are both control + F

The browser lets me search the output from cells as well, not just code, which is useful

it also prevents regex search per cell because that was bound to control + F too

@edoson
Copy link

edoson commented Aug 25, 2019

Is this should be available in Version 0.35.4? I'm on it and I can't seem to find a way to invoke search and replace.

@jasongrout
Copy link
Contributor

It is in 1.0

@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Sep 25, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement pkg:notebook status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Design and UX tag:Feature Parity tag:Search and Replace
Projects
None yet
Development

Successfully merging a pull request may close this issue.