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

Replace specialized tracker code in formatters with general APIs #385

Merged
merged 1 commit into from
Nov 27, 2019

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Nov 27, 2019

Each tracker came with a burden on each formatter that used it that it had to be called at special times and in special ways. This change leverages some recently introduced interfaces so the trackers can take care of most needs themselves, simplifying the job of the formatters.

This includes breaking API changes to the trackers, but we've already made such changes in 2.3, and on the same basis that we aren't aware of any external users of it, it seems like a reasonable opportunity to simplify it.

The IProgress<T> tracker still has one special requirement because of when cleanup happens relative to the $/progress notifications, sadly. When we treat $/progress as just an ordinary method call it can be processed after the actual result from the method is received and its callback invoked, which creates a "lossy" progress report because any that are processed on the client after the result callback get dropped. So I ensure $/progress reporting happens directly from the formatter (as it was before) to avoid a significant change in behavior.

Each tracker came with a burden on each formatter that used it that it had to be called at special times and in special ways. This change leverages some recently introduced interfaces so the trackers can take care of most needs themselves, simplifying the job of the formatters.

This includes breaking API changes to the trackers, but we've already made such changes in 2.3, and on the same basis that we aren't aware of any external users of it, it seems like a reasonable opportunity to simplify it.

The IProgress<T> tracker still has one special requirement because of when cleanup happens relative to the $/progress notifications, sadly. When we treat $/progress as just an ordinary method call it can be processed *after* the actual result from the method is received and its callback invoked, which creates a "lossy" progress report because any that are processed on the client after the result callback get dropped. So I ensure $/progress reporting happens directly from the formatter (as it was before) to avoid a significant change in behavior.
@AArnott AArnott added this to the v2.3 milestone Nov 27, 2019
@AArnott AArnott requested review from jepetty and milopezc November 27, 2019 16:26
@AArnott AArnott self-assigned this Nov 27, 2019
@AArnott AArnott merged commit d51bd85 into microsoft:master Nov 27, 2019
@AArnott AArnott deleted the simplify branch November 27, 2019 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants