-
Notifications
You must be signed in to change notification settings - Fork 324
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
Add proposed window/progress extension #261
Conversation
I know you've done your work solely for VSCode. I'm thinking about how it would be incorporated into LSP for use by other editors as well. In editors where "progress" is indicated by a spinner on the status bar with text-only tooltips, how do you think the "title+message+percent" should be surfaced? This is a screenshot where two different LSP-providers are each providing their own progress report. The reason I ask is because I'm inclined towards an API where progress is solely reported by a single plain-text string, without breaking it up into title/message/percent. Some providers will find that a percentage number is a poor way of presenting the information. For instance, an C++ indexing provider might report I think that with your proposed split into message/percent, we'll end up in a world where 50% of providers report their progress with a custom piece of text inside the message like |
It should definitely work for all kinds of editors and it is up to the editor to display a spinner, a progress bar or show only the text. If the language server wants to update the message with
The language server is expected to provide both (as much info as possible) and then it's up to the client to decide what info to use/how to display it. |
@felixfbecker Imagine if this PR goes ahead in its current form. Then I think few LSP servers will emit both I think the idea "it's up to the client to decide" only goes so far. Because LSP servers will alter themselves to look good on the dominant client. |
@ljw1004 while I recognize how you may feel about it, I think this minimal solution finds a good balance between giving freedom for the LSP clients and providing more ability to programatically inspect the given value. I think it's worth noting that separating current/total and the percentage is sometimes desired:
That's why I think providing both optional message and optional percentage allows for more and is concise and simple enough for most cases. Maybe we could emphasize that |
@Xanewok Another possibility is to indicate that the percentage should be rolled into the message (1) always, (2) if no other progress indication is available, (3) never. But that's over-engineering. Actually I'm more concerned about |
I agree with @ljw1004 that it is not good to put the percentage into the title automatically in this "reference implementation". The percentage should only be used to update a deterministic progress indicator which VS Code has in other places: |
@ljw1004 yeah, I was just editing my response about the title. I agree with you that it may in fact be too specific here. I left it here, since it was in the original proposal and VSCode is capable of using it. Here's a screen: @felixfbecker agreed, I saw only |
@felixfbecker actually I'm not sure about the exposed API, not much of a TS/VSCode dev myself, mind pointing out how can I also include the percentage there? vscode.d.ts API doesn't seem to expose the percentage, while the implementation has it? |
It seems the number progress was initially meant for use in the now deprecated Given the number is contentious maybe we should exclude it for now? I only included it in the linked PR because at the time I proposed it, I was matching the functionality of vscode. Allowing developers to report back numbers for progress gives me unpleasant dreams back to file copy dialogs in Windows XP. |
Would be fine for me to implement it with only supporting indeterministic progress indicators for now, we can add it later as a backwards-compatible change |
The next question is: once we remove In the screenshot you appeared to show two different UXs:
First, the ability to display the text in the status-bar seems extraordinary. In our environment we commonly have several progress messages all at once, e.g. I propose removing the current
My thinking is that to fit into the status-bar we LSP-server-authors will have to craft our messages with extraordinary care and compactness. And even to fit into a datatip we still need to craft our messages carefully to be brief enough and actionable enough. Crafting those two things effectively is difficult and we shouldn't be hamstrung. |
Should the percentage in the displayed message in the reference
implementation not be included there, then?
Also about providing a title in the params, what are your opinions? Do you
think it can be actually useful or is it too specific?
In the specific case of Rust Language Server we have 2 operations, one
executed after another: Compiling a diagnostic build and processing
analysis data, so I assume we could stick a "Compiling" and "Processing"
titles for those appropriately, but since the messages will probably also
include that information, I think it seems redundant, and in general case I
can't still think of a good use case for that.
…On Mon, 9 Oct 2017 at 23:15, Felix Becker ***@***.***> wrote:
Would be fine for me to implement it with only supporting indeterministic
progress indicators for now, we can add it later as a backwards-compatible
change
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC8y3VwihUUnbpvvm3EP6jNoam3PdV4tks5sqozmgaJpZM4PxtoN>
.
|
@ljw1004 I don't see a difference in content between |
@felixfbecker - you anticipated my next suggestion, which is that the LS itself should be responsible for putting the name of the LS into the message. In the PR, the tooltip is a concatenation of (1) LS id, (2) title, (3) message, (4) percent. I think the LS should be able to decide how to display the ID itself. Given this, if message is completely empty, the user won't even know which LS or other service it was that produced the spinner. |
@ljw1004 thanks for the condensed status bar suggestion!
We can change the names of the passed values and/or update documentation to better reflect its intended usage, but with these values any given LSP client has all the appropriate information to present it in a convenient and descriptive manner. Regarding the LS ID, I think it's entirely up to the client how or if at all, does it show the origin of the progress indication and the indication itself. In this reference client implementation, the VSCode
I have no idea how to do that, so if we were to get rid of the default |
@Xanewok I think it will be hard to pull off. You try it... write down five example progress reports with title+message+percentage divided up in such a way that (1) title+percent looks good, (2) title+message+percent looks good, (3) Title alone looks good, (4) Message alone looks good. I don't think it can be done! I myself tinkered with my progress reports off and on over a month to make them as compact and actionable as possible. Here are the ones I came up with:
I don't know how I'd divide those into languageId/title/message/percent effectively. |
@ljw1004 I hope I didn't come off as rude, I certainly didn't intend to and I hope I wasn't received as such! 😞 I'm a bit lost at this point - not sure if we're discussing the protocol itself or the reference VSCode implementation. Now onto what a client might do...
might be okay? In these cases you might present it as Initializing, Initializing (hh_server is initializing [naming]), hh_server is initializing each optionally with (X%) stuck at the end, or optionally using UI, and I think it looks good enough. As I said, clients such as Vim may only use the title itself, since their space is limited. GUI editors could detect if they need to condense the message and only display a title (optionally with a percentage/spinner?) and possibly provide a full name on hover (e.g. somewhat what VSCode also does). I would leave languageId out of it, since sometimes these progress reports can be presented in a separate window per each LS, or even have their own space at the status bar (e.g. VSCode) and so I think it's only fair for an extension to group related progresses and use only a single language id in a text format, if it needed - for example a Vim frontend might display:
if it had 4 tasks running for 3 different LSs, in this example. |
@Xanewok you've been the model of politeness and a very pleasant person to discuss with! Following your reference implementation, this is what people will see when they hover over the progress indicator:
The middle two look wrong. Users will immediately file bugs that say "Why is the word 'indexing duplicated? Why is the word 'checking' duplicated?" And so the language server developer will immediately be forced to omit the word from the title so as to look good in your reference VSCode implementation -- with the knock-on effect that they now look bad on clients which chose to display only the title. Or vice versa, they'll be forced to omit the word from the message -- and so will now look bad on clients which chose to display only the message. |
I'm very much open to changing the reference implementation! Frankly I wanted to have something simple working and reiterate from there. I agree that currently it does not look really good and needs to change. What I'm more worried about is the |
Now percentage is not included as text in any messages, also not using title feature in the API to prevent weird/duplicated For context: (incl. couple of issues, along with reasoning on the current |
@Xanewok @ljw1004 @felixfbecker thanks a lot for the very lively discussion. Highly appreciated! I read through all comments. May be it would make sense to look at the problem from a user perspective as well. From my experience so far with building progress APIs users are usually interested in the following things: Progress to know when things are done:
Progress Details:
I haven't thought about the necessary protocol we need and the UI implementation to best support this. |
Saying percentage === undefined is I am still not convinced that a time traveling progress monitor is something users appreciate. I usually dislike them very much :-) And I do think that not thinking about how cancellation works in this scenario is a bad idea. If we have a progress API it should be usable for client initiated requests as well where cancellation does make sense. Consider the case where find all reference is based on an index which needs to be updated when first executed. If this takes a long time and a users doesn't want to wait for the result I think he appreciate being able to cancel them (Eclipse for example supports this nicely). I agree that this is not important for server initiated progress reporting. But I don't want to end up with two stories. I will make a proposal how that should work. |
Even |
Is this blocked on CI and rebase? I'll fix this today. Should I change anything here before it's considered to be merged? |
@Xanewok it is on my April plan. I will do some additional work to report progress per request as well since this is requested for other clients. But that is orthogonal to the report progress from server handled here. Having a mergable PR would definitelly be appreciated. |
Additionally, this requires for the title to be specified.
6a84521
to
2853b6e
Compare
@dbaeumer done, rebased and fixed the PR. |
I looked at other tools how they report progress and all possible different kinds exists:
Since they all have pros and cons it doesn't really matter which one we pick. So I decided to stay with the percentage since it is indeed easy to compute. However I will add the following things:
|
I will merge the PR and then make the changes on master. |
Awesome, thank you! 🎉
Definitely agree with these, seems reasonable =) |
This proposes a simple
window/progress
server -> client notification that's been described in microsoft/language-server-protocol#245. I tried to follow contributing.md as closely as possible, however it's possible I missed something. Additionally I'm not a TS/JS dev, so if there are any concerns for the client implementation, I'm more than open to changing it accordingly.I think it's a simple but often requested feature and it'd be good to land it, at least with a simple initial version to gather proposal and improve upon it.
cc @felixfbecker this proposes the sourcegraph/language-server-protocol@8986486.