-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat: Format signature help when valid docstring style #6170
feat: Format signature help when valid docstring style #6170
Conversation
- Add `docstring_parser>=0.16` to `requirements.txt` - Related core PR: deephaven/deephaven-core#6170 - Related issue: deephaven/web-client-ui#2247
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The totality of my review is/was around ensuring the base images contained the docstring_parser
dependency and we are correctly depending on it from py/server/setup.py
. In those regards, the PR is correct (the base image bumps already landed in main). I have not reviewed the other logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't have a chance to look at all of this in great detail, but here are some comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general comment, these tests are unnecessarily difficult to follow. They are using wrappers and do not follow the principle of minimizing variable scope. Together, this has made what should be a simple review take way too long. It is not friendly to the next guy reading the code. Is there really a need to have this code scattered in two files like this?
@jmao-denver should comment in case he disagrees.
return params | ||
|
||
|
||
def _generate_description_markdown(docs: Docstring, params: list[Any]) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params
typehint is too vague. See comment on the return type above.
return [ | ||
_generate_display_sig(signature), | ||
description, | ||
param_docs, | ||
signature.index if signature.index is not None else -1, | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a class rather than a list in order to make it easier to work with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is returned to Java, and was the format being done prior to this change. Was not looking to refactor it.
return param_docs | ||
|
||
|
||
def _get_signature_help(signature: Signature) -> list[Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return signature is too vague.
Returns: | ||
A list that contains [signature name, docstring, param docstrings, index] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be returning something more structured/organized, like a class?
Closing in favour of #6649 |
docstring_parser
library for autocomplete usage