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

Focus peek window on creation #23001

Closed
johnfn opened this issue Mar 22, 2017 · 14 comments · Fixed by #88185
Closed

Focus peek window on creation #23001

johnfn opened this issue Mar 22, 2017 · 14 comments · Fixed by #88185
Assignees
Labels
editor-symbols definitions, declarations, references feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities on-release-notes Issue/pull request mentioned in release notes on-testplan
Milestone

Comments

@johnfn
Copy link
Contributor

johnfn commented Mar 22, 2017

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! ❤️

@jrieken jrieken added editor-contrib Editor collection of extras feature-request Request for new features or functionality labels Mar 23, 2017
@jrieken
Copy link
Member

jrieken commented 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
Copy link
Contributor Author

johnfn commented 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.

@jrieken jrieken added the help wanted Issues identified as good community contribution opportunities label Apr 11, 2017
@frabbit
Copy link

frabbit commented 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
Copy link

Is there any progress being made on this?

@ognjenio
Copy link

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:

  1. 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.

  2. 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.

@jrieken jrieken added editor-symbols definitions, declarations, references and removed editor-contrib Editor collection of extras labels Oct 8, 2019
@nicksettoon
Copy link

Any push on this? this is a must have. I seriously don't know how people have gone without this.

@jrieken
Copy link
Member

jrieken commented Nov 25, 2019

@nicksettoon This is an open source project, this issue is marked as 'help wanted', so how about you?

@GustavoASC
Copy link
Contributor

@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 @frabbit suggestion.

Do you guys think it's a good solution?

@jrieken
Copy link
Member

jrieken commented 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

@jrieken
Copy link
Member

jrieken commented Nov 27, 2019

fyi - this is the place (and sample) for adding commands that use the peek view widget:

KeybindingsRegistry.registerCommandAndKeybindingRule({

@GustavoASC
Copy link
Contributor

Besides, we still need a setting to define which component will receive focus by default when Peek Window is shown.

@jrieken jrieken added this to the December 2019 milestone Dec 6, 2019
@nicksettoon
Copy link

nicksettoon commented Dec 22, 2019

@nicksettoon This is an open source project, this issue is marked as 'help wanted', so how about you?

@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

This comment has been minimized.

jrieken added a commit that referenced this issue Jan 23, 2020
@jrieken
Copy link
Member

jrieken commented Jan 23, 2020

fyi - I have change the setting to: peekWidgetDefaultFocus?: 'tree' | 'editor';

jrieken added a commit that referenced this issue Jan 27, 2020
@jrieken jrieken added the on-release-notes Issue/pull request mentioned in release notes label Jan 30, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-symbols definitions, declarations, references feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities on-release-notes Issue/pull request mentioned in release notes on-testplan
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants