You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love the peek window. It's pretty much the best thing ever.
I would love it ever so slightly more if VSCode would auto-focus it and insert the cursor where it belongs. e.g. if I clicked "peek definition", the cursor should be on the definition of what I peeked.
This idea seems so obvious I can't believe it's not part of the default implementation, but I know you guys have your reasons for doing things. 😄
If there is such a reason, could this at least be made a setting?
Thanks guys! ❤️
Reacted by Kai Wood, Harshit Bansal, Wiktor Czajkowski, mircea-gindulescu, Jian Li, Xuan Huang (黄玄), John Iaconis, Suhaib, Ognjen Regoje, Grant Mathews and 8 more
Reacted by Xuan Huang (黄玄), Max Yankov and Gustavo Cassel
Fiar request. The reasoning for focusing the tree of the left that you might wanna quickly skim through all references/definitions/etc to get fast overview. That's also the reason for changing the peek editor when the focus changes in the list.
We could add a command that allows to toggle between the selected reference/def and the peek view and then remember where you have been last
Reacted by Grant Mathews, Wiktor Czajkowski, Martin, Matt Blais, Gustavo Cassel and Dmitry Pypin
Ah, I understand. Speaking to my own use case, I use peek definition at least 98% of the time that I use the peek window, so at least 98% of the time there's only one file in the tree, and highlighting the tree doesn't make much sense. (I think it's a bit of a UX problem with the "peek all references" - it feels a little too much information in too constrained a space, so I normally do a global search instead - but that's an alternate request.)
Your toggle command sounds great to me.
I would also love if there was a keyboard shortcut to focus back on the original text document.
Not entirely sure whether it's appropriate to add this here, but I'd also suggest two other things for the peek window that're in the same vein:
Splitting the "Keep peek editors open even when double clicking their content or when hitting escape" into two. The two aren't really equivalent, especially since double-clicking selects entire words and I'd for example like to be able to that, but still be able to close the window with Esc.
I'd suggest changing the tab order of the peek window for the editor to follow the list. That way, when the peek window is opened you can select the appropriate file and Tab into it instead of Shift+Tabbing.
I'd say a command to move focus between them and then a setting to define is focused by default is the better solution. That makes the behaviour predictable, e.g I often press Enter when having just one reference I wouldn't want a new line then
@nicksettoon This is an open source project, this issue is marked as 'help wanted', so how about you?
Johannes Rieken (@jrieken) Sorry. I'm so far away from having time to learn how to contribute. I'd like to, but I'm still in college working on several other things at the moment. Also, wouldn't even know where to start learning how to build vscode extensions and stuff.
Activity
jrieken commentedon Mar 23, 2017
Fiar request. The reasoning for focusing the tree of the left that you might wanna quickly skim through all references/definitions/etc to get fast overview. That's also the reason for changing the peek editor when the focus changes in the list.
We could add a command that allows to toggle between the selected reference/def and the peek view and then remember where you have been last
johnfn commentedon Mar 23, 2017
Ah, I understand. Speaking to my own use case, I use peek definition at least 98% of the time that I use the peek window, so at least 98% of the time there's only one file in the tree, and highlighting the tree doesn't make much sense. (I think it's a bit of a UX problem with the "peek all references" - it feels a little too much information in too constrained a space, so I normally do a global search instead - but that's an alternate request.)
Your toggle command sounds great to me.
I would also love if there was a keyboard shortcut to focus back on the original text document.
frabbit commentedon Aug 18, 2017
maybe the focus should be on the peek editor directly if there is only one entry in the list, that would be very helpful.
idealatom commentedon Jul 18, 2018
Is there any progress being made on this?
ognjenio commentedon Nov 11, 2018
Not entirely sure whether it's appropriate to add this here, but I'd also suggest two other things for the peek window that're in the same vein:
Splitting the "Keep peek editors open even when double clicking their content or when hitting escape" into two. The two aren't really equivalent, especially since double-clicking selects entire words and I'd for example like to be able to that, but still be able to close the window with Esc.
I'd suggest changing the tab order of the peek window for the editor to follow the list. That way, when the peek window is opened you can select the appropriate file and Tab into it instead of Shift+Tabbing.
the-nurk commentedon Nov 24, 2019
Any push on this? this is a must have. I seriously don't know how people have gone without this.
jrieken commentedon Nov 25, 2019
@nicksettoon This is an open source project, this issue is marked as 'help wanted', so how about you?
GustavoASC commentedon Nov 26, 2019
Johannes Rieken (@jrieken) I'll give it a try, looking for a way to automatically focus on peek window when there is only one entry in the list, according to Heinz Hölzer (@frabbit) suggestion.
Do you guys think it's a good solution?
jrieken commentedon Nov 27, 2019
I'd say a command to move focus between them and then a setting to define is focused by default is the better solution. That makes the behaviour predictable, e.g I often press Enter when having just one reference I wouldn't want a new line then
1 remaining item
GustavoASC commentedon Dec 1, 2019
Besides, we still need a setting to define which component will receive focus by default when Peek Window is shown.
the-nurk commentedon Dec 22, 2019
Johannes Rieken (@jrieken) Sorry. I'm so far away from having time to learn how to contribute. I'd like to, but I'm still in college working on several other things at the moment. Also, wouldn't even know where to start learning how to build vscode extensions and stuff.
tanglei1994 commentedon Jan 20, 2020
rename setting to `peekWidgetDefaultFocus` and make it an enum of "tr…
jrieken commentedon Jan 23, 2020
fyi - I have change the setting to:
peekWidgetDefaultFocus?: 'tree' | 'editor';change command name, #23001