-
Notifications
You must be signed in to change notification settings - Fork 28k
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 does not respect workbench.editor.revealIfOpen
#94705
Comments
(Experimental duplicate detection)
|
Old change, @sandy081 do you know why you added this for Search to override the Is there any reason for this to be different for search viewlet vs quickopen and explorer? Could add a new setting but that seems unnecessary. |
Yeah very old change back to 1.3 (3 years back).. Revealing the opened file is expected behavior while navigating from non-explorer views. Also it shall be consistent. |
🤷 |
So a ton of places that open editors set either @isidorn do you happen to know why it was necessary to add that when the editor service respects the setting? Was the goal to override the setting? If I changed this for search I think I'd want to change it everywhere. I don't use that setting so I don't really know what users expect, but it seems like the places that force overriding it are not like "open new editor" actions, it seems like if I am clicking in Search or Problems it's more likely that I would want to reveal the editor. But I don't know, and there is also this difference between |
@roblourens I do not remember clearly to be honest. I probably pass that argument so that editor service would not open editors if they are already open. |
This is the same reason @isidorn mentioned that it was added to Problems view and Search view then and want to continue it for problems view. |
I would only set it if you really want the experience to be in this way and not allow the user to change it, otherwise do not set it. E.g. I know we set it for some editor features like goto definition to allow for a certain experience, but that is always explicit intent by the author of that feature area. |
To add some user context here, I expected My problem with revealing existing documents is that the focus move screws up my ability to organize editor groups. I typically have 2 groups open where each group is logically related. A common scenario is that one group is the code I'm writing and the other group is users of the code. I frequently search for some symbol to look through all the locations it is used. I move focus to the right group before performing the search so that all results will open in that group. This leaves my 'workspace' alone (the left group when I'm actually editing) and let's me mass close the right group when I'm done with it. The problem is that in the middle of the search results for the symbol there are going to be entries for where the symbol is defined, which is usually where I'm editing. So I step through the results, editors are being opened in the right group, where I want them, I hit a result that reveals an already opened doc in the left group, and now all subsequent results open documents on the left. |
Thanks @akbyrd. You have a way of filing issues that sound simple at first but lead to some interesting discussion 🤔 Here's something that I didn't realize - the default of the revealIfOpen setting is false. I thought Isidor and Sandeep's changes were just to override the user's preference but actually they are just defining the default experience. I think that's a good default experience and I'd want to protect that. To do that, we'd have to add a new setting. We could have one that controls everything that isn't the file explorer/quickopen I guess. |
Hi! Is there any update on this issue? I've been searching around for solution on the same problem as @akbyrd and found this post. FWIW, I have a very similar user context as @akbyrd mentioned here. I usually have two groups splitting the screen; the right group is the code I'm working on ("workspace") and the left group is what I need to refer to. Very often the two groups will be opening the same file, e.g. writing something that calls a function a few hundreds of lines above, so the right group will be on the line to write the function invocation and the left group shows the signature of the function. What happens a lot is that I want to Go To Definition( Would really appreciate a fix on this. To me this is about the only deal breaker of switching my primary ide from vim to vscode. |
Copying over the illustrations from closed issue Isn't this an important usability issue? I often want to reference two locations in the same file. For example a call to method and the method's implementation. As it is, AFAIK, there is no way to do this in VSCode except to manually open 2 windows, and manually search or otherwise navigate to the desired locations. This because if you do a global find and click on the first location in search results, the activate a 2nd window and click a different result, VSCode will move the first window, not the second. Where as what I'm used to is (could just be me) is that he last active window switches to the 2nd result The 2nd way, "move the last active window to the search result", lets you compare 2 or more results in different windows from the same file easily. Want to compare 4 locations from the same file, open 4 panes, click a pane, click a result, repeat. If you want the window with the file already in it to be the one to receive the result you just make that the active window before clicking. Conversely, the 1st you're just out of luck. You can't use the global search. You instead have to manually open the file in 4 panes and then do a local search in each pane. I'm surprised people don't run into this more often. |
@roblourens @akbyrd I see this issue hasn't been visited for almost 2 years. I'm really surprised as it's making it extremely frustrating to actually get work done in VSCode. Today I needed to look at a call site and the function called, both in the same file. Both are visible in global search but AFAICT It's IMPOSSIBLE in VSCode to view both results from the global search??? Is there some other solution that I'm missing? If I submit a PR with a new setting will it be accepted? I'm really shocked this not affecting more people so it makes me wonder what workaround people are using. Here's me trying to look at both the call site and the function being called. VSCode makes me lose my context (the call site) and them I'm force to jump through a bunch of hoops to find it again since there's no way to use global search to get there and local search only shows one result at a time I now have to dig through the rules, or I have to memorize the line number. Neither of these seem like what a code editor would normally do. Do you guys seriously never run into this issue? If not, what are you doing instead? |
🤷 The editing experience hasn't really been the focus for years now. I've just gotten used to all my personal little workarounds until I have time to change editors. |
The new "Drag and drop Problems and Search results" solves this issue for me in the February 2022 version 1.65 version of VSCode. You can drag a search result to any editor pane and that pane will go to that result. |
Actually I take that back. While being able to drag to a window helps it still is a pretty poor UX. Trying to navigate unfamiliar code I have to manually keep track of which panes have which or else always use drag, never use click. That makes clicking a bad habit because you get used to using in and then, when you need it work with multiple panes you have to change to unfamilary behavior. Making clicking act this way is arguably a pretty bad UX. I hope the VSCode team will consider revisiting this. Or tell us how and why the never run into this. I'd expect it to come up often on a large code base like VSCode itself. |
Selecting a search result will reveal an existing editor in an unfocused group even when
workbench.editor.revealIfOpen
is set to false.Steps to Repro
workbench.editor.revealIfOpen
to falseworkbench.action.focusActiveEditorGroup
will focus the correct group).The text was updated successfully, but these errors were encountered: