A generic method to get documentation string or SignatureInformation
#2031
Labels
feature-request
Request for new features or functionality
help wanted
Issues identified as good community contribution opportunities
new request
Milestone
I need to build a feature that lists all functions, classes, and methods in a file (or workspace) including possible documentation strings.
Currently
textDocument/documentSymbol
returnsdocumentSymbol
that includesname
,detail
, andkind
. But there's no way to get documentation strings.In
textDocument/signatureHelp
, there already is support for docstrings:SignatureInformation
includes all the necessary metadata about the signature,label
,documentation
, andparameters
. However, as far as I understand, this request can only be triggered from a use (e.g., of a function), not via the function declaration itself.There should be a generic way to obtain this information. I see three possibilities:
SignatureInformation
from declaration or implementation location.textDocument/documentSymbol
to includeSignatureInformation
ordocumentation
attribute.In inclined to favor option 2. as it is generic and most backward compatible.
It seems that many LSP servers already support documentation strings (they're being included in hover results for example), so in most cases the server already has this information, it just cannot be easily accessed.
The text was updated successfully, but these errors were encountered: