-
Notifications
You must be signed in to change notification settings - Fork 229
Closed
Milestone
Description
Both hover's content and completion's documentation return a plain string:
- in the case of hover it indicates a
MarkedStringwhich is explicitly deprecated in favour ofMarkupContent - in case of completion the use of string is not deprecated, but
MarkupContentis allowed and would make the transition to markdown easier in the future
MarkupContent was added in 3.3.0 (11/24/2017) which was 4 years ago and should be safe to transition now given that most clients already support much newer versions of LSP specification (usually at least 3.14).
Updating the following function to return a dictionary complying with MarkupContent interface will be sufficient:
python-lsp-server/pylsp/_utils.py
Lines 139 to 147 in 26f234a
| def format_docstring(contents): | |
| """Python doc strings come in a number of formats, but LSP wants markdown. | |
| Until we can find a fast enough way of discovering and parsing each format, | |
| we can do a little better by at least preserving indentation. | |
| """ | |
| contents = contents.replace('\t', u'\u00A0' * 4) | |
| contents = contents.replace(' ', u'\u00A0' * 2) | |
| return contents |
See https://github.com/krassowski/python-language-server/pull/4/files.
Metadata
Metadata
Assignees
Labels
No labels