Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

More consistently handle AtomPolymer's lifecycle. #24

Merged
merged 2 commits into from
Oct 25, 2016
Merged

Conversation

rictic
Copy link
Contributor

@rictic rictic commented Oct 22, 2016

Fixes #16

@TimvdLippe
Copy link
Contributor

I did not encounter the original bug, but this change seems fine to me.

this.autocompleter = null;
this.editorService = null;
this.linter = new Linter();
this.autocompleter = new Autocompleter();

Choose a reason for hiding this comment

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

This feels very counter-intuitive. Need comment to explain why deactivate creates new things.

While this fixes the problem for the setProjectPaths call, I would expect the nullifying to be correct here and the initialization to new instances of Linter/Autocompleter to take place in the activate since activate is what triggered these and activate was in the stacktrace too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1, good point. This is easier to understand and easier to reason about. I was worried that provideLinter or provideAutocompleter might be called before activation, but in hindsight that seems like it totally shouldn't happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PTAL

Copy link

@usergenic usergenic left a comment

Choose a reason for hiding this comment

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

LGTM

@rictic rictic merged commit c57d796 into master Oct 25, 2016
@rictic rictic deleted the better-lifecycle branch October 25, 2016 21:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants