Open infinisil opened 5 years ago
Generally, onHover request is not designed for what we are trying to use it for(sideline) and it does not offer good experience for some of the servers. There are 3 possibilities:
[Trace - 05:44:37 PM] Received response 'textDocument/hover - (582)' in 46ms.
Result: {
"contents": [
{
"value": "java.lang.System",
"language": "java"
},
"The `System` class contains several useful class fields and methods. It cannot be instantiated. Among the facilities provided by the `System` class are standard input, standard output, and error output streams; access to externally defined properties and environment variables; a means of loading files and libraries; and a utility method for quickly copying a portion of an array.\n\n * **Since:**\n \n * 1.0"
]
}
Change lsp-ui to try to extract the symbol info from the markdown similar to what was tried in https://github.com/emacs-lsp/lsp-mode/pull/779
Close the issue as wont fix and document that it does not work with some of the servers and eventually disable the symbols info by default.
I see, I think 2 is the most promising. By first rendering the full contents (with lsp--render-element
) and then cutting off everything but the first line of that result. Is that possible at all? I've never written any elisp and I can barely read it, so I'm having kind of a hard time with this.
We used to return the MarkedString
format for hover, but according to the spec it has been deprecated.
Where MarkedString is defined as follows:
/**
* 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. The language identifier
* is semantically equal to the optional language identifier in fenced code blocks in GitHub
* issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
*
* The pair of a language and a value is an equivalent to markdown:
* ```${language}
* ${value}
* ```
*
* Note that markdown strings will be sanitized - that means html will be escaped.
* @deprecated use MarkupContent instead.
*/
type MarkedString = string | { language: string; value: string };
So this will have to be fixed properly some time.
lsp-ui-sideline
displays way too long lines, apparently trying to include the full text, the same as it shows inlsp-ui-doc
:I'm using
Here are the full logs of the server:
Here's the request/response pair for the
return
:https://github.com/emacs-lsp/lsp-ui/pull/264 seems to be relevant.
Ping @yyoncho @alanz