Skip to content

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

@mickaelistria

Description

@mickaelistria

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions