vscode-crystal-lang icon indicating copy to clipboard operation
vscode-crystal-lang copied to clipboard

Shortcut to navigate to beginning and end of block

Open scriptnull opened this issue 7 years ago • 3 comments

Hi, I am very new to Crystal and I have been barely using it for a week on vs code with this extension.

Good work guys! I would like to suggest some features.

In programming languages, where brackets are used to define the scope, I use cmd+shift+\ to navigate to the matching bracket.

go-end-of-block

But in crystal, we don't have brackets and scopes are being defined by def, if ... end etc. So, I would like to have shortcuts to move to beginning and end of scopes.

image

For example,

  • If the shortcut is pressed at line number 30, the cursor would navigate to the end statement at line number 35.
  • If the shortcut is pressed at line number 32 ( if statement ), the cursor would navigate to the end statement at line number 34.
  • If the shortcut is pressed at line number 31, the cursor would navigate to the end statement at line number 35. ( because that code is in do-end block ) -- This is not possible with cmd+shift+\ in bracket scoped languages. So, this could be optional implementation based on the possibilities.

This is will help in navigating the code base faster. It's as powerful as saying "Go to the next function in the class and modify it. Once done, move to the next function."

scriptnull avatar Oct 07 '17 09:10 scriptnull

Hi Thanks you for report this issue!

This problem also happen on VSCode for Ruby, Elixir and other similar languages.

I already published an issue about that on VSCode repo

Please see: https://github.com/Microsoft/vscode/issues/32085

faustinoaq avatar Oct 07 '17 19:10 faustinoaq

Potentially useful:

  • https://github.com/elixir-lsp/vscode-elixir-ls/issues/46
  • https://github.com/microsoft/vscode/issues/48332
  • https://github.com/microsoft/vscode/issues/176694

nobodywasishere avatar Jun 12 '23 23:06 nobodywasishere

https://github.com/microsoft/vscode/issues/583

nobodywasishere avatar Dec 06 '23 04:12 nobodywasishere