Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit d209c16

Browse files
committed
Add a context key for whether history exists
1 parent b04608b commit d209c16

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
{
150150
"command": "references-view.clearHistory",
151151
"group": "navigation",
152-
"when": "!reference-list.hasResult"
152+
"when": "reference-list.hasHistory"
153153
}
154154
],
155155
"view/item/context": [

src/extension.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export function activate(context: vscode.ExtensionContext) {
115115
if (model) {
116116
// update history
117117
history.add(model);
118+
vscode.commands.executeCommand('setContext', 'reference-list.hasHistory', true);
118119
}
119120
};
120121

@@ -147,6 +148,7 @@ export function activate(context: vscode.ExtensionContext) {
147148
const clearHistoryCommand = async () => {
148149
await clearCommand();
149150
history.clear();
151+
vscode.commands.executeCommand('setContext', 'reference-list.hasHistory', false);
150152
}
151153

152154
const showRefCommand = (arg?: ReferenceItem | HistoryItem | any, focusEditor?: boolean) => {

0 commit comments

Comments
 (0)