aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorChris Kipp <ckipp@pm.me>2021-01-18 10:13:26 +0100
committerGitHub <noreply@github.com>2021-01-18 10:13:26 +0100
commit1a4d380b5abfff2cf5e46a1b00e98f4381b7e5b0 (patch)
tree62fab87bdd18b2704c6033d496b4c2ba2f77b7df /runtime/lua/vim
parent6d659bb338ee6cdb604b1d69404542e8d05aca55 (diff)
downloadrneovim-1a4d380b5abfff2cf5e46a1b00e98f4381b7e5b0.tar.gz
rneovim-1a4d380b5abfff2cf5e46a1b00e98f4381b7e5b0.tar.bz2
rneovim-1a4d380b5abfff2cf5e46a1b00e98f4381b7e5b0.zip
LSP: Add in clientInfo to initalize_params. (#13757)
* Add in clienInfo to initalize_params. Some servers (like Metals in my case) will actually pull this info from the initalize_params and display it in the logs. I know from the server perspective it helps at times to have this available to pull from to have more details about the client and version. You can see that this is part of the spec here: microsoft.github.io/language-server-protocol/specification#initialize
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/lsp.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 1a814f5b6c..9e05eeae89 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -582,12 +582,19 @@ function lsp.start_client(config)
local valid_traces = {
off = 'off'; messages = 'messages'; verbose = 'verbose';
}
+ local version = vim.version()
local initialize_params = {
-- The process Id of the parent process that started the server. Is null if
-- the process has not been started by another process. If the parent
-- process is not alive then the server should exit (see exit notification)
-- its process.
processId = uv.getpid();
+ -- Information about the client
+ -- since 3.15.0
+ clientInfo = {
+ name = "Neovim",
+ version = string.format("%s.%s.%s", version.major, version.minor, version.patch)
+ };
-- The rootPath of the workspace. Is null if no folder is open.
--
-- @deprecated in favour of rootUri.