marimo icon indicating copy to clipboard operation
marimo copied to clipboard

feat: documentation panel

Open mscolnick opened this issue 1 year ago • 5 comments

This stores the completion response when inside a function call in the documentation tab. This is re-using an old PR when we tried to put this in a popover.

This documentation panel isn't perfect. Some improvements that could happen in this PR or later:

  1. Parse certain packages that we know are RST using an RST parser (e.g. numpy)
  2. Populate the panel when we move the cursor to a function (not just the arguments of it)
Screenshot 2024-01-16 at 9 01 01 PM

mscolnick avatar Jan 17 '24 02:01 mscolnick

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2024 6:21pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2024 6:21pm

vercel[bot] avatar Jan 17 '24 02:01 vercel[bot]

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (37c0143) 63.61% compared to head (aaf2584) 63.57%.

Files Patch % Lines
marimo/_runtime/complete.py 0.00% 4 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #591      +/-   ##
==========================================
- Coverage   63.61%   63.57%   -0.04%     
==========================================
  Files         140      140              
  Lines        6662     6666       +4     
  Branches     1321     1322       +1     
==========================================
  Hits         4238     4238              
- Misses       2240     2244       +4     
  Partials      184      184              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 17 '24 02:01 codecov[bot]

Nice!

Populate the panel when we move the cursor to a function (not just the arguments of it)

I think we implement this feature in this PR. I tried it out and it's a bit awkward / non-obvious having to type in order to get the docs to show up

akshayka avatar Jan 17 '24 02:01 akshayka

@akshayka, now we request using the same logic as the tooltip - should be pretty sufficient. some variables have pretty weird/poor docs

mscolnick avatar Jan 17 '24 02:01 mscolnick

Nice! Just tried it out for a bit.

I like that docs show up on cursor move now. However when I move the cursor around (typically by clicking), maybe 20% of the time the docs don't update or I see "No documentation". Here's an example

image

some variables have pretty weird/poor docs

I guess the issue with using tooltips is that now we get "documentation" for variables, whereas really all we're seeing is the variable name and its type. If we want to avoid this I don't mind creating a new route in the backend that's only for docstrings.

akshayka avatar Jan 17 '24 03:01 akshayka