Skip to content
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

Info Panel #1116

Open
3 tasks
ZaymonFC opened this issue Apr 11, 2021 · 9 comments
Open
3 tasks

Info Panel #1116

ZaymonFC opened this issue Apr 11, 2021 · 9 comments

Comments

@ZaymonFC
Copy link

ZaymonFC commented Apr 11, 2021

Based on the discussion here: #1071

The F# VsCode tooling (https://ionide.io/index.html) has this concept called an info panel. I haven't seen it anywhere else and dearly miss it (even when using other IDE's for F#).

I find it exceedingly useful in development and I feel like it could really pair well with Clojure's REPL driven development (especially as a productivity booster for beginners).

The basic idea is have the option to spawn a panel that shows the documentation for any function under the editor caret.

The functionality it offers is:

  • Panel can be locked as a reference
  • Namespaces referenced in the panel can be explored
  • Doc strings, parameter lists, return types are shown

Screenshots:
image

@stuartstein777
Copy link

stuartstein777 commented Apr 12, 2021

I miss this from Cursive. It displays the clojuredocs in a hover window that you can pin to a tool window.

clojuredocs

Would be a nice addition to Calva to have something like this / the OPs F# info panel.

@bpringe
Copy link
Member

bpringe commented Apr 12, 2021

Would be a nice addition to Cursive to have something like this

Did you mean "addition to Calva?"

There's an issue here for adding clojuredoc info to the hover: #689

@stuartstein777
Copy link

Yes, sorry Calva. Too many words starting with C!

@ZaymonFC
Copy link
Author

ZaymonFC commented Jun 23, 2021

@bpringe This is the issue for #1209. I have some initial thoughts around implementation but still very early in prototyping. Would be good to get some opinions.

Currently the F# implementation in Ionide uses a webview. I know this has a certain runtime cost, but a cost that's only paid if you open it.

My aspirational features are:

  • Show the documentation for the function under the cursor / caret (use existing hover docs).

  • Have the ability to pin docs - inspired by the roam research side bar (pic included):

To do this, and create a nice base that people could further extend I think it's worth experimenting with getting either react or reagent running in the panel and defining a way for the embedded application to communicate with the extension.

Alternatively if that proves to be too 'heavy' something like svelte might be the right fit for templating / adding an amount of interactivity.

@bpringe
Copy link
Member

bpringe commented Jun 24, 2021

Ah, thanks for reminding me about this issue. What would react/reagent be needed for? Do you intend to have the info panel be interactive? I think if it just needs to have its content changed upon certain editor actions, etc., then the webview API should suffice, but I haven't messed with it much, so I may be wrong.

@Hamido-san
Copy link
Contributor

I hope all this talk of the webview API doesn't mean the Calva implementation would require an active internet connection to show the clojuredocs.
In Cursive for example, when a Clojure project is opened a background task tries to fetch the latest changes from clojuredocs, but being offline doesn't impede using the "outdated" content.

@ZaymonFC
Copy link
Author

@Hamido-san There are .edn exports of clojuredocs available (like in the linked orchard implementation) so having an active internet connection shouldn't be required. We could probably ship it with the extension and periodically update it? Not sure how valuable having the bleeding edge of clojuredocs example would even be 😅.

@bpringe To build the pinning functionality (which I think would add a lot of value) requires interactivity, how that's achieved I don't really mind.

@Hamido-san
Copy link
Contributor

@ZaymonFC @bpringe I don't mean to be a nay-sayer, but there seems to be no need to create a new "pinning functionality". Instead, the info "panel" can be a normal document tab in a new group, just like:

  • the REPL output tab
  • a markdown preview tab
  • or (by the looks of it) the F# info panel

@bpringe
Copy link
Member

bpringe commented Jun 25, 2021

@ZaymonFC I see. I think the pinning feature could use some hammock time. Maybe a simplified/MVP version of this feature would be good to release first. Maybe it wouldn't include pinning at first - just a thought. I'm not against adding pinning at release, though.

In regards to adding clojuredocs info, this issue is related: #689

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants