google-research / dex-lang

Research language for array processing in the Haskell/ML family
BSD 3-Clause "New" or "Revised" License
1.56k stars 106 forks source link

Initial support for tooltips: parse tree visualizations. #1305

Closed dan-zheng closed 1 year ago

dan-zheng commented 1 year ago

Dex has a reactive notebook and literate programming environment in dex web.

Tooltips add additional IDE information to the web environment, visible when hovering the cursor over code.

This initial PR adds infrastructure for tooltips, with parse tree visualizations as the first feature.

First step towards https://github.com/google-research/dex-lang/issues/1304.

Demo

dex web

dex --prelude /dev/null web lib/prelude.dx 2>&/dev/null
Dex tooltips demo
Dex tooltips demo video

Exported HTML

Created via make docs.

prelude.html behaves exactly the same as the live demo above.

google-cla[bot] commented 1 year ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

dan-zheng commented 1 year ago

I think this PR is ready for review. I spent some time this week cleaning the code.

tests/unit/SourceInfoSpec.hs could be cleaned up and could have more testcases.

I'm happy to take a look later this week, or in a follow-up PR.