Skip to content

Commit

Permalink
Add serverInfo.version to initialize response
Browse files Browse the repository at this point in the history
This is useful to be able to display the version of the currently
attached server. See neovim/neovim#31611 for
example.

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initializeResult
  • Loading branch information
lithammer committed Dec 19, 2024
1 parent 7f76050 commit 8f9650e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased
<!-- Add all new changes here. They will be moved under a version at release -->
* `FIX` Incorrect infer for function array annotation on tables [#2367](https://github.com/LuaLS/lua-language-server/issues/2367)
* `CHG` Add server version information to `initialize` response #2996

## 3.13.4
`2024-12-13`
Expand Down
2 changes: 2 additions & 0 deletions script/provider/provider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ local furi = require 'file-uri'
local inspect = require 'inspect'
local guide = require 'parser.guide'
local fs = require 'bee.filesystem'
local version = require 'version'

require 'library'

Expand Down Expand Up @@ -128,6 +129,7 @@ m.register 'initialize' {
capabilities = cap.getProvider(),
serverInfo = {
name = 'sumneko.lua',
version = version.getVersion(),
},
}
log.debug('Server init', inspect(response))
Expand Down

0 comments on commit 8f9650e

Please sign in to comment.