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

Using only shortcuts for next or previous methods #7

Closed
FahadAijaz opened this issue May 26, 2019 · 3 comments
Closed

Using only shortcuts for next or previous methods #7

FahadAijaz opened this issue May 26, 2019 · 3 comments

Comments

@FahadAijaz
Copy link

Please can someone help me regarding the usage of navigating only across functions.

Assume I have defined this in my settings.json:
// Enable a select few symbols "gotoNextPreviousMember.symbolKinds": [ "function" ]

From here on I'd like to use ctrl+shift+up to go to the previous function in the file.

@TheTastefulToastie
Copy link
Contributor

What exactly isn't working? Does it jump to every symbol? Does it not jump at all?

If your settings.json is configured exactly as you've written above, it won't work since the whole thing is a single-line comment.

Also what language are you using? e.g. Java doesn't have functions, it has only methods since all code must be contained within classes, so you will need to specify "method" instead of "function".

I've just tried it for JavaScript and it worked for me, here's what I did:

keybindings.json

// Place your key bindings in this file to override the defaults
[

  // Unbind the default shortcuts
  {
    "key": "ctrl+down",
    "command": "-gotoNextPreviousMember.nextMember"
  },
  {
    "key": "ctrl+up",
    "command": "-gotoNextPreviousMember.previousMember"
  },

  // Bind my shortcuts instead
  {
    "key": "ctrl+shift+down",
    "command": "gotoNextPreviousMember.nextMember"
  },
  {
    "key": "ctrl+shift+up",
    "command": "gotoNextPreviousMember.previousMember"
  }

]

settings.json

{
  // Enable a select few symbols
  "gotoNextPreviousMember.symbolKinds": [ "function" ]
}

@FahadAijaz
Copy link
Author

FahadAijaz commented May 30, 2019

Sorry, for being unclear. This was not a complaint of a feature not working. But I was unsure of what to exactly write in my settings.json. But now I understand. Thanks.

@TheTastefulToastie
Copy link
Contributor

cool no problem 👍

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

No branches or pull requests

3 participants