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

break DI cycle between LabelProvider and its contributions #6608

Merged
merged 1 commit into from
Nov 23, 2019

Conversation

akosyakov
Copy link
Member

What it does

See #5884 (comment)

LabelProvider tries to create contributions during instantiation, but some contributions need LabelProvider, so it goes forever.

The cycle is broken by moving creation of contributions to the frontend application initialization, so after an instance of LabelProvider is created.

How to test

Build, start the app and check that the browser console does not

Review checklist

Reminder for reviewers

@akosyakov akosyakov added the core issues related to the core of the application label Nov 22, 2019
@@ -98,14 +99,20 @@ export class DefaultUriLabelProviderContribution implements LabelProviderContrib
}

@injectable()
export class LabelProvider {
export class LabelProvider implements FrontendApplicationContribution {
Copy link
Member Author

@akosyakov akosyakov Nov 22, 2019

Choose a reason for hiding this comment

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

I could extract another class to avoid adding initialize as public API to LabelProvider, something like LabelProviderContributions. LabelProvider will use it to find contributions listen to its changes. Should I?

Copy link
Contributor

@svenefftinge svenefftinge left a comment

Choose a reason for hiding this comment

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

LGTM

@akosyakov akosyakov merged commit 145f913 into master Nov 23, 2019
@akosyakov akosyakov deleted the ak/break_di_cycle branch November 23, 2019 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core issues related to the core of the application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants