Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hover has   around each character #881

Open
1 of 4 tasks
kmoschcau opened this issue May 15, 2023 · 6 comments
Open
1 of 4 tasks

hover has   around each character #881

kmoschcau opened this issue May 15, 2023 · 6 comments

Comments

@kmoschcau
Copy link

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:
grafik

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 = "&emsp;#&emsp;#&emsp;#&emsp;#&emsp; &emsp;E&emsp;x&emsp;t&emsp;e&emsp;n&emsp;d&emsp;s&emsp;\n&emsp;\n&emsp;S&emsp;o&emsp;u&emsp;r&emsp;c&emsp;e&emsp;:&emsp; &emsp;[&emsp;y&emsp;a&emsp;m&emsp;l&emsp;l&emsp;i&emsp;n&emsp;t&emsp;.&emsp;j&emsp;s&emsp;o&emsp;n&emsp;]&emsp;(&emsp;h&emsp;t&emsp;t&emsp;p&emsp;s&emsp;:&emsp;/&emsp;/&emsp;j&emsp;s&emsp;o&emsp;n&emsp;.&emsp;s&emsp;c&emsp;h&emsp;e&emsp;m&emsp;a&emsp;s&emsp;t&emsp;o&emsp;r&emsp;e&emsp;.&emsp;o&emsp;r&emsp;g&emsp;/&emsp;y&emsp;a&emsp;m&emsp;l&emsp;l&emsp;i&emsp;n&emsp;t&emsp;.&emsp;j&emsp;s&emsp;o&emsp;n&emsp;)&emsp;"
    },
    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 = "&emsp;#&emsp;#&emsp;#&emsp;#&emsp; &emsp;E&emsp;x&emsp;t&emsp;e&emsp;n&emsp;d&emsp;s&emsp;\n&emsp;\n&emsp;S&emsp;o&emsp;u&emsp;r&emsp;c&emsp;e&emsp;:&emsp; &emsp;[&emsp;y&emsp;a&emsp;m&emsp;l&emsp;l&emsp;i&emsp;n&emsp;t&emsp;.&emsp;j&emsp;s&emsp;o&emsp;n&emsp;]&emsp;(&emsp;h&emsp;t&emsp;t&emsp;p&emsp;s&emsp;:&emsp;/&emsp;/&emsp;j&emsp;s&emsp;o&emsp;n&emsp;.&emsp;s&emsp;c&emsp;h&emsp;e&emsp;m&emsp;a&emsp;s&emsp;t&emsp;o&emsp;r&emsp;e&emsp;.&emsp;o&emsp;r&emsp;g&emsp;/&emsp;y&emsp;a&emsp;m&emsp;l&emsp;l&emsp;i&emsp;n&emsp;t&emsp;.&emsp;j&emsp;s&emsp;o&emsp;n&emsp;)&emsp;"
    },
    range = {
      ["end"] = {
        character = 7,
        line = 1
      },
      start = {
        character = 0,
        line = 1
      }
    }
  }
}

Expected Behavior

It should not add &emsp; to the contents value.

Current Behavior

It adds &emsp; to the contents value.

Steps to Reproduce

  1. Have yaml-language-server installed and in your path
  2. Download minimal neovim config with curl -fLO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua
  3. Create a .yamllint.yaml and open it with nvim -nu minimal_init.lua .yamllint.yaml
  4. Add extends: default to the first line
  5. Go to normal mode, move the cursor over extends and press K.

Environment

  • Windows
  • Mac
  • Linux
  • other (Windows 10 21H2 (19044.2965) / WSL 1.2.5.0 / Ubuntu 20.04.6 LTS)
@gorkem
Copy link
Collaborator

gorkem commented May 15, 2023

I am not familiar with neovim. Is neovim rendering this content as markdown?

@gorkem
Copy link
Collaborator

gorkem commented May 15, 2023

seems like a duplicate of #875

@kmoschcau
Copy link
Author

It is rendering it as markdown, yes.

@kmoschcau
Copy link
Author

@gorkem it seems there is also a discussion going on about this on the PR that introduced this: #844

@psibi
Copy link

psibi commented Nov 29, 2023

This behavior is also reproducible with the emacs's lsp-mode.

@psibi
Copy link

psibi commented Nov 29, 2023

I have just downgraded to 1.11.0 as an workaround currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants