{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/language-server-protocol/issues/642","repository_url":"https://api.github.com/repos/Microsoft/language-server-protocol","labels_url":"https://api.github.com/repos/Microsoft/language-server-protocol/issues/642/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/language-server-protocol/issues/642/comments","events_url":"https://api.github.com/repos/Microsoft/language-server-protocol/issues/642/events","html_url":"https://github.com/Microsoft/language-server-protocol/issues/642","id":391765931,"node_id":"MDU6SXNzdWUzOTE3NjU5MzE=","number":642,"title":"Support that servers can ask for user input","user":{"login":"DanTup","id":1078012,"node_id":"MDQ6VXNlcjEwNzgwMTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1078012?v=4","gravatar_id":"","url":"https://api.github.com/users/DanTup","html_url":"https://github.com/DanTup","followers_url":"https://api.github.com/users/DanTup/followers","following_url":"https://api.github.com/users/DanTup/following{/other_user}","gists_url":"https://api.github.com/users/DanTup/gists{/gist_id}","starred_url":"https://api.github.com/users/DanTup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanTup/subscriptions","organizations_url":"https://api.github.com/users/DanTup/orgs","repos_url":"https://api.github.com/users/DanTup/repos","events_url":"https://api.github.com/users/DanTup/events{/privacy}","received_events_url":"https://api.github.com/users/DanTup/received_events","type":"User","site_admin":false},"labels":[{"id":256312685,"node_id":"MDU6TGFiZWwyNTYzMTI2ODU=","url":"https://api.github.com/repos/Microsoft/language-server-protocol/labels/feature-request","name":"feature-request","color":"708090","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Microsoft/language-server-protocol/milestones/3","html_url":"https://github.com/Microsoft/language-server-protocol/milestone/3","labels_url":"https://api.github.com/repos/Microsoft/language-server-protocol/milestones/3/labels","id":1825338,"node_id":"MDk6TWlsZXN0b25lMTgyNTMzOA==","number":3,"title":"Backlog","description":"","creator":{"login":"dbaeumer","id":1931590,"node_id":"MDQ6VXNlcjE5MzE1OTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1931590?v=4","gravatar_id":"","url":"https://api.github.com/users/dbaeumer","html_url":"https://github.com/dbaeumer","followers_url":"https://api.github.com/users/dbaeumer/followers","following_url":"https://api.github.com/users/dbaeumer/following{/other_user}","gists_url":"https://api.github.com/users/dbaeumer/gists{/gist_id}","starred_url":"https://api.github.com/users/dbaeumer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbaeumer/subscriptions","organizations_url":"https://api.github.com/users/dbaeumer/orgs","repos_url":"https://api.github.com/users/dbaeumer/repos","events_url":"https://api.github.com/users/dbaeumer/events{/privacy}","received_events_url":"https://api.github.com/users/dbaeumer/received_events","type":"User","site_admin":false},"open_issues":44,"closed_issues":13,"state":"open","created_at":"2016-06-14T07:55:01Z","updated_at":"2018-12-19T15:18:23Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2018-12-17T15:34:28Z","updated_at":"2018-12-19T15:52:44Z","closed_at":null,"author_association":"NONE","body":"I'm implementing some refactors where the server needs some input from the user. In order to get input from the user I'm going to need to trigger a command on the client that can ask the user for input (for example, by having a command in the client extension that can call window.showInputBox or some equiv).\r\n\r\nHowever, I can't find a way for the client to advertise (or server to know) which commands are supported on the client.\r\n\r\nWhat's the expected way to handle this? Although I can document the commands that a client needs to implement for specific functionality in the server, that's not very compatible - if I wanted to add new requirements in the future, I'd need to know if the connected client supports them."},"comment":{"url":"https://api.github.com/repos/Microsoft/language-server-protocol/issues/comments/448644221","html_url":"https://github.com/Microsoft/language-server-protocol/issues/642#issuecomment-448644221","issue_url":"https://api.github.com/repos/Microsoft/language-server-protocol/issues/642","id":448644221,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODY0NDIyMQ==","user":{"login":"DanTup","id":1078012,"node_id":"MDQ6VXNlcjEwNzgwMTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1078012?v=4","gravatar_id":"","url":"https://api.github.com/users/DanTup","html_url":"https://github.com/DanTup","followers_url":"https://api.github.com/users/DanTup/followers","following_url":"https://api.github.com/users/DanTup/following{/other_user}","gists_url":"https://api.github.com/users/DanTup/gists{/gist_id}","starred_url":"https://api.github.com/users/DanTup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanTup/subscriptions","organizations_url":"https://api.github.com/users/DanTup/orgs","repos_url":"https://api.github.com/users/DanTup/repos","events_url":"https://api.github.com/users/DanTup/events{/privacy}","received_events_url":"https://api.github.com/users/DanTup/received_events","type":"User","site_admin":false},"created_at":"2018-12-19T15:52:44Z","updated_at":"2018-12-19T15:52:44Z","author_association":"NONE","body":"> As said I am not a fan of starting to spec client commands for the above reasons. Even if clients advertise them we would need to specify what they are support to do. Or am I misunderstanding you?\r\n\r\nNo commands need specifying, this is just a mechanism for the server to know if a client extension implements some command that it can use in a code action.\r\n\r\nImagine some code action that needs some work on both the server and the client. The server wants to include the code action in its list with a command ID that exists on the client - but it wants to know the client has that command implemented, else it should exclude it.\r\n\r\nFor example, let's say my server gains the ability to identify when a referenced symbol is from a first-party package that is not imported in the users workspace. It wants to give a code fix for \"install package xxx\" but that action needs to be executed on the client (it's like nuget install, npm install, whatever). The LSP server can document that a client extension should implement the \"myext.packages.install\" command that takes a string argument of the package name, however there's no guarantee it exists because client extensions may have shipped before it existed.\r\n\r\nIf the client extension (when setting up LSP, or dynamically) can tell the server (in its capabilities) \"Hey, I have a `myext.packages.install` command\" then the server knows it's valid for it to include code actions for importing the packages.\r\n\r\n(note: I'm not doing package install, it just seemed like a convenient example that wasn't refactors, to avoid any confusion with whether the refactor APIs can/should be improved..)\r\n\r\nIs that any clearer? Is there a better way you think this should be handled?\r\n\r\n> I think requiring a client to be code specifically for a given feature in a server is a bad idea, and goes against the whole point of LSP.\r\n\r\nI somewhat agree - that's why I originally asked for being able to get input directly from the server. However, in hindsight I don't think the user experience would be great across editors if all requests for input had to be encoded into LSP messages. It'd be nice if an editor that has big fancy dialogs (eg. Visual Studio) can implement a nice dialog for the user, then send all the info in one go, while VS Code can use it's input boxes/quick picks/etc..\r\n\r\nTo get the best experience, I think it will sometimes be necessary for the client extension to implement some local functionality (and that's what my request for including commands in capabilities is for - to allow the server to be able to detect client functionality it can call)."}}
{"actor":{"display_login":"DanTup"}}