In order to support this feature of the LSP spec, I added a check to see if the content received was a string, and if so treat it as a valid MarkedString containing markdown. This should be the correct behaviour as the LSP spec states:
* MarkedString can be used to render human readable text. It is either a markdown string
* or a code-block that provides a language and a code snippet.
This change also fixes the precise concern (elixir-ls not displaying documentation pop-ups) of #478.
Much of the context for this change can be found here: #478
To recap: The LSP spec for
MarkedString
is a union type ofstring
and an object of the form{ language: string; value: string }
. The definition of theMarkedString
type inlsp-protocol.el
only supports the object and notstring
. Presently,lsp-mode
has no support for union types.In order to support this feature of the LSP spec, I added a check to see if the content received was a
string
, and if so treat it as a validMarkedString
containing markdown. This should be the correct behaviour as the LSP spec states:This change also fixes the precise concern (elixir-ls not displaying documentation pop-ups) of #478.