-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using docstring_to_markdown for markdown hover and documentation #22
Comments
Please see my reference integration on my fork, here. |
Is it possible to send plain text and Markdown at the same time? The thing is we don't need Markdown in Spyder. The other alternative would be to add a config option to control what format is used in the server. |
No, you cannot send both. A config option should not be needed either; according to the LSP specification if the client does not support a particular export interface HoverClientCapabilities {
/**
* Whether hover supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* Client supports the following content formats if the content
* property refers to a `literal of type MarkupContent`.
* The order describes the preferred format of the client.
*/
contentFormat?: MarkupKind[];
} export interface SignatureHelpClientCapabilities {
/* ... */
/**
* The client supports the following `SignatureInformation`
* specific properties.
*/
signatureInformation?: {
/**
* Client supports the following content formats for the documentation
* property. The order describes the preferred format of the client.
*/
documentationFormat?: MarkupKind[];
/* ... */
}
/* ... */
} export interface CompletionClientCapabilities {
/* ... */
/**
* The client supports the following `CompletionItem` specific
* capabilities.
*/
completionItem?: {
/* ... */
/**
* Client supports the following content formats for the documentation
* property. The order describes the preferred format of the client.
*/
documentationFormat?: MarkupKind[];
/* ... */
}
} |
Ok, sounds good then |
Following up on the previous discussions:
I would like to propose the integration of docstring-to-markdown which is a small converter that handles conversion of docstrings, including:
Recognition of other docstring styles is planned. The docstring-to-markdown was successfully adopted in jedi-lanaguage-server. I also used it for quite a while on my fork without any major issues. The performance impact of doing on the flight conversion is negligible when only returning the completion in
completionItem/resolve
(#1, to be updated); I did not test the performance impact in other scenarios.I would be happy to transfer the project to the python-lsp organization. Leaving this up for discussion as I am sure there will be different takes and opinions.
Alternatives:
While docstring-to-markdown uses simple parsers and regular expressions other solutions are possible. A number of other solutions and packages was tried before I decided to develop docstring-to-markdown (see pappasam/jedi-language-server#22 (comment)) and it appeared the best solution at that time, however other approaches may be feasible in the future:
The above approaches are likely to be more computation intensive and the first step implies building an entire documentation of a project in order to resolve references
The text was updated successfully, but these errors were encountered: