Code Navigator (code-navigator-hiteshgeek)

Code Navigator (code-navigator-hiteshgeek) is a Visual Studio Code extension that lets you quickly jump to the next or previous code block (function, class, struct, trait, interface, control flow, etc.) in any programming language using keyboard shortcuts.
🚩 New Feature : Bookmark Navigation and Management
- Jump to Next/Previous Bookmark: Quickly cycle through bookmarks in the current file using keyboard shortcuts:
- Next Bookmark:
Ctrl+Win+Insert
- Previous Bookmark:
Ctrl+Win+Delete
- Bookmark Gutter Icons: Bookmarked lines are now visually marked with a gutter icon in the editor for easy identification.
- Duplicate Prevention: You cannot add the same line to the same bookmark label more than once.
- Sorted Bookmark Labels: Bookmark groups in the Activity Bar are now sorted alphabetically for easier navigation.
- Context Menu Delete: Remove bookmarks directly from the Activity Bar context menu (right-click on a bookmark).
- Move or Copy Bookmarks Between Labels: Easily move or copy any bookmark to a different label from the Activity Bar context menu. Organize your bookmarks flexibly without duplication.
See the Changelog for details.
✨ Key Feature: End Block Annotation
See exactly which block you navigated to! When you jump to the end of any code block, a temporary inline annotation appears at the end line, showing:
//end of (line_number) : content of first line
This annotation stays visible as long as your cursor is at the end of the block, making it easy to identify the block's start and scope at a glance. Works for all supported languages!
Highlights
- Full PHP AST-based navigation: Accurate navigation for PHP classes, interfaces, traits, methods, functions, and control flow blocks (if, else if, else, switch, case) using
nikic/php-parser .
- User-configurable block types: Enable/disable navigation for enums, control flow, and more via extension settings.
- Interface and trait navigation always enabled for PHP.
- Works with a wide variety of languages: JavaScript, TypeScript, Python, PHP, Java, C, C++, C#, Go, Rust, CSS, LESS, SCSS, and more.
- Automated packaging: PHP dependencies are bundled automatically;
vendor/ is ignored by git.
- Customizable keybindings: Change shortcuts in VS Code Keyboard Shortcuts settings.
Default Keybindings
Action |
Shortcut (Windows/Linux) |
Shortcut (macOS) |
Go to Next Block Start |
Ctrl+Win+End |
Ctrl+Cmd+End |
Go to Previous Block Start |
Ctrl+Win+Home |
Ctrl+Cmd+Home |
Go to Next Block End |
Ctrl+Win+PageDown |
Ctrl+Cmd+PageDown |
Go to Previous Block End |
Ctrl+Win+PageUp |
Ctrl+Cmd+PageUp |
You can change these keybindings in your VS Code Keyboard Shortcuts settings.
Usage
- Open any code file in a supported language.
- Place your cursor anywhere in the file.
- Use the shortcuts to jump between code blocks.
- When you land at the end of a block, look for the inline annotation to see which block you are at!
Supported Languages
- JavaScript, TypeScript
- Python
- PHP (with full AST support)
- Java
- C, C++, C#
- Go
- Rust
- CSS, LESS, SCSS
How It Works
- For PHP, uses a robust AST parser (
nikic/php-parser ) for perfect block detection, including control flow and all OOP constructs.
- For other languages, uses the VS Code Symbol Provider API for fast, language-aware navigation.
- User settings control which block types are navigable.
- End block annotation is implemented as a reusable component and works for all supported languages.
Links
License
MIT
Author
| |