-
Notifications
You must be signed in to change notification settings - Fork 200
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
introduce FinalLineCodeMining to draw minings at the end of the document #2785
base: master
Are you sure you want to change the base?
introduce FinalLineCodeMining to draw minings at the end of the document #2785
Conversation
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/FinalLineCodeMining.java
Outdated
Show resolved
Hide resolved
49acb5e
to
ee768a5
Compare
* | ||
* @since 3.27 | ||
*/ | ||
public class DocumentFooterCodeMining extends LineHeaderCodeMining { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it confusing that DocumentFooterCodeMining is actually a LineHeaderCodeMining. Would it be possible/good to remove this relationship?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please review change 3a5f096 ? I updated the class hierarchy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please rebase? There are merge conflicts
3a5f096
to
0632c5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we now have two new classes that are part of the API? Is this by intention?
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineHeaderCodeMining.java
Outdated
Show resolved
Hide resolved
@@ -76,23 +72,4 @@ public LineHeaderCodeMining(Position position, ICodeMiningProvider provider, Con | |||
throws BadLocationException { | |||
super(position, provider, action); | |||
} | |||
|
|||
@Override | |||
public Point draw(GC gc, StyledText textWidget, Color color, int x, int y) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this method (with the exact same signature is now inherited from the new super-class?
Is this a compatible chang?
there are errors in the build that seem to be unrelated to this change:
What's the issue here? Does anybody know? |
See eclipse-platform/eclipse.platform.releng.aggregator#2815 Should be hopefully fixed with the SDK built that should be there in few minutes |
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineHeaderCodeMining.java
Outdated
Show resolved
Hide resolved
/** | ||
* @since 3.27 | ||
*/ | ||
public class MultilineCodeMining extends AbstractCodeMining { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class seems to have very little logic in it. Instead of a new class in the hierarchy, couldn't it be a package-visible utility method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that you want me to correct the class hierarchy. And this is what I did with the latest change. Looks like that I misunderstood you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, a simpler class hierarchy was what I had in mind. But I'm afraid introducing new intermediary APIs doesn't make things simpler, both from consumer and maintainer POV. I would instead suggest that we try to have DocumentFooterCodeMining extends AbstractCodeMining
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have adapted the class hierarchy with 9ec8815 as you requested. Could you please check again? Thanks.
I've retriggered build. If it fails now, will be due something different issue. |
0632c5d
to
eb071a9
Compare
eb071a9
to
9ec8815
Compare
@mickaelistria: Can you pls. have a look at the new state? |
import org.eclipse.jface.text.source.ISourceViewer; | ||
|
||
/** | ||
* @since 3.27 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some documentation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javadoc added with 7ff665e
9ec8815
to
7ff665e
Compare
It is currently not possible to render a Line Code Mining at the very end of the document when the last character is not a line break. This pull request introduces the class FinalLineCodeMining which allows to achieve this requirement.