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

[hover] Fix universe printing in hover. #839

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Conversation

ejgallego
Copy link
Owner

Our code was incomplete. The API here could be really improved Coq-side. About is too verbose for hover, hence our code. We could opt for the version in prettyp.ml tho.

Fixes #835

@Alizter
Copy link
Collaborator

Alizter commented Sep 28, 2024

How does the new version print?

@@ -128,10 +162,11 @@ let pp_file fmt = function
| Some file -> Format.fprintf fmt " - **in file**: `%s`" file

let pp_typ id = function
| Def (typ, cr, file) ->
| Def (typ, param, cr, file) ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to call this sort_param or something.

@ejgallego
Copy link
Owner Author

foo@{u u0 u1} (M : Type@{u}) : Type@{u0} -> Type@{max(u,u1+1)}

controller/rq_hover.ml Outdated Show resolved Hide resolved
Copy link
Collaborator

@Alizter Alizter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a fine patch for user experience, but the API could use a cleanup here and upstream.

Our code was incomplete. The API here could be really improved
Coq-side. About is too verbose for hover, hence our code. We could opt
for the version in `prettyp.ml` tho.

Fixes #835
@ejgallego ejgallego merged commit d2f6c62 into main Sep 28, 2024
14 checks passed
; full_path : Names.Constant.t option
(** full path of the constant, if any, for example
[Stdlib.Lists.map] *)
; file : string option (** filename where the constant is located *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have access to the location too? (The one goto definition uses). Not relevant for this PR, but it might be useful to include.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but not sure line number is relevant here, the client can indeed issue the corresponding specific request for location.

@ejgallego ejgallego deleted the fix_hover_print_ind branch September 28, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unvierse levels displayed as de bruijin indices in hover
2 participants