ansible-language-server icon indicating copy to clipboard operation
ansible-language-server copied to clipboard

Messages originated from ASL should use language-server-protocol: notificationMessage

Open ssbarnea opened this issue 3 years ago • 3 comments

After investigation made with @webknjaz yesterday, we concluded that use of showInformationMessage() or showErrorMessage() inside the language server is wrong as this would prevent use of the language-server on other editors than vscode.

Apparently language-server-protocol has an api that can be used for this use case: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#notificationMessage

The idea is that the ASL should produce the notification and is up to the extension to process it or not. Is not mandatory for each client to implement ability to process these notifications from the language server and that is ok.

One example of processing notifications can be see at https://github.com/redhat-developer/vscode-java/blob/master/src/standardLanguageClient.ts#L152-L181

It worth mentioning that this info was provided by our friends from #devtools-vscode channel from coreos slack instance.

Anyone is welcomed to work on addressing this, just add a comment.

ssbarnea avatar Sep 09 '21 12:09 ssbarnea

@yaegassy, does this issue affect your dev for the vim extension ?

priyamsahoo avatar Nov 08 '21 13:11 priyamsahoo

@priyamsahoo Hmm, I don't know if this change will affect the Vim extension.

Vim has a variety of LSP client plugins (extension), such as coc.nvim, vim-lsp, and Neovim built-in LSP. Since coc.nvim is a VSCode-like LSP client, client-side adjustments may be relatively easy to handle.

vim-lsp and Neovim built-in LSP and other LSP clients basically only allow you to start the Langauge server and configure the settings related to the startup (configuration options, initializationOptions, etc.). In fact, you could add the ability to handle notifications on the client side, but it may not be easy.

If the addition of the ability for each client to handle notifications is not mandatory, but optional, and it is not a core feature of ASL, then of course it would not be a problem.

yaegassy avatar Nov 08 '21 14:11 yaegassy

Ah alright. Thanks for the feedback @yaegassy :)

priyamsahoo avatar Nov 09 '21 04:11 priyamsahoo

I this is already implemented now, that i how we send info about enviorment.

ssbarnea avatar Aug 23 '22 20:08 ssbarnea