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

Display search results in a tab instead of the side bar #23931

Closed
rfgamaral opened this issue Apr 5, 2017 · 213 comments
Closed

Display search results in a tab instead of the side bar #23931

rfgamaral opened this issue Apr 5, 2017 · 213 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan search-editor
Milestone

Comments

@rfgamaral
Copy link

I was talking to a colleague the other day and the only reason he's not using VS Code is because of how the search is implemented in VS Code and I have to agree with his opinion.

Both Sublime Text (which I'm used to) and Atom (the editor my colleague is using) feature a search tab. A search tab displays the results much more clearly given that there's much more space available to display them. Instead, VS Code displays them in a "small" side bar.

Yes, we can resize back and forth the side bar, but that's a bit annoying. It would be nice to have the search results displayed in a new tab similar to Sublime Text and Atom.

@chrmarti chrmarti added search Search widget and operation issues feature-request Request for new features or functionality labels Apr 5, 2017
@d-akara
Copy link

d-akara commented Apr 6, 2017

I prefer the functionality of VS Code over sublimes implementation. I don't use sublime much, so maybe this is configurable; however, these are the limitations.

  1. I can't simply cursor down over each match and have the file opened as I cursor down
  2. It is harder to see just all the matches due to so much extra formatting and context around the matches
  3. I often want to hide the side panel, but then go back to the last results again. Not sure how smoothly that will work from another document.

A wider display however could be useful. For example displaying in bottom panel instead of side panel.
Also, ability to capture the text of results would certainly be useful. #17920

@roblourens
Copy link
Member

I know this has had some discussion before but can't find the issue right now. I've been toying with the idea of a button to dump the results from the viewlet into a sublime-style editor view, which would solve a few problems at once. Not sure how great that experience would be.

@d-akara
Copy link

d-akara commented Apr 6, 2017

@roblourens I can imagine lots of people have different ideas of how the contents of the dump should look. Would it be difficult to provide an API so that we could write extensions to do something with the results?

@rfgamaral
Copy link
Author

rfgamaral commented Apr 6, 2017

Those are all valid points @dakaraphi :)

My only reasoning for this was the wider display to show the results. Currently it's cumbersome to go through the results (especially when there are many of them) because the sidebar, as a component, is narrow by default.

@d-akara
Copy link

d-akara commented Apr 6, 2017

@rfgamaral Thanks for clarifying. In this case, you might be interested following this item #2806

@FezVrasta
Copy link

FezVrasta commented May 22, 2017

I would love to have the search results shown on the bottom tabs where there's also "terminal" "output" and so on.

is it possible?

@maxekman
Copy link

IMO, all three options would be nice to have; in the sidebar, as a tab/buffer or in the console area.

@bhat-ganesh
Copy link

Is this feature supported yet?

@leocaseiro
Copy link

Isn't duplicated of #9435?

@3zzy
Copy link

3zzy commented Aug 23, 2017

+1 I really love the way Sublime displays the search results so you get a the overview without opening each file. I'll switch to VS Code once it has this.

@shobhitg
Copy link

I recently moved to VSCode. As a sublime user, while I feel at home, but Search UX is just not very good. I would love to see search results in wider bottom panel, which I can expand to full tab whenever I wish.

@fatihacet
Copy link

fatihacet commented Sep 28, 2017

A huge 👍 to this issue. As a long time Sublime Text user, this is the deal breaker functionality. I often find myself resizing the search pane back and forth. Also lack of context in the VSCode search is another big thing. It makes very hard to find what you are looking for if you search something common in the codebase. Assume that you are new to the codebase, this is real pain in the ass.

Another fun fact is, Sublime or Atom version of displaying search results also allows you to search in the search results which is really handy.

Hope this feature lands in the VSCode sooner than later.

@mikegreiling
Copy link

likewise, I prefer to have more horizontal space to view search results 🙏

@pxwee5
Copy link

pxwee5 commented Oct 3, 2017

Drop the search icon from the sidebar and just follow Atom's search UI.

@shobhitg
Copy link

shobhitg commented Oct 9, 2017

Another fun fact is, Sublime or Atom version of displaying search results also allows you to search in the search results which is really handy.

This. Another thing that is very important.

I hope whenever the search's re-layout work done, this search within search results functionality is taken care of as well.

@adamreisnz
Copy link

I was talking to a colleague the other day and the only reason he's not using VS Code is because of how the search is implemented in VS Code

I'm so glad I'm not the only one. I'd really like to switch to vs code, as Atom is getting way too slow. But when I first tried to search in files and saw how the results were cramped inside the SIDE bar, I didn't know how fast to switch back after discovering that my only option was to make the sidebar wider manually, which also made it wider for the file explorer.

If vs code could copy a thing or two from Atom's UX it'd be a great editor, this is one of those things.

@notrealdev
Copy link

Display search results in a tab instead of the side bar please, like Sublime text

@mshirlaw
Copy link

This is the one reason I have yet to switch to vscode. I've tried to make the switch multiple times but I need to see more context about the search results without having to continuously resize the LHS panel. Would be very greatful if this was user configurable at some point in the future.

@andrewdang17
Copy link

At the very least, the sidebar with search results should expand. I find myself resizing it to view the results, then resizing it back down.

@shirazz
Copy link

shirazz commented Nov 30, 2017

After using VSCode for a week, this is the only thing which is pulling me back to sublime. Really the search should be improved.

@ghost
Copy link

ghost commented Dec 1, 2017

The VSCode search panel really need to be improved. It can't config the position and result displaying is too narrow.

@aneilbaboo
Copy link

aneilbaboo commented Jan 6, 2018

Not being able to view search results and the explorer at the same time drives me crazy.

@JacksonKearl JacksonKearl mentioned this issue Feb 25, 2020
3 tasks
@JacksonKearl
Copy link
Contributor

JacksonKearl commented Feb 25, 2020

Extension for making changes in a search editor and applying those changes to the workspace at large. Helpful for multicursor-enhanced refactoring across many files:
https://marketplace.visualstudio.com/items?itemName=jakearl.search-editor-apply-changes

Edit: note this currently has some issues when working with large lines.

@lucascosti
Copy link

I'm really liking how this is coming along 👏

A few refinements I'd love to have:

  • Include the count of results in the openNewEditor top-of-the-screen interface, like there is in the bottom panel (e.g. 20 results in 15 files).
  • Remember the Show context setting. I have to re-set it each time a do a new search.

@JacksonKearl
Copy link
Contributor

@lucascosti thanks for the feedback, please file separate issues for feature requests so the community can vote on them, as per our specification for handling feature requests.

@dmi-dmi-dmi
Copy link

Is there a way to open files from search editor not in the current editor group, but in the previously active one?

I want to be able to see list of search results + edit files at the same time.

@JacksonKearl
Copy link
Contributor

@dmi-dmi-dmi does Open Definition to the Side work for your situation?

@cafesanu
Copy link

cafesanu commented Mar 2, 2020

Hi! First, thank you for this feature! I now have totally abandoned Sublime Text now!

Second. For some reason Select All Occurrences of Find Match (via Show All Commands or the key shortcut) is not showing up or working in the search tab where all the results show. Any idea?

Thanks!

@JacksonKearl
Copy link
Contributor

@cafesanu first, are you on Insiders or Stable? Search editors have been heavily polished this iteration.

In insiders, I see this:
image

Note that the action is not "Select All Occurrences of Find Match" but rather "selectAllSearchEditorMatches". This is because in the search editor you may still have a local in-editor find open that you want to select all occurrences of.

@cafesanu
Copy link

cafesanu commented Mar 2, 2020

@JacksonKearl Nice. Yeah I am in Stable. I do see it in Insiders via the shortcut. Will use it!

Any way to see it in Show All Commands? Thanks!

@cpascu
Copy link

cpascu commented Mar 3, 2020

I can't seem to get the search to appear in a tab when right clicking a folder in the sidebar and selecting Find in Folder. I have enableSearchEditorPreview enabled. It seems to take the setting into account only when I start a new blank search.

I have enableSearchEditorPreview enabled, am I missing another setting somewhere?

@JacksonKearl
Copy link
Contributor

@cpascu I have not yet made a setting to prefer the editor for the “find in folder” context menu action. If you submit a new issue I will look into it.

@igolskyi
Copy link

Can I set hotkeys on "search.searchEditor.doubleClickBehaviour": "goToLocation" instead of double click behavior?

@JacksonKearl
Copy link
Contributor

@igolskyi I'm not sure what you mean. You can configure keybindings using the Keybindings Editor
https://code.visualstudio.com/docs/getstarted/keybindings

@igolskyi
Copy link

igolskyi commented Mar 10, 2020

@JacksonKearl Yes, I want to configure keybinding for command "goToLocation" but I don't know how does it (command by double click) names.

image

@JacksonKearl
Copy link
Contributor

@igolskyi the command run on double click will either be 'editor.action.goToDeclaration' or 'editor.action.openDeclarationToTheSide' depending on search.searchEditor.doubleClickBehaviour. Does that help? You can rebind those in the keybindings editor.

@igolskyi
Copy link

@JacksonKearl yes it's editor.action.goToDeclaration ) Thank you so much )

@kolpav
Copy link

kolpav commented Mar 11, 2020

I almost get this feature set up perfectly but I am unable to figure out how to always reuse the search tab I don't need new one for every search I make any ideas?

Btw this keybindings greatly improved my search experience. You open search editor with whatever shortcut you have it mapped to, start typing your search query press enter and it will focus search result window, press ctrl+n to go to next search result or press ctrl+p to go to previous one esc will focus search input again.

  {
    "key": "enter",             
    "command": "search.focus.nextInputBox",
    "when": "inSearchEditor && inputBoxFocus || inputBoxFocus && searchViewletVisible"
  },
  {
    "key": "ctrl+n",             
    "command": "search.action.focusNextSearchResult",
    "when": "inSearchEditor"
  },
  {
    "key": "ctrl+p",             
    "command": "search.action.focusPreviousSearchResult",
    "when": "inSearchEditor"
  }

@andyd0
Copy link

andyd0 commented Mar 11, 2020

Is there any way to default the original search to this? or a shortcut to bring it up the search editor? looks like we can only do it via the command pallet

@yume-chan
Copy link
Contributor

@andyd0 You can assign a keyboard shortcut for the search.action.openNewEditor command.

You can also assign it to Ctrl + Shift + F, then remove the default shortcut on workbench.view.search command.

@JacksonKearl
Copy link
Contributor

@kolpav

I am unable to figure out how to always reuse the search tab

No way to do this currently. If you open a feature request for this I will look into adding it.

press ctrl+n to go to next search result or press ctrl+p to go to previous one

F4 and Shift+F4 already do this for both search editors and the search viewlet, just btw.

press enter and it will focus search result window,

Neat.

@dwelle
Copy link

dwelle commented Mar 12, 2020

Can openLocationToSide not always consider only editor group to its right? Case: I want the search editor on the right side, and when I double click I want it to open the file in the editor group to its left (which already exists).

@JacksonKearl
Copy link
Contributor

@dwelle It uses the existing editor.action.openDeclarationToTheSide command. You can open a separate feature request for that to consider other groups.

knoxknox added a commit to knoxknox/dotfiles that referenced this issue Mar 16, 2020
@blakeprudhomme
Copy link

@JacksonKearl Great work! Thank you!

@PJUllrich
Copy link

Is it only me or did this feature break the Replace All button of the global search?

My steps are same as before:

  1. Open the Search Sidebar
  2. Enter a Search Term
  3. Click the little arrow left of the Search Term field
  4. Enter a Replace Term
  5. Hit "Enter" to search all occurrences and show a list of changes
  6. Click the "Replace All" button on the right side of the Replace Term field
  7. Nothing happens.

I must go through every file in the list of occurrences and apply the changes with the "Replace all" next to the file name. Do you have the same issue?

@JacksonKearl
Copy link
Contributor

@PJUllrich yes; that’s tracked in #92443 and fixed in Insiders.

@akbarsha03
Copy link

I got this new feature today with an update. But search results in a separate tab?. I mean, in a recent update from the vscode there was an option to shift the search result anywhere you like. I've moved mine right next to the terminal. This is quite handy than the search result in a separate tab. In fact, with the search results at the bottom, it's very much similar to the IntelliJ.

Check it out here:

https://code.visualstudio.com/updates/v1_42#_moving-views-from-the-sidebar-to-the-panel

@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan search-editor
Projects
None yet
Development

No branches or pull requests