Coder Social home page Coder Social logo

mishkinf / vscode-goto-next-previous-member Goto Github PK

View Code? Open in Web Editor NEW
39.0 7.0 7.0 1.87 MB

Visual Studio Code Extension to navigate through the functions, variables, and classes using quick and easy key commands similar to functionality provided by IntelliJ IDEs and Resharper

TypeScript 100.00%
typescript vscode visual-studio-code visual-studio-code-extension vscode-extension

vscode-goto-next-previous-member's Introduction

vscode-goto-next-previous-member

Visual Studio Code Extension to navigate through the functions, variables, and classes using quick and easy keycommands similar to functionality provided by IntelliJ IDE's (next/previous function) or Resharper (next/previous member)

Features

This Extension provides two key commands to navigate up and down through the members in your file.

Next Previous Member Demo

Requirements

[email protected]+

Extension Settings

This extension contributes the following customizable Keyboard Shortcuts:

Command Description Key Command
gotoNextPreviousMember.previousMember Move To Previous Member ctrl+up
gotoNextPreviousMember.nextMember Move To Next Member ctrl+down

and the gotoNextPreviousMember.symbolKinds configuration setting which accepts an array containing any of the following values:

Symbol Kind
"array"
"boolean"
"class"
"constant"
"constructor"
"enum"
"enummember"
"event"
"field"
"file"
"function"
"interface"
"key"
"method"
"module"
"namespace"
"null"
"number"
"object"
"operator"
"package"
"property"
"string"
"struct"
"typeparameter"
"variable"

All of the symbol kinds specified in the array will be used when moving to the next/previous symbol, omitted symbol kinds will be skipped. If an empty array is provided, all symbol kinds will be used (this is the default).

Language Support

For the outline to work, the language support plugins need to support symbol information.

For the outline to form a tree structure, the language support plugins need to report the entire definition range as part of symbol.

See VS Code issue #34968 and language server protocol issue #132 for a discussion.

Here is a list of languages known to work with Code Outline:

Language/Format Extension
C C/C++
C++ C/C++, cquery
Docker Docker
HTML Comes with VS Code
JavaScript Comes with VS Code
JSON Comes with VS Code
Markdown Comes with VS Code
ruby Ruby Symbols
Perl Perl
PHP PHP Symbols
Python Python
TypeScript Comes with VS Code
YAML YAML Support by Red Hat

Please report any missing extensions and I'll update the list.

Known Issues

If you are experiencing no movement upon running the command:

I have observed an issue with the Visual Studio API to return symbols from vscode.executeDocumentSymbolProvider. One way I have found to possibly fix the issue is to disable all extensions, restart Visual Studio and then enable all extensions and restart again.

Possible Related Issue: dotnet/vscode-csharp#2192

Release Notes

See CHANGELOG.md


More Visual Studio Code Extensions by mishkinf

A Visual Studio Extension that provides the ability to quickly navigate back and forth between recently made edits

Enjoy!

License

MIT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

vscode-goto-next-previous-member's People

Contributors

dependabot[bot] avatar mishkinf avatar thetastefultoastie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-goto-next-previous-member's Issues

Arrow function is not recognized

Hello, this project is awesome, but I found that there is a problem, there is an arrow function " ( )=> { } " in javascript, this function cannot be recognized by this plugin, and then jumped directly over it. hope you can update it and work hard.

Jump before/after a enclosed symbol

It would also nice to jump over symbols like "this is a string", (jump == overThisExpression) or /* where the heck ist the end of the comment */
with ctrl+right/ctrl+left keys

Compatibility with Ruby Symbols

Per this instruction:

Please report any missing extensions and I'll update the list.

I just wanted to report partial compatibility with Ruby Symbols. It only adds symbols for modules, class and methods, but that's all I wanted.

Thanks for making this extension, it's working great!

modifies the edit history

thank you for the extension.
Did you experience that if I navigate through the members then do undo (CMD+Z) it steps back from the latest point to the newest one, then undo the modification?

vscode 1.25.1
Mac

Jump in visual mode of vscodevim.vim extension resets text selection

Steps to reproduce

  • install vscodevim.vim vscode extension
  • open any file with a code supported by mishkinf.goto-next-previous-member extension
  • enter vim visual mode (type 'v')
  • move cursor around to select some text (use navigation keys "hjkl" or arrow keys)
  • jump to next or previous method using mishkinf.goto-next-previous-member extension

Expected result
Text between the previous and the current cursor position should be selected

Actual result
No text under selection. Selection starts from the new cursor position from scratch.

Cannot change keystrokes in JSON to "ctrl+ALT+up/down"

I cannot change the keystroke shortcuts from "ctrl+up/down" to "ctrl+alt+up/down" – new shortcuts are ignored.
But what's interesting, change to "ctrl+shift+up/down".

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

It is any limitation with "ALT" key? I have tried several times, to be honest this is first time I change the keystrokes. Did I missed something?

Don't jump to next ["function", "class", "method"]

When add:

"gotoNextPreviousMember.symbolKinds": ["class", "function", "method"]

to the settings.json then don't jump to gotoNextPreviousMember.nextMember
In some python files it works in some is not.

Expand selection to next member

Is there a way to expand the selection in BS code to the next member as opposed to just jumping the cursor to the next member?

Using only shortcuts for next or previous methods

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.

Feature Request: align view so symbol always ends up at the top/center

Would love a feature that after going to the next/previous symbol the view scrolls so it ends up at the top/middle.

Kind of what does this extension with the cursor alone https://github.com/kaiwood/vscode-center-editor-window

I actually ended up combining the hotkeys to use both:

    {
        "key": "ctrl+down",
        "command": "-gotoNextPreviousMember.nextMember"
    },
    {
        "key": "ctrl+up",
        "command": "-gotoNextPreviousMember.previousMember"
    },
    {
        "command": "runCommands",
        "key": "ctrl+down",
        "when": "editorTextFocus || findWidgetVisible",
        "args": {
          "commands": [
            "gotoNextPreviousMember.nextMember",
            "center-editor-window.center",
          ]
        }
    },
    {
        "command": "runCommands",
        "key": "ctrl+up",
        "when": "editorTextFocus || findWidgetVisible",
        "args": {
          "commands": [
            "gotoNextPreviousMember.previousMember",
            "center-editor-window.center",
          ]
        }
    },

Please, ignore comments in Java

In Java, when jumping to the next method, instead of going to "public", it goes to the comment above the method:

Example:

    public void f() {  
            // 1. Cursor HERE <<<<<<<<<<<<<<
    }

    // Comment          // 2 . Jumps HERE <<<<<<<<<
    public void g() {   // 3. Shoud jump HERE <<<<<<

    }

In javascript works ok.

Thanks for this GREAT extension.
Raúl

Give user the ability to set which symbols to navigate between

Right now the extension navigates up and down all of the symbols. It would be useful to be able to limit the symbols to just certain symbols you care about.

For instance, being able to navigate up and down the methods and classes without stopping at variables.

Can't configure what members to skip

Hey there,
thanks for great extension.

Unfortunately I can't configure it:

settings.json:

...
"gotoNextPreviousMember.symbolKinds": ["function", "method"],
...

doesn't work. Empty array works fine.

Navigate members at same level

Please make it possible, so that when we use the keyboard shortcuts to navigate members, that we only navigate the members that are on the same level.

This would be useful, so that we don't enter into a block, for instance. Especially when the block contains a lot of statements. And instead, that we only navigate statements on the same level/indentation that we began on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.