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

search-in-workspace: add support for multi-line searches #11656

Closed
vince-fugnitto opened this issue Sep 9, 2022 · 3 comments · Fixed by #12868
Closed

search-in-workspace: add support for multi-line searches #11656

vince-fugnitto opened this issue Sep 9, 2022 · 3 comments · Fixed by #12868
Labels
proposal feature proposals (potential future features) search in workspace issues related to the search-in-workspace

Comments

@vince-fugnitto
Copy link
Member

Feature Description:

The goal is to add support for multi-line searches in the search-in-workspace view.
The changes likely include:

  • updating the input to a textarea
  • passing the proper options to ripgrep

vscode above - theia below:

Screen Shot 2022-09-09 at 12 45 16 PM

How to test:

  1. search the following in the search-in-workspace view:
export const GettingStartedCommand = {
    id: GettingStartedWidget.ID,
    label: GettingStartedWidget.LABEL
};
@vince-fugnitto vince-fugnitto added the search in workspace issues related to the search-in-workspace label Sep 9, 2022
@KR155E
Copy link
Contributor

KR155E commented Mar 26, 2023

I have implemented this feature and am almost ready to submit a PR. But there's one remaining issue I can't quite get to the bottom of. For opened files, only the first line of a multiline search is being returned as the search result. Do you have an idea what might be causing this?

@vince-fugnitto
Copy link
Member Author

@KR155E the opened files are handled separately since we cannot rely on their disk content given that there might be unsaved changes. We therefore search the in-memory editor model. You may be interested in the following:

and probably most importantly:

@KR155E
Copy link
Contributor

KR155E commented Apr 9, 2023

I see, makes a lot of sense.

lineText in findMatches will always return only the first line of a match. Modifying that got things working correctly. I will see if I can clean up the code and will then submit a PR.

Thanks for the help!

@tsmaeder tsmaeder added the proposal feature proposals (potential future features) label May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal feature proposals (potential future features) search in workspace issues related to the search-in-workspace
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants