-
Notifications
You must be signed in to change notification settings - Fork 44
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
API to Track TextViewer install/uninstall #107
API to Track TextViewer install/uninstall #107
Conversation
@angelozerr you need to fix the API errors:
|
0678e5e
to
baa001c
Compare
Thanks @laeubi for your feedback. It should be fixed now. |
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 looks good, but wait for @mickaelistria as he is our API-Guardian here :-)
baa001c
to
f1befb6
Compare
I update the since to
Yes sure! As .editorconfig support is a big PR, I try to create little PR to speed the merge. |
@laeubi the build fails again, I'm a little lost, could you help me to fix it please. Thanks! |
@angelozerr in general I search the (full) Console log for "[API ERROR] " https://ci.eclipse.org/platform/job/eclipse.platform.text/job/PR-107/3/consoleFull If you use the Eclipse SDK you should also see API error in the IDE, if not @merks might can help / advice why those not sho up. |
org.eclipse.jface.text/src/org/eclipse/jface/text/ITextViewerLifecycle.java
Show resolved
Hide resolved
9238e62
to
a5c5564
Compare
@szarnekow I updated my PR to use ITextViewerLifecycle with generic editor. I created a PR on LSP4e side which consumes this API eclipse-lsp4e/lsp4e#272 |
34bbf1b
to
2b25171
Compare
2b25171
to
bd18dd4
Compare
I actually likes the first version of the patch better, particularly the part that factors the ITextLifecycle in existing reconcilers or others as it already emphasizes a lot of benefit in this factorization. |
@mickaelistria if I understand correctly your comment you would prefer that ITextViewerLifecycle belongs to jface text? So it means that The existing |
Just to be clear, what is the purpose of this API? Is it to allow more of existing contributions that support and install/uninstall pattern just like Reconcilier or ContentAssistProcessor already do, or to provide something new? If it's the former, I don't think you need more logic than adding |
The both, but for LSP4e usecase, I would say "provide something new" |
My main goal is to track install / uninstall of ITextViewer for any contribution of genereic editor. I mean for IReconciler (which have already install / uninstall), but too for IAutoEditingStrategy (which have not install / uninstall methods). When you write a custom TextEditor (without generic editor), you need sometimes ITextEditor or track install / unisntall of ITextViewer. It is easy to do that since you can override SourceViewer or another component. With generic editor you cannot do that, it is the main goal of ITextViewerLifecycle and the another API ITextEditorAware #108 Now the question is where host those 2 APIs?
In other words I think more and more that ITextViewerLifecycle and ITextEditorAware should be hosted in genereic editor plugin. I'm waiting for your feedback to clean the both APIs. |
I don't think the comment says the idea is a bad one, but more that some documentation/usage of the new API is missing for it to feel complete. It's the same thing I tried to mention in my comment where I suggest we check for
The generic editor isn't meant to provide new Text APIs, JFace Text is the right place for APIs; Generic Editor just allows to contribute some extra behavior to the generic editor. The description of the use-case can make sense in other editors, use-cases than the generic editor. Usually the workaround is to pass directly a reference to the viewer when creating such a contributor, but it's actually not best for reusability, the suggested interface would also allow to improve existing cases that are independant from the generic editor. |
@mickaelistria is #107 (comment) will follow your idea? |
I don't think we need a new API method in SourceViewer for the moment, but just checking for |
bd18dd4
to
fcc2033
Compare
f470b2a
to
29d381e
Compare
public interface ITextViewerLifecycle { | ||
|
||
/** | ||
* Installs a text viewer. |
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 clarify whether implementors should expect more than one install(..) call with / without uninstall invocations.
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 explain when install / uninstall is called. Hope it will be enough. If no please give me some suggestion.
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, I like it. This is the kind of comment and handling of the new API that I expected to happen.
org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/MonoReconciler.java
Outdated
Show resolved
Hide resolved
org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java
Outdated
Show resolved
Hide resolved
@angelozerr I like it a lot as well in this current form. Please address @szarnekow 's comment and then we'll try to get this API addition merged ASAP (we're starting the RC phase, so we'll need some lobbying first but as it's backward compatible and the case is very well built with clear needs and various proposals were discussed to reach a consensus, I'm optimistic the development process and result are correct enough for a merge in RC). |
6ab3561
to
70fb8ae
Compare
I try, hope CI build will work. |
70fb8ae
to
d22a9ce
Compare
Cool!
I tried to fix all comments. |
I don't get the API Tools issue here, it seems pretty wrong. Locally, I don't see this issue, either in the IDE nor in a Maven build with the right profiles triggered; the message gives me the impression an older version is used as baseline. |
@vik-chand can you help here? Error is
@mickaelistria can you explain why you think this is bogus? |
Just from the code, maybe when an interface extends the new interface, instead of |
I fetched this pr on latest eclipse and I get This is because the manifest changed the version and few weeks ago, there was an API added with since 3.21. So that should be changed to since 3.22 ( assuming we want this version) So I skipped this error locally and I couldn't get further API tools error. The expanded interface warning comes when an API interface has another interface added somewhere in its hierarchy and now available to its clients. I remember also making a change where in if the added interface breaks the client, then it will require a major version change. If a change should report a error but doesn't in IDE, I think we need to fix it in IDE. |
@vik-chand thanks. I was looking at the commit date and not the merge date and didn't realize that the addition of |
@mickaelistria I'm little lost, I have |
d22a9ce
to
4426e8c
Compare
@angelozerr Can you please rebase on top of master and adapt the MANIFEST and |
4426e8c
to
898f348
Compare
Signed-off-by: azerr <[email protected]>
898f348
to
8dc80eb
Compare
Thank you! |
Please remember about adding a note to the N&N doc some time later (no need to rush) |
@@ -422,7 +428,7 @@ public SourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRul | |||
fIsVerticalRulerVisible= (verticalRuler != null); | |||
fOverviewRuler= overviewRuler; | |||
fIsOverviewRulerVisible= (showAnnotationsOverview && overviewRuler != null); | |||
|
|||
this.lifecycles= new HashSet<>(); |
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 seems to cause a memory leak in our Xtext Content assist test:
as the reconciler will now be uninstalled after the content assistant.
and thus additional JobInfos will be created for reconciler job
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.
fReconciler= null; | ||
} | ||
uninstallTextViewer(); | ||
fPresentationReconciler= null; |
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.
@angelozerr @szarnekow my this nulling cause the problem we see in test?
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 created a new PR #123 to fix this issue. This PR should keep the same behavior than before.
API to Track TextViewer install/uninstall
Signed-off-by: azerr [email protected]
My motivation to provide this API is