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

ocp-browser feature request: follow types for lookup (hyperlinks ?) #64

Open
AltGr opened this issue Dec 4, 2014 · 3 comments
Open

Comments

@AltGr
Copy link
Member

AltGr commented Dec 4, 2014

I'd love to be able to jump to sub-types definitions, eg:

┌─────────────────────────────────────────────────────── kinds: t, v, e, c, m, s, k ┐
│Types.Sig_module                                                                   │
└───────────────────────────────────────────────────────────────────────────────────┘
> constr(signature_item) Types.Sig_module Ident.t * module_declaration * rec_status 

then I'd like to have a way (right arrow ?) to highlight module_declaration, and then validate (enter ?) to get directly to Types.module_declaration:

┌─────────────────────────────────────────────────────── kinds: t, v, e, c, m, s, k ┐
│Types.module_decl                                                                  │
└───────────────────────────────────────────────────────────────────────────────────┘
> type Types.module_declaration                                                      
    {                                                                                
      md_type : module_type;                                                         
      md_attributes : Parsetree.attributes;                                          
      md_loc : Location.t;                                                           
    }                                                                                

And I could go on to Parsetree.attributes, etc...
It's just interface really, we already have the implementation for the lookup :)

Bonus points for doing it with the mouse so that it starts to really feel like a browser ;)

@Drup
Copy link
Collaborator

Drup commented Dec 4, 2014

I also had this idea, I agree with you that it's very desirable! I also want to implement something similar for another project, so I will probably do a general widget in the end. :)

There are several issues from the UX point of view. Normal right/left arrows are currently used to move the cursor in the completion bar, I don't think we want to change that.

A solution would be to use alt+arrow, since we know we are not on a module.

I have an idea to implement the mouse thing, but it needs investigation (and probably some lambda-term patching).

@c-cube
Copy link

c-cube commented Dec 4, 2014

Would be nice indeed. I suggest ctrl+arrows or something similar, since alt+arrows is already used for completion, then j to jump to definition.

An issue is that you'd probably have to add a notion of history, to "go back to where you were" after looking up a definition.

@Drup
Copy link
Collaborator

Drup commented Dec 4, 2014

Enter is fine for jumping. Completion is not possible when jumping is available anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants