Bookmarks for VS CodeThis extension helps you efficiently manage and track files or specific locations within your projects. Use it to leave breadcrumbs while debugging, navigate your code more easily, or quickly switch between tasks by bookmarking all open editors.
BookmarkA bookmark is a reference to a specific location within a document. Bookmarks are grouped as A bookmark's identity is tied to its URL, which normally includes a one-based line fragment (e.g., Bookmark FoldersA folder is a container for bookmarks. They are not related to the file system hierarchy associated to any of the contained bookmarks. The only constraint imposed by folders is that a given bookmark must be unique within it. For example, you can add a bookmark to Bookmarks ViewThe Bookmarks View is the main UI component for this extension. Bookmarks are split into two categories:
You can change the display mode of the tree:
Adding a BookmarkCommandsThere are two commands available to add a bookmark: Bookmarks: Bookmark Editor (Global) and Bookmarks: Bookmark Editor (Workspace). Both work on the active editor and add a bookmark to the appropriate category. When a bookmark is created using any of these commands, the current line location or selection is captured. Programmatic accessThe following commands are available for other extensions to use: Line information can be added by appending a fragment to the URI in the format: Drag and DropEditors can be dragged onto the tree, and they will be bookmarked. Additionally, you can drag items between categories to move them. When a bookmark is created bu dragging a file onto the Bookmarks view, line information is not captured. TreeThere is a Removing One or All BookmarksCommandsThere are two commands available: Bookmarks: Remove All (Global) and Bookmarks: Remove All (Workspace). Programmatic accessThe following commands are available for other extensions to use:
TreeThere is an Bookmark PropertiesDisplay NameAssigning a custom display name to a bookmark affects how it is presented in the UI. This can be used to provide a meaningful name, such as "Bug Location". Context MenuIn the Display Name context menu for a given bookmark, use:
Line or Line-RangeUpdating the line information helps keep bookmarks in-sync with changes to their targets or to fix an incorrect value. Bookmarks can only target full lines at this time. Context MenuIn the Line or Range context menu for a given bookmark, use:
NotesAttach text notes to a bookmark for reference. Notes appear in the bookmark’s tooltip. Context MenuIn the Notes context menu for a given bookmark, use:
NavigationClicking a bookmark in the Bookmarks view opens its target editor and selects the target range. For multi-line bookmarks the default start-to-start selection made ranges look like they were missing the last line and made single-line bookmarks harder to spot, so the default selection mode is now full-line. You can change this behavior in the Bookmarks: Selection Mode setting. CommandsThere are two commands, Bookmarks: Go to Next in Current Editor and Bookmarks: Go to Previous in Current Editor, that can be used to jump between bookmarks set in the current editor. Programmatic accessThe following commands are available for other extensions to use: VisualizationClicking a bookmark in the Bookmarks view selects its target range in the appropriate editor. Bookmarks can also be rendered as markers on the corresponding editor gutter. This is supported via the Bookmarks: Toggle In-Editor Markers command but it is disabled by default due to [VSCode #5923](https://github.com/Microsoft/vscode/issues/5923) which causes these markers to affect the breakpoint markers in some cases (unacceptable experience). You can also use the Hide In-Editor Markers and Show In-Editor Markers actions in the Bookmarks view menu.
You can add breakpoints to covered lines via the gutter's context menu when markers are visible. |