Skip to content

Find in current file command #128915

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

ssigwart
Copy link
Contributor

This PR fixes #14836.

I did not read all of the comments on that issue since it's extensive, but I implemented @alexdima's suggestion in #14836 (comment).

This adds a way to find occurrences in the current file. To test, you can open the find widget, then click the new icon to find in the file. I wasn't sure what icon to use. The two I thought fit best were file or search.
image
image

I went with search, but I'm open to suggestions.

@roblourens roblourens assigned rebornix and unassigned roblourens Jul 19, 2021
@rebornix rebornix added this to the Backlog milestone Jul 20, 2021
@ssigwart
Copy link
Contributor Author

ssigwart commented Aug 6, 2021

@rebornix, should I rebase to fix the conflict?

@rebornix rebornix added editor-find Editor find operations feature-request Request for new features or functionality labels Oct 22, 2021
@zm-cttae
Copy link

zm-cttae commented Jan 15, 2023

I agree that the icon choice here is pretty hard.
There were two feature suggestions in the linked issue:

  1. Open all results for 1 file in new search editor.
  2. Select all occurences in current document.

Based on that and my writeup at #14836 (comment):

  • Ideal icon for this feature (#1) would be new-file to match the search pane.
  • We can't use a "file" related codicon for the other feature.

zm-cttae

This comment was marked as outdated.

@ssigwart
Copy link
Contributor Author

Thanks for taking the time to review this @meche-gh. However, I'm not going to make any changes to this PR at this time. I still would like it merged at some point, but that will need to be done by someone from Microsoft and I haven't heard any feedback since I opened this about 1.5 years ago. If I hear back from someone there and it seems like they are willing to merge it, then I'll take the time to make updates.

@zm-cttae
Copy link

Makes sense. This pull's assigned and I'm the review has pinged them already :) will give it a wait

Copy link

@zm-cttae zm-cttae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wrong about the scope of this PR & I unfortunately read the last few messages of #14836 first.
I see that this pull is specifically for functionality #1 - the "find" op.
Gonna see if I can dismiss my review and replace it with just the icon change.

Copy link

@zm-cttae zm-cttae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, here is the review with the icon change

@@ -47,6 +47,7 @@ export const findReplaceIcon = registerIcon('find-replace', Codicon.replace, nls
export const findReplaceAllIcon = registerIcon('find-replace-all', Codicon.replaceAll, nls.localize('findReplaceAllIcon', 'Icon for \'Replace All\' in the editor find widget.'));
export const findPreviousMatchIcon = registerIcon('find-previous-match', Codicon.arrowUp, nls.localize('findPreviousMatchIcon', 'Icon for \'Find Previous\' in the editor find widget.'));
export const findNextMatchIcon = registerIcon('find-next-match', Codicon.arrowDown, nls.localize('findNextMatchIcon', 'Icon for \'Find Next\' in the editor find widget.'));
export const findAllMatchesIcon = registerIcon('find-all-in-current-file', Codicon.search, nls.localize('findAllMatchesIcon', 'Icon for \'Find All in Current File\' in the editor find widget.'));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const findAllMatchesIcon = registerIcon('find-all-in-current-file', Codicon.search, nls.localize('findAllMatchesIcon', 'Icon for \'Find All in Current File\' in the editor find widget.'));
export const findAllMatchesIcon = registerIcon('find-all-in-current-file', Codicon.newFile, nls.localize('findAllMatchesIcon', 'Icon for \'Find All in Current File\' in the editor find widget.'));

Copy link

@zm-cttae zm-cttae Feb 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ssigwart I understand work is on pause for this PR but could you merge this suggestion? It's the correct icon, matching the search-new-editor button in the search pane next to the vertical Activity Bar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zm-cttae, I had taken a look at this when you first suggested, but this branch is so far behind main now and there were major merge conflicts. It's not worth my time fixing that without some type of feedback from Microsoft indicating this PR may be merged.

Copy link

@zm-cttae zm-cttae Feb 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be possible to make the icon change and resolve the review w/o merge.. looking to keep my lists clear

EDIT: Unsubscribe also works

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem that useful to change the icon when the whole thing won't work in its current state due to VS Code internal changes since I originally wrote this. I assume that Microsoft has other priorities and won't be looking at this, but I leave it open just in case.

zm-cttae added a commit to zm-cttae/vscode that referenced this pull request Feb 2, 2023
We use `expand-all` for the "select matches" icon.
We also rename from "find all" to "select all" for microsoft#128915.
Refs: ec02bcd & microsoft#14836
@vivodi
Copy link

vivodi commented Dec 29, 2024

Is this still relevant?

@ssigwart
Copy link
Contributor Author

I still think it's a viable solution to #14836, which is still open. However, it would need merge conflicts fixed first. I don't want to spend time doing that until someone from Microsoft indicates that this PR had some likelihood of being merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-find Editor find operations feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "find all occurences" in the current file feature
5 participants