Return a list of 2 MarkedStrings for function/classes in textDocument/hover
rwols opened this issue · comments
The first MarkedString should be of the form
{"language": "python", "value": "def foo(bar, baz) -> None"}
(put the word def
in front of it for a function/method, class
for a class)
The second MarkedString should be the plaintext docs of the function/class.
Right now the hover content is a bit dry, I think this can be improved greatly with this simple adjustment.
MarkedString
is deprecated and it is recommended to use MarkupContent
instead.
True, but MarkedString[] is a bit easier to implement in this case.
You can also return MarkupContent like this perhaps:
```python
<def or class> entity
```
```
docstring of entity
```
If you don't wrap the docstring in triple backticks you run the risk of not faithfully representing indentation of the docstring.
Of course first detecting whether the client supports markdown
content (which the LSP plugin does).