hackwaly / vscode-ocaml

An extension for VS Code which provides support for the OCaml language.
MIT License
170 stars 26 forks source link

Keep a list of previous jumps and allow to jump back #94

Closed Khady closed 7 years ago

Khady commented 7 years ago

This is a feature request.

In merlin mode for emacs, there a function merlin-pop-stack or C-c &. Each time you do a jump using merlin, (go to definition, go to implementation, jump to enclosing fun, let, module or match, ...), it is possible to jump back using merlin-pop-stack. It is very convenient, because you can move your cursor, do some modifications and still you are able to jump back where you were. Much more powerful than cursorUndo or workbench.action.navigateback in vscode because it takes only the jumps into account and not all the cursor movements.

I don't know anything about vscode extensions, so it's hard for me to contribute. But let me know if I can help.

hackwaly commented 7 years ago

Vscode already has this feature.

Khady commented 7 years ago

Can you tell me which command it is then? Alt+ctrl+- isn't the answer. Cursorundo either.

On 22 May 2017, at 18:23, 文宇祥 notifications@github.com wrote:

Vscode already has this feature.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

hackwaly commented 7 years ago

On my mac it's "ctrl+-".

Khady commented 7 years ago

Ok. It's Alt+ctrl+- on my linux, and the command name is workbench.action.navigateback. But unfortunatly, like cursorUndo, this command takes into account the movements of the cursor, not only the jumps. So if I jump to a function definition, then move my cursor 3 times down, and do workbench.action.navigateback, the cursor will move one time up. I would like the cursor to jump back to the function definition, and then on the function call.

hackwaly commented 7 years ago

This feature should be requested to https://github.com/Microsoft/vscode/issues. I use emacs rarely, and I do jump back in vscode by press ctrl+- many times. I didn't feel it's inconvenience yet.

Khady commented 7 years ago

Ok, I will ask there then. FTR, in emacs this is part of the merlin mode and not a feature that exists in emacs by itself. And by leaving this feature to the editor, I'm not sure it would support to go back after a jump to enclosing fun, let, module or match for example, as it's not an existing go to command. But I don't know vscode internals, so it's just a guess.

Khady commented 7 years ago

Here is the corresponding feature request: https://github.com/Microsoft/vscode/issues/27112

Thanks for your quick answer and your work on this extension!