-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Leverage notification progress support for progress API #45958
Conversation
cc @aeschli as
Like how? I can always call |
That could be Btw it seems to me that
Well this is always a relative value to the value already reported, never an absolute one (as the |
That makes sense but then your sample doesn't because What I don't like is that the total and worked information isn't contained nicely. Once piece knows the total and the Progress knows the increment... |
@jrieken but isn't a model where you provide Agree that you can easily fool the API by reporting more work done than actually present in
I think one concept that Eclipse has, that we are not surfacing is being able to create |
Well, the question is if reported-values are increments or absolute values and I believe we both want increments, in my model total is just always 100 (therefore not needed and called percentage). From reading the eclipse doc, esp this:
I understand that worked is an absolute value and not increments. So, with total: 100 and with worked: 10, worked: 50, worked: 70 you have have 10%, 60%, and 130% and I believe eclipse gives you 10%, 50%, and 70% (and that's why there are SubProgressMonitors) |
Yes
We can do that. The remaining question is, what happens when some work is done and you report more work done. For example, let's assume there are 3 tasks
Model 1: add percentage to overall work done Model 2: add percentage relative to remaining work I think Model 1 is easier to use and explain to be honest. |
Model 1 - no question |
Remaining items up for discussion:
I personally think we should just remove the status bar entry in favour of showing it as a notification because:
I am unsure about conditionally enabling the cancel button via option. If we decide to replace the status progress with the notification, it would mean that each extension author that implements this API has to wire in the cancellation. Since we cannot expect extension authors to do this, the cancellation should probably be opt-in. |
You cannot really force them to honour the token. Yes, we can have an option to signal the UI to not show the cancel button and then pass a null-token.
Not sure - a message that pops into the editor area and an ambient message in the status bar are quite different. For instance, the progress message that TypeScript downloads d.ts-files is something I wouldn't wanna see in the editor area. |
@jrieken fair enough, I have pushed |
fixes #44090
@jrieken my attempt to support to show progress through notifications with:
percentage
) supportCancellationToken
) supportSome comments:
vscode.proposed
because the changes are rather minimal and an evolution of our existing API, so I hope we can keep this as stable when pushingProgressLocation.Prominent
?). We could also decide to just use this new way of notification for our existingProgressLocation.Window
. One advantage is that the user can easily see and manage multiple progress tasks running at the same time if presented as notificiation.Working Extension Sample