yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
461 stars 54 forks source link

window/showMessageRequest doesn't work right? #537

Open hoclun-rigsep opened 2 months ago

hoclun-rigsep commented 2 months ago
Sent {'method': 'workspace/executeCommand', 'params': {'arguments': ['file:///Users/jim/proj/CD30/src/ambergj/CD30/CD30.clj', 23, 1], 'command': 'create-test'}}
Received {'method': 'window/showMessageRequest', 'jsonrpc': '2.0', 'id': 18, 'params': {'actions': [{'title': '/Users/jim/proj/CD30/test'}, {'title': '/Users/jim/proj/CD30/src'}, {'title': '/Users/jim/proj/CD30/resources'}], 'message': 'Choose a source-path to create the test file', 'type': 3}}
Sent {'id': 18, 'jsonrpc': '2.0', 'result': null}
Received {'id': 953, 'jsonrpc': '2.0', 'error': {'code': -32600, 'message': 'Nothing to change.'}}

Looks like the server is trying to prompt me for input here but it doesn't.

Shane-XB-Qian commented 2 months ago
Sent {'method': 'workspace/executeCommand', 'params': {'arguments': ['file:///Users/jim/proj/CD30/src/ambergj/CD30/CD30.clj', 23, 1], 'command': 'create-test'}}
Received {'method': 'window/showMessageRequest', 'jsonrpc': '2.0', 'id': 18, 'params': {'actions': [{'title': '/Users/jim/proj/CD30/test'}, {'title': '/Users/jim/proj/CD30/src'}, {'title': '/Users/jim/proj/CD30/resources'}], 'message': 'Choose a source-path to create the test file', 'type': 3}}
Sent {'id': 18, 'jsonrpc': '2.0', 'result': null}
Received {'id': 953, 'jsonrpc': '2.0', 'error': {'code': -32600, 'message': 'Nothing to change.'}}

Looks like the server is trying to prompt me for input here but it doesn't.

yea, i implemented this 'showMessageRequest', but seems 'actions' selection was not a good behavior to vim specially when vim just startup, so so far it just a showMessage.

-- shane.xb.qian

hoclun-rigsep commented 2 months ago

On Wed, Jul 10, 2024 at 08:27:13AM -0700, Shane-XB-Qian wrote:

yea, i implemented this 'showMessageRequest', but seems 'actions' selection was not a good behavior to vim specially when vim just startup, so so far it just a showMessage.

Do you see a way forward with this? Seems like a lot of LSP functionality lies behind having the user provide input or choose from a set of options (as here).

Shane-XB-Qian commented 2 months ago

you are welcome to impl it by your own stable verifies without break.

-- shane.xb.qian

hoclun-rigsep commented 2 months ago

On Wed, Jul 10, 2024 at 05:19:18PM -0700, Shane-XB-Qian wrote:

you are welcome to impl it by your own stable verifies without break.

Believe me, I really would like to do so—what better way to repay your work on this—but I cannot take the time to learn vimscript and vim internals at present.

If there's anything I can do to help short of implementing it myself, let me know.