the `docs` command in `ucm` should support no arguments
If in a namespace with a doc or a readme definition (any capitalization), the docs command without any arguments should display that.
For Hacktoberfest implementors:
- The Docs command is handled here https://github.com/unisonweb/unison/blob/3996559579bf5a35bf885ecb4f7d5838574b027e/parser-typechecker/src/Unison/Codebase/Editor/HandleInput.hs#L1047
- You'll need to make the argument optional https://github.com/unisonweb/unison/blob/3996559579bf5a35bf885ecb4f7d5838574b027e/parser-typechecker/src/Unison/Codebase/Editor/Input.hs#L131
- And will have to adjust the arg parser https://github.com/unisonweb/unison/blob/3996559579bf5a35bf885ecb4f7d5838574b027e/parser-typechecker/src/Unison/CommandLine/InputPatterns.hs#L309-L314
I believe this issue was written before we started using fzf fuzzy-finding as a default for some commands (view, edit, cd, etc.) I wonder which is the preferable behaviour now?
Hello, I'm new to unison - I've started doing aoc2021 on it - and I'm liking the ucm experience.
I can confirm that on the latest release docs and view default to fuzzy-finding with fzf (and it's really awesome, it helped me find stdlib functions). So I guess this issue can be closed now.
One thing I would improve regarding docs is, currently it lists terms even if they don't have documentation, selecting one of these just says No results. So I guess it would be nice for fzf to list only terms that have a linked Doc. I'd love to help implementing this in another issue if you people find it worth doing.
Thanks for unison again, you rock! :)
So I guess it would be nice for fzf to list only terms that have a linked Doc.
Interesting thought! I'm a bit on the fence for this one, since I think it might also be weird to go looking for docs for a definition, but have it not even show up in the list, although maybe that would be okay as long as users understood the reason why it wasn't there.
I'd like to work on this if it still makes sense after the introduction of fzf fuzzy-finding. I thought it might still make sense in case:
- There is a
README.docdefinition (with any capitalization). I think this would be analogous to how Unison Share shows the README and provides an overview of the namespace. - There is a
<namespace>.docdefinition (this seems rather unlikely from what I've seen so far)
This would work as if display .base.README was used and only when the user enters docs\n. If the user continues to provide an argument to docs then we just continue with fzf fuzzy-finding (i.e. doc<space>\n).
Apologies if I'm not making sense in any part. I have experience with Haskell but I'm today-years-old in Unison.
As of #4519, it does support no arguments, but it launches fzf.