-
Notifications
You must be signed in to change notification settings - Fork 818
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 a request so that the server can ask the client for user input #1641
Comments
I am actually against this. Knowing what I know today I would not add |
Completely agree with @dbaeumer on this. I think server micromanagement of the UI is a bad pattern. |
Maybe my proposal wasn't clear. Unlike I didn't know that LSP is designed to be UI free but then I don't get why Code Lens Request , Rename Request or Code Action Request for example are part of the spec when they require some form of UI from the client.
Depending on server specific context, I can imagine something like this :
It is fine to think this is a bad pattern but IMO it should be also up to the server developer to choose how they want to design their interactions with the user. |
What about the cases when the server actually knows something more than the editor and needs some additional version? For example, we haven't specified the version of the formatting tool and let's say it's necessary. There is no way of getting that information through the formatting request and the editor doesn't know there needs to be a version. We can just fail and send a message to the client that they need to add it (without showMessage, we wouldn't be able show a nice error, we would just fail). This overall isn't a great experience for the user, so the server maintainers will come up with an additional method for LSP and this might happen for a bunch of extensions/servers. So instead of having a single request that allows for some flexibility, we have multiple extensions for each language implementing the same thing. Besides, don't all the request need some kind of UI? The editor is UI, any existing kind, code actions need dispalying, rename needs a new name, maybe extract value might need some additional UI at some point . Are there any actual servers that are used without a client editor? Wouldn't it be enough to have it behind a capability? Overall, I totally understand that we can't just put any request into the LSP standard and I fully understand if you choose never to implement this. But I wonder if it's not being strict strictness sake and maybe LSP can be more flexible so that multiple client extensions don't invent the wheel again. |
My main complaint in regards to Looking at some of the eclipse.jdt.ls extensions, it looks like most are tied to code actions and have to do with choosing one of multiple options. Examples:
They all follow a pretty similar pattern. Maybe some of that could be generalized into a new capability for code actions. For example one that allows Another alternative could be to extend |
Something like discussed here covers most of those cases I think (i.e. additional metadata on the I would personally avoid adding complexity to |
I see all the use cases but adding UI messages to LSP is IMO the wrong path. The rename refactoring for example added an additional I am not saying that a general UI framework could be beneficial, but such a framework shouldn't be part of LSP. It should be speced separately and clients would be able to use it in combination with LSP. |
There is JSON Forms that could fit (and LSP could just have some operation like |
Couldn't the server run the validation? |
Hello,
is it possible to add to the specification a request sent from the server to the client allowing the user to provide a string value for a given prompt ?
It would be very similar to ShowMessageRequest but without the
actions
items, the client would have to reply with a string value provided by the user.Metals has an LSP extension that does this called Inputbox and is used for various commands as a follow up to server commands.
I don't know if other servers have a similar extension but I think it make sense to add it.
The text was updated successfully, but these errors were encountered: