Expand description
§Navigation history + URI labels
Two related responsibilities sharing the same dispatcher family:
History*- back/forward chain over editor URIs. Drives the workbench’s back/forward buttons + the Cmd+Alt+- jump list. Stack lives inApplicationState.Feature.NavigationHistory.Label*- URI → human-readable label resolution. Used by tabs, breadcrumbs, and quick-open labels.
Layout (one export per file, file name = identity):
HistoryGoBack::HistoryGoBack,HistoryGoForward::HistoryGoForward,HistoryCanGoBack::HistoryCanGoBack,HistoryCanGoForward::HistoryCanGoForward,HistoryPush::HistoryPush,HistoryClear::HistoryClear,HistoryGetStack::HistoryGetStack.LabelGetURI::LabelGetURI,LabelGetWorkspace::LabelGetWorkspace,LabelGetBase::LabelGetBase.
Modules§
- History
CanGo Back - Predicate: is the back-stack non-empty? Drives the enabled-state of the workbench’s back-arrow button.
- History
CanGo Forward - Predicate: is the forward-stack non-empty? Twin of
HistoryCanGoBack. - History
Clear - Wipe both the back- and forward-stacks. Issued on workspace close / reload so a stale URL list doesn’t leak into the next session.
- History
GetStack - Snapshot of the entire navigation history as a
Vec<String>. Used by the navigate-history quick-pick (Cmd+Alt+-) which lists every recently-visited file inline. - History
GoBack - Pop the previous URI off the back-stack and return it.
Nonewhen the stack is empty (caller should disable the back button). - History
GoForward - Pop the next URI off the forward-stack and return it.
Mirrors
HistoryGoBack. - History
Push - Push a URI onto the navigation history. Called by Wind every time the active editor changes, so the back/forward chain reflects the user’s actual jump trail.
- Label
GetBase - Last path segment (filename + extension) of a URI. Used by the editor tabs and breadcrumbs where only the file’s name is wanted, not its full path.
- Label
GetURI - Resolve a human-readable display label for a URI. Two modes:
- Label
GetWorkspace - Display label for the current workspace’s root folder.
Prefers the explicit
Nameif the user set one (.code-workspace’snamefield); otherwise falls back to the trailing path segment of the URI.