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

Use generic for providers with resolve methods #96955

Merged
merged 3 commits into from
May 11, 2020
Merged

Conversation

mjbvz
Copy link
Contributor

@mjbvz mjbvz commented May 5, 2020

Fixes #95852

Some of our providers have two phases: provide and resolve. This change updates the typings to make it clearer that the values returned by provider are passed into resolve.

Fixes #95852

Some of our providers have two phases: provide and resolve. This change updates the typings to make it clearer that the values returned by provider are passed into resolve.
@mjbvz mjbvz requested a review from jrieken May 5, 2020 00:10
@mjbvz mjbvz self-assigned this May 5, 2020
* @param token A cancellation token.
* @return The given, resolved code lens or thenable that resolves to such.
*/
resolveCodeLens?(codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;
resolveCodeLens?(codeLens: T, token: CancellationToken): ProviderResult<CodeLens>;
Copy link
Contributor Author

@mjbvz mjbvz May 5, 2020

Choose a reason for hiding this comment

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

I've kept ProviderResult<CodeLens> here because we don't require that resolve returns the same type of code lens it was given. Let me know if you think we should just make it ProviderResult<T> as well

@mjbvz mjbvz merged commit b1e9155 into master May 11, 2020
@mjbvz mjbvz deleted the provider-generic-api branch May 11, 2020 20:06
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2020
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.

[api] use of generic in providers
1 participant