Skip to main content

Module Navigation

Module Navigation 

Source
Expand description

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 in ApplicationState.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§

HistoryCanGoBack
Predicate: is the back-stack non-empty? Drives the enabled-state of the workbench’s back-arrow button.
HistoryCanGoForward
Predicate: is the forward-stack non-empty? Twin of HistoryCanGoBack.
HistoryClear
Wipe both the back- and forward-stacks. Issued on workspace close / reload so a stale URL list doesn’t leak into the next session.
HistoryGetStack
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.
HistoryGoBack
Pop the previous URI off the back-stack and return it. None when the stack is empty (caller should disable the back button).
HistoryGoForward
Pop the next URI off the forward-stack and return it. Mirrors HistoryGoBack.
HistoryPush
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.
LabelGetBase
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.
LabelGetURI
Resolve a human-readable display label for a URI. Two modes:
LabelGetWorkspace
Display label for the current workspace’s root folder. Prefers the explicit Name if the user set one (.code-workspace’s name field); otherwise falls back to the trailing path segment of the URI.