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

Parser docstring vs syntax hover target audience confusion #5334

Open
nomeata opened this issue Sep 13, 2024 · 0 comments
Open

Parser docstring vs syntax hover target audience confusion #5334

nomeata opened this issue Sep 13, 2024 · 0 comments
Labels
bug Something isn't working new-user-papercuts Issue likely to confuse or otherwise negatively affect new users, even if only a little P-medium We may work on this issue if we find the time

Comments

@nomeata
Copy link
Collaborator

nomeata commented Sep 13, 2024

Description

A lot of parser and parser combinators have docstrings that aim to explain how to use the the parser, but then they end up being shown to the unsuspecting user when hovering over a piece of syntax that doesn't happen to have a better docstring.

For example in

import Lean
/-- docstring -/
theorem foo : True := trivial

if you hover over the : you get

declSig matches the signature of a declaration with required type: a list of binders and then : type 

and if you hover over the docstring you get

A docComment parses a…

Depending whether you already have #3918 you need import Lean to make these hovers visible, but note that import Mathlib implies import Lean, so that’s not the core issue.

It seems that one needs at least a way to indicate “the docstring of this parser or syntax is not meant for hovers”, and going through the code to annotate all docstrings that don’t have a useful user-facing docstring.

A more thorough solution is to somehow be able to write two docstrings, one to document Lean.Parser.Command.declSig, and one to show upon hovering : above.

Versions

Around 4.12.0

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@nomeata nomeata added the bug Something isn't working label Sep 13, 2024
@nomeata nomeata changed the title Parser docstring target audience confusion Parser docstring vs syntax hover target audience confusion Sep 13, 2024
@nomeata nomeata added the new-user-papercuts Issue likely to confuse or otherwise negatively affect new users, even if only a little label Sep 13, 2024
@leanprover-bot leanprover-bot added the P-medium We may work on this issue if we find the time label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new-user-papercuts Issue likely to confuse or otherwise negatively affect new users, even if only a little P-medium We may work on this issue if we find the time
Projects
None yet
Development

No branches or pull requests

2 participants