Skip to content
This repository has been archived by the owner on Feb 27, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants