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

Reveal closer to top instead of center: outline, go to definition, etc. #80726

Closed
wkornewald opened this issue Sep 11, 2019 · 1 comment · Fixed by #80727
Closed

Reveal closer to top instead of center: outline, go to definition, etc. #80726

wkornewald opened this issue Sep 11, 2019 · 1 comment · Fixed by #80727
Assignees
Labels
editor-symbols definitions, declarations, references feature-request Request for new features or functionality
Milestone

Comments

@wkornewald
Copy link
Contributor

This is a UX improvement suggestion for "Go to definition" and when selecting an item from the outline. Note that JetBrains IDEs behave similar to this suggestion, so someone there thought about this issue, too.

If I asked you (i.e. a human) to scroll to a certain function or class, where would you position that function on the screen? You'd probably try to ensure that:

  • the whole class/function is visible (including signature, body)
  • comments preceding the function signature are also visible unless they're very long
  • maybe for functions longer than a few lines the whole body would be centered on the screen (though, I've often seen developers not care too much as long as the whole body is visible)

A simplification of those rules is: Scroll the definition close to the top, but not exactly to the top, so the comments (and some extra context in case of variable definitions) are still visible.

Currently, "Go to definition" and other operations center the function signature within the window.

It would be more ergonomic to position the result closer to the top of the window because then you can see longer class/function definitions without scrolling and most of the code after the definition is usually more important than most of the code before the definition. We just have to ensure that sufficient context from before the definition is visible.

So, my suggestion is to have it revealed at around 20% of the screen height. I've tested that value and had some good experience with it. 15% might also be fine. IMHO, we shouldn't go beyond 25%.

@vscodebot
Copy link

vscodebot bot commented Sep 11, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@jrieken jrieken added editor-symbols definitions, declarations, references feature-request Request for new features or functionality labels Sep 12, 2019
@jrieken jrieken added this to the Backlog milestone Jan 13, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 21, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants