in src/tree.ts [208:249]
constructor(private readonly _tree: SymbolsTree) {
this._disposables.push(
vscode.commands.registerCommand('references-view.clear', () => _tree.clearInput()),
vscode.commands.registerCommand('references-view.clearHistory', () => {
this.clear();
_tree.clearInput();
}),
vscode.commands.registerCommand('references-view.refind', (item) => {
if (item instanceof HistoryItem) {
this._reRunHistoryItem(item);
}
}),
vscode.commands.registerCommand('references-view.refresh', () => {
const item = Array.from(this._inputs.values()).pop();
if (item) {
this._reRunHistoryItem(item);
}
}),
vscode.commands.registerCommand('_references-view.showHistoryItem', (item) => {
if (item instanceof HistoryItem) {
const position = item.anchor.guessedTrackedPosition() ?? item.input.location.range.start;
return vscode.commands.executeCommand('vscode.open', item.input.location.uri, { selection: new vscode.Range(position, position) });
}
}),
vscode.commands.registerCommand('references-view.pickFromHistory', async () => {
interface HistoryPick extends vscode.QuickPickItem {
item: HistoryItem;
}
const entries = await this.getChildren();
const picks = entries.map(item => <HistoryPick>{
label: item.word,
description: item.description,
item
});
const pick = await vscode.window.showQuickPick(picks, { placeHolder: 'Select previous reference search' });
if (pick) {
this._reRunHistoryItem(pick.item);
}
}),
);
}