Skip to content

Sticky scrolling should allow to be fed by language-specific info/annotations #1950

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

Open
Tracked by #2152
mickaelistria opened this issue Jun 11, 2024 · 0 comments
Open
Tracked by #2152
Labels
enhancement New feature or request

Comments

@mickaelistria
Copy link
Contributor

Taking for example such Java code, in the middle of some file

if (condition) {
  // some code
} else if (another condition) {
  // some other code
} else {
  // focus here
}

If editor top line is around "focus here", then the StickyLine would be } else { which is fine. But in this particular context, one would also like to get the conditions to make the Sticky more useful.
Exprected sticky lines for best result would be

if (condition) {
} else if (another condition) {
} else {

On the contrary, some structures of the form

Stream.of()
	.map(...)
	.map(...)
	.filter(...)
	.map(x -> {
		// focus here
	})

Tend to render confusing or not so helpful information as sticky as it would only show

Stream.of()
	.map(x -> {

Although indentation already works very well (I wasn't expecting so good results), we'll most likely need to tune what's shown according to the file or language. The language support could create internal annotations of which lines are relevant and "stick-worthy", and the Sticky area shows lines tagged as such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant