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 first class support for GHC Notes Syntax #2964

Closed
fendor opened this issue Jun 16, 2022 · 1 comment
Closed

Add first class support for GHC Notes Syntax #2964

fendor opened this issue Jun 16, 2022 · 1 comment
Labels

Comments

@fendor
Copy link
Collaborator

fendor commented Jun 16, 2022

This feature has been proposed by SPJ during ZuriHac 2022.

Essentially, GHC has many Notes to explain the code-base, ghcide has these too, and they look like this:

{- Note [Avoiding bad interface files]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
-}

And these notes are often references in documentation for functions like this:
image

The issue is, that there is no way to actually find the note from the documentation without resorting to a basic grep search.
This UX is acceptable, but maybe we can do better!
The idea presenting here is the following:

  • Inline the comment in the haddock documentation when displayed to the user
  • Alternatively: Make the syntax Note [Avoiding bad interface files] clickable, allowing users to jump to the original note, allowing them to more easily discover the information.

As an alternative design space, maybe we can teach haddock in general about references to other comment sections?

Note: If standardised, this feature is useful for more than just the GHC codebase, but beneficial to the whole community.

Possible roadmap:

  1. Standardise the GHC Note system
  2. Figure out how to automatically create an index of available Notes in a local project.
    • .hie files might provide this information, also haddock (which I think depends on .hie, right?).
  3. Find notes from dependencies
    • again, .hie files or haddock.
  4. Display notes to users
@michaelpj
Copy link
Collaborator

I think this is not a HLS problem. Adding support for such things to Haddock might be nice, and would benefit lots of people, but I think ad-hoc support baked into HLS would maybe even be bad (since it suppressed the desire to actually fix upstream tooling, and it's another random thing for us to maintain).

@michaelpj michaelpj closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants