Skip to content

Find in current file command - #128915

Open
Stephen Sigwart (ssigwart) wants to merge 2 commits into
microsoft:mainfrom
ssigwart:findInFile
Open

Stephen Sigwart (ssigwart) wants to merge 2 commits into
microsoft:mainfrom
ssigwart:findInFile

Conversation

@ssigwart

Copy link
Copy Markdown
Contributor

This PR fixes #14836.

I did not read all of the comments on that issue since it's extensive, but I implemented Alexandru Dima (@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.

@ssigwart

Copy link
Copy Markdown
Contributor Author

Peng Lyu (@rebornix), should I rebase to fix the conflict?

@rebornix Peng Lyu (rebornix) added editor-find Editor find operations feature-request Request for new features or functionality labels Oct 22, 2021
@zm-cttae

ZM (zm-cttae) commented Jan 15, 2023 •

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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

@zm-cttae ZM (zm-cttae) left a comment

Copy link
Copy Markdown

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.

@zm-cttae ZM (zm-cttae) left a comment

Copy link
Copy Markdown

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

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.'));

Copy link
Copy Markdown

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.'));

@zm-cttae ZM (zm-cttae) Feb 5, 2023 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stephen Sigwart (@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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ZM (@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.

@zm-cttae ZM (zm-cttae) Feb 6, 2023 •

Copy link
Copy Markdown

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
Copy Markdown
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 (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

vivodi commented Dec 29, 2024

Copy link
Copy Markdown

Is this still relevant?

@ssigwart

Copy link
Copy Markdown
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.

This branch has not been deployed

No deployments
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