microsoft/language-server-protocol

What's the correct way for an LSP server to know whether a command is available on the client?

Open

#642 建立於 2018年12月17日

在 GitHub 查看
 (43 留言) (1 反應) (0 負責人)HTML (956 fork)batch import
commandsfeature-requesthelp wanted

倉庫指標

Star
 (12,810 star)
PR 合併指標
 (平均合併 19小時 29分鐘) (30 天內合併 12 個 PR)

描述

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).

However, I can't find a way for the client to advertise (or server to know) which commands are supported on the client.

What'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.

貢獻者指南