-
Notifications
You must be signed in to change notification settings - Fork 760
improvement: documentation of parameters as show in the completion box #4673
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@krassowski is attempting to deploy a commit to the marimo Team on Vercel. A member of the Team first needs to authorize it. |
marimo/_runtime/patches.py
Outdated
| def patch_jedi_parameter_completion() -> None: | ||
| import re | ||
|
|
||
| from docstring_to_markdown import UnknownFormatError, convert |
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 may not be installed (like in wasm). it is still optional, but pulled in from pylsp. could we put a try catch or use if DependencyManager.docstring_to_markdown.has():
…4786) ## 📝 Summary Small follow up to #4673. ## 🔍 Description of Changes Polars often uses a simplified rst format for parameters where it does not include types. This requires `docstring-to-markdown` v0.17 with: - python-lsp/docstring-to-markdown#44 For example, before there was only one parameter with description for `polars.io.parquet.functions.read_parquet`, and now all 22 are displayed. Parameters from functions with overloads such as `polars.io.database.functions.read_database` remain without good suggestions. ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] I have added tests for the changes made. - [x] I have run the code and verified that it works as expected. ## 📜 Reviewers @mscolnick --------- Co-authored-by: Myles Scolnick <myles@marimo.io>
📝 Summary
Previously the parameters completions would show up empty or with useless
NoneType()annotation. This PR adds a patch for marimo while awaiting a solution in jedi and/or pylsp. The related upstream issues are:NoneType()for parameters annotated withOptionalin completion davidhalter/jedi#2063🔍 Description of Changes
marimoparameters have documentation extracted by (patched) jedimarimoby jedi so that we use static analysis and can read comments fordataclasses to generate documentationmarimohighlighted by tests📋 Checklist
📜 Reviewers
@mscolnick