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

Add custom tooltip snippets #1471

Open
Cyrik opened this issue Jan 14, 2022 · 0 comments · Fixed by #1492
Open

Add custom tooltip snippets #1471

Cyrik opened this issue Jan 14, 2022 · 0 comments · Fixed by #1492
Labels
developer ergonomics ux User experience related

Comments

@Cyrik
Copy link
Member

Cyrik commented Jan 14, 2022

I'm not sure if there's any use-case for users. It would probably be mostly a thing for libraries and for testing those without having to compile.
My use-case here is displaying traced calls in the tooltips as if you had eval'd all the calls inline. So if you do (run-traced (some-func 5)) I can show you the result in the some-func tooltip and do the same for anything it might have called.
Another library that would benefit from this is spec/malli where you can show the spec for a function in the tooltip of the function.

I've already started building this and have played with two approaches:

hover provider

This is the most flexible and easiest to build. We can simply call all customeHoverSnippets with the file, line, column and they can provide some markdown to be shown. This way any snippet could even implement links that do something, like the clojureDocs tooltips.

vscode.Texteditor.decorations

This is the place the inline eval values are put. Using it has a lot of disadvantages:

  • hard to implement since it's a push, not pull model and snippets are pull
  • harder to clear independently
  • not as extensible

This kind of depends on #1442 to be really useful, so I'll base the PR on the PR for that and add it as customTooltipSnippets option if this doesn't make merging harder @PEZ

As always I'd be happy to hear any feedback.

@bpringe bpringe added developer ergonomics ux User experience related labels Jan 15, 2022
@bpringe bpringe linked a pull request Feb 19, 2022 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer ergonomics ux User experience related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants