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

[Help Needed] Implement provider for sticky scrolling in JAVA/JDT #1851

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Christopher-Hermann
Copy link

What it does

The current sticky scrolling functionality is based solely on indentation. This can cause issues when the source code is formatted in unexpected ways. To address this, an extension point for providing language-specific sticky lines has been introduced in the following pull request: eclipse-platform/eclipse.platform.ui#2398.

This change represents the first proof-of-concept implementation for sticky lines in Java/JDT. As I lack experience in JDT development, the proposed approach for calculating sticky lines in Java may not be optimal.
I would greatly appreciate assistance from the community in identifying a more effective method for calculating sticky lines.

Fixes:
eclipse-platform/eclipse.platform.ui#1950
eclipse-platform/eclipse.platform.ui#2128
eclipse-platform/eclipse.platform.ui#2338

How to test

  1. Check out the PR from [StickyScrolling] Add extension point for sticky lines provider eclipse-platform/eclipse.platform.ui#2398. and open plugin org.eclipse.ui.editors
  2. Enable the Sticky Scrolling Feature via Preferences > General > Editors > Text Editors > Enable Sticky Scrolling
  3. Open the class EnumMap, scroll to line 775 (method writeObject)

With proper Sticky Lines calculation:
image

With the Default Sticky Lines calculation based on indentation:
image

@BeckerWdf
Copy link
Contributor

Is JDT interested in such a feature?
@jukzi: Could you ask one of the JDT committers to have a look at this?

@jukzi
Copy link
Contributor

jukzi commented Dec 17, 2024

what kind of help do you need? build currently fails because it can not find the internal(!) API
org.eclipse.ui.internal.texteditor.stickyscroll.IStickyLine
referenced as
org.eclipse.ui.texteditor.stickyscroll.IStickyLine

@BeckerWdf
Copy link
Contributor

@Christopher-Hermann asks for this:

This change represents the first proof-of-concept implementation for sticky lines in Java/JDT. As I lack experience in JDT development, the proposed approach for calculating sticky lines in Java may not be optimal.
I would greatly appreciate assistance from the community in identifying a more effective method for calculating sticky lines.

Could you or some of your JDT co-committers help him?

@jukzi
Copy link
Contributor

jukzi commented Dec 17, 2024

Could you or some of your JDT co-committers help him?

I lack the skill for that. Maybe @jjohnstn could help?

@@ -0,0 +1,51 @@
package org.eclipse.jdt.internal.ui.javaeditor;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add copyright header.

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

Successfully merging this pull request may close these issues.

4 participants