You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When code is commented out, sticky scrolling incorrectly detects the line.
To reproduce this issue:
Under org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.CommentPosition.findFirstContent(CharSequence, int), some code is commented out.
In the method org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.CommentPosition.computeProjectionRegions(IDocument), there is some commented-out code.
Before the the commented out line:
And after:
The text was updated successfully, but these errors were encountered:
Related to #2115 and #1950 . Sticky scrolling would need to be able to know what a comment is, which is different in different languages. AFAIK the current implementation is based purely on indentation?
Perhaps it could consider document partitions, if any. Though I'm not sure there is any platform-wide "standard" to identify comment partitions, and not every editor might use partitions for comments...
Correct, sticky scrolling is based purely on indentation. It is planned to provide a extension point so that every language can define a own implementation for the sticky scrolling calculation. For java we can then provide a implementation that is able to handle this kind of comments, annotations which are currently a problem or unusual code styles.
If no specific implementation is provided, the default will still be based on indentation.
Unfortunately I had no time to look into this yet, but definitely want to pick this one up as soon as I have some time.
When code is commented out, sticky scrolling incorrectly detects the line.
To reproduce this issue:
Under org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.CommentPosition.findFirstContent(CharSequence, int), some code is commented out.
In the method org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.CommentPosition.computeProjectionRegions(IDocument), there is some commented-out code.
Before the the commented out line:
And after:
The text was updated successfully, but these errors were encountered: