Why Was I Here?
A VS Code extension that helps you add descriptions and bookmarks to pieces of your code, answering the eternal question "Why was I here?"
Features
- WHYWASIHERE Explorer Panel: An expandable sidebar panel in the Explorer view that shows all your code bookmarks organized by file
- Groups for notes: Create and organize notes under named groups (for example: Work, Personal, TODO). When you add a note you'll be asked whether to add it to a group. You can choose "No Group", pick an existing group, or create a new one on the spot.
- Context Menu Integration: Right-click anywhere in your code and select "Why Was I Here?" to add a bookmark with a description
- Quick Bookmark Management: Add, view, and remove bookmarks with ease
- Persistent Storage: Your bookmarks are saved and restored between VS Code sessions
- Smart Navigation: Click on any bookmark to jump directly to that location in your code
- Group-aware Explorer: The tree view now displays notes grouped by group -> file -> note. "No Group" appears first in the list.
- Drag & Drop: Drag notes between groups in the explorer to reassign them quickly.
Usage
Adding Bookmarks
- From Context Menu: Right-click in any editor and select "Why Was I Here?" to add a bookmark at the cursor position
- From Explorer Panel: Click the "+" button in the WHYWASIHERE panel toolbar to add a bookmark for the current active editor location
When you add a bookmark you'll be prompted to optionally assign it to a group. The prompt lists existing groups with "No Group" first and also includes a "Create new group..." option to enter a new group name.
Viewing Bookmarks
- Open the Explorer sidebar and expand the "WHYWASIHERE" section
- Bookmarks are organized by file, showing the number of bookmarks in each file
- Each bookmark shows its description and line number
Navigating to Bookmarks
- Click on any bookmark in the WHYWASIHERE panel to jump directly to that location in your code
- The editor will automatically scroll to the bookmarked line and position the cursor
Managing Bookmarks
- Use the refresh button (🔄) in the panel toolbar to update the bookmark list
- Remove bookmarks by using the trash icon that appears when hovering over bookmark items
- Reassign a note to a group by dragging it into another group in the explorer
- Create a new group at note creation time via the "Create new group..." option
Development Setup
This extension includes a test workspace with mock code files for development and testing:
- The test workspace is automatically created when you run the extension in development mode
- Mock files include various programming languages (JavaScript, Python, TypeScript/React) with realistic code samples
- Test files contain different types of comments (TODO, FIXME, REVIEW, etc.) perfect for testing bookmark functionality
Requirements
- VS Code version 1.102.0 or higher
Extension Settings
Include if your extension adds any VS Code settings through the contributes.configuration
extension point.
For example:
This extension contributes the following settings:
myExtension.enable
: Enable/disable this extension.
myExtension.thing
: Set to blah
to do something.
Known Issues
Calling out known issues can help limit users opening duplicate issues against your extension.
Release Notes
Users appreciate release notes as you update your extension.
1.0.0
Initial release of ...
1.0.1
Fixed issue #.
1.1.0
Added features X, Y, and Z.
Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
Working with Markdown
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
- Split the editor (
Cmd+\
on macOS or Ctrl+\
on Windows and Linux).
- Toggle preview (
Shift+Cmd+V
on macOS or Shift+Ctrl+V
on Windows and Linux).
- Press
Ctrl+Space
(Windows, Linux, macOS) to see a list of Markdown snippets.
Enjoy!