redhat-developer / redhat-developer/yaml-language-server
hover has ` ` around each character
Open
Nobody has claimed this yet.
bug
duplicate
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
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
- other (Windows 10 21H2 (19044.2965) / WSL 1.2.5.0 / Ubuntu 20.04.6 LTS)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using minimal_init.lua, a .yamllint.yaml containing extends: default, and Neovim's textDocument/hover request. Inspect the hover response and trace where its contents value is produced. Done means the response no longer inserts   around each character.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100