-
Notifications
You must be signed in to change notification settings - Fork 578
feat: show declaration keywords in hovers #7232
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
base: master
Are you sure you want to change the base?
feat: show declaration keywords in hovers #7232
Conversation
Declaration keywords are now shown in hovers as part of a signature. This is in support of an upcoming documentation style guide that will recommend that the text of docstrings not state what sort of declaration something is, but instead leave it to Lean to tell every user in a consistent manner.
In most cases, this didn't require much work. However, the name of a |
Mathlib CI status (docs):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to have this feature, but I am a bit concerned about the lack of extensibility by the approach in this PR. For example, in Mathlib, hovering over a lemma
will display as theorem
, which isn't great.
Should we instead thread this information through to the language server, e.g. as a separate environment extension (e.g. as for DeclarationRange
s, with a MapDeclarationExtension
)?
This PR adds declaration keywords, such as
def
orclass
, to signatures in hovers.Declaration keywords are now shown in hovers as part of a signature. This is in support of an upcoming documentation style guide that will recommend that the text of docstrings not state what sort of declaration something is, but instead leave it to Lean to tell every user in a consistent manner.
Screenshot:
