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

Jump to enclosing fun, let, module or match #95

Open
Khady opened this issue May 22, 2017 · 0 comments
Open

Jump to enclosing fun, let, module or match #95

Khady opened this issue May 22, 2017 · 0 comments

Comments

@Khady
Copy link

Khady commented May 22, 2017

This is a feature request

In merlin mode for emacs, there is a function to jump to enclosing fun, let, module or match, which is very convenient. I would love to have it in vscode too.

https://github.com/ocaml/merlin/blob/master/doc/dev/PROTOCOL.md#jump--target-string--position-position

Not present in the old protocol doc, but the command is available. I think it is something like ["jump", "fun let module match", "at", POSITION]

(defun merlin/jump (&optional target)
  "Jump to the TARGET"
  (let ((result (merlin/send-command
                  (list 'jump (if (equal target "") "fun let module match" target)
                        'at (merlin/unmake-point (point))))))
    (unless result
      (error "Not found. (Check *Messages* for potential errors)"))
    (unless (listp result)
      (error result))
    result))
C-c C-j runs the command merlin-jump, which is an interactive Lisp
function in `merlin.el'.

It is bound to C-c C-j.

(merlin-jump &optional TARGET)

Jump to enclosing fun, let, module or match.

Any combination of the above may be entered, separated by spaces, ex.:

fun let or module or module fun match

Empty string defaults to jumping to all these.
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

2 participants