yaml-language-server
yaml-language-server copied to clipboard
hover has ` ` around each character
Describe the bug
When triggering hover, the response from the server has   around each character in the contents value. This causes neovim to display it with spaces around each character:
Here is the output from neovim's LSP log
[DEBUG][2023-05-15 14:19:39] .../lua/vim/lsp.lua:1392 "LSP[yamlls]" "client.request" 1 "textDocument/hover" {
position = {
character = 0,
line = 1
},
textDocument = {
uri = "file:///home/kmoschcau/Code/[REDACTED]/.yamllint.yaml"
}
} <function 1> 1
[DEBUG][2023-05-15 14:19:39] .../vim/lsp/rpc.lua:284 "rpc.send" {
id = 5,
jsonrpc = "2.0",
method = "textDocument/hover",
params = {
position = {
character = 0,
line = 1
},
textDocument = {
uri = "file:///home/kmoschcau/Code/[REDACTED]/.yamllint.yaml"
}
}
}
[DEBUG][2023-05-15 14:19:39] .../vim/lsp/rpc.lua:387 "rpc.receive" {
id = 5,
jsonrpc = "2.0",
result = {
contents = {
kind = "markdown",
value = " # # # #   E x t e n d s \n \n S o u r c e :   [ y a m l l i n t . j s o n ] ( h t t p s : / / j s o n . s c h e m a s t o r e . o r g / y a m l l i n t . j s o n ) "
},
range = {
["end"] = {
character = 7,
line = 1
},
start = {
character = 0,
line = 1
}
}
}
}
[TRACE][2023-05-15 14:19:39] ...lsp/handlers.lua:618 "default_handler" "textDocument/hover" {
ctx = '{\n bufnr = 1,\n client_id = 1,\n method = "textDocument/hover",\n params = {\n position = {\n character = 0,\n line = 1\n },\n textDocument = {\n uri = "file:///home/kmoschcau/Code/[REDACTED]/.yamllint.yaml"\n }\n }\n}',
result = {
contents = {
kind = "markdown",
value = " # # # #   E x t e n d s \n \n S o u r c e :   [ y a m l l i n t . j s o n ] ( h t t p s : / / j s o n . s c h e m a s t o r e . o r g / y a m l l i n t . j s o n ) "
},
range = {
["end"] = {
character = 7,
line = 1
},
start = {
character = 0,
line = 1
}
}
}
}
Expected Behavior
It should not add   to the contents value.
Current Behavior
It adds   to the contents value.
Steps to Reproduce
- Have
yaml-language-serverinstalled and in your path - Download minimal neovim config with
curl -fLO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua - Create a
.yamllint.yamland open it withnvim -nu minimal_init.lua .yamllint.yaml - Add
extends: defaultto the first line - Go to normal mode, move the cursor over
extendsand pressK.
Environment
- [ ] Windows
- [ ] Mac
- [ ] Linux
- [X] other (Windows 10 21H2 (19044.2965) / WSL 1.2.5.0 / Ubuntu 20.04.6 LTS)
I am not familiar with neovim. Is neovim rendering this content as markdown?
seems like a duplicate of https://github.com/redhat-developer/yaml-language-server/issues/875
It is rendering it as markdown, yes.
@gorkem it seems there is also a discussion going on about this on the PR that introduced this: #844
This behavior is also reproducible with the emacs's lsp-mode.
I have just downgraded to 1.11.0 as an workaround currently.