LSP/hover: Do not throw away contents if first line is empty (#11939)

haskell-ide-engine sends `hover` payloads as follows:

    {
      contents = {
        kind = "markdown",
        value = "\n```haskell\nfoo :: Either String (Integer, Text)\n```\n`foo` *local*"
      },
      range = {
        end = {
          character = 5,
          line = 57
        },
        start = {
          character = 2,
          line = 57
        }
      }
    }

`value` starts with `\n`. The logic in `convert_input_to_markdown_lines`
threw away the whole information.
This commit is contained in:
Mathias Fußenegger
2020-02-27 00:00:06 +01:00
committed by GitHub
parent ad745f9da2
commit cb8b9428ca

View File

@@ -269,7 +269,7 @@ function M.convert_input_to_markdown_lines(input, contents)
end
end
end
if contents[1] == '' or contents[1] == nil then
if (contents[1] == '' or contents[1] == nil) and #contents == 1 then
return {}
end
return contents