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

fix workspace preference provider #2083

Merged
merged 1 commit into from
Jun 12, 2018

Conversation

akurinnoy
Copy link
Contributor

If Theia starts without opened workspace then method getUri() of WorkspacePreferenceProvider returns a promise which never becomes resolved. Hence, WorkspacePreferenceProvider can't be initialized as well.

Signed-off-by: Oleksii Kurinnyi okurinny@redhat.com

@akurinnoy akurinnoy requested a review from akosyakov June 9, 2018 08:59
@@ -25,6 +25,13 @@ export abstract class AbstractResourcePreferenceProvider extends PreferenceProvi
@postConstruct()
protected async init(): Promise<void> {
const uri = await this.getUri();
Copy link
Member

Choose a reason for hiding this comment

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

please update a return type of getUri accordingly, i.e. MaybePromise<URI | undefined>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -22,7 +22,7 @@ export class WorkspacePreferenceProvider extends AbstractResourcePreferenceProvi
const rootUri = new URI(root.uri);
return rootUri.resolve('.theia').resolve('settings.json');
}
return new Promise<URI>(() => { });
return new Promise<URI>(resolve => resolve());
Copy link
Member

Choose a reason for hiding this comment

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

return undefined;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
@akurinnoy
Copy link
Contributor Author

@akosyakov review, please

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

thx!

@akurinnoy akurinnoy merged commit 56b94e6 into eclipse-theia:master Jun 12, 2018
@akurinnoy akurinnoy deleted the fix-preference-provider branch July 30, 2019 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants