Skip to content

Commit 60f9b98

Browse files
authored
Cause suggest widget to retrigger
Fixes #1642
1 parent 33e3cd8 commit 60f9b98

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,11 @@
639639
"light": "resources/icons/light/refresh.svg"
640640
}
641641
},
642+
{
643+
"command": "issue.suggestRefresh",
644+
"title": "Refresh Suggestions",
645+
"category": "GitHub Issues"
646+
},
642647
{
643648
"command": "issue.startWorking",
644649
"title": "Start Working on Issue",
@@ -705,7 +710,7 @@
705710
"keybindings": [
706711
{
707712
"key": "ctrl+shift+space",
708-
"command": "issue.refresh",
713+
"command": "issue.suggestRefresh",
709714
"when": "suggestWidgetVisible"
710715
},
711716
{
@@ -868,6 +873,10 @@
868873
"command": "issue.refresh",
869874
"when": "false"
870875
},
876+
{
877+
"command": "issue.suggestRefresh",
878+
"when": "false"
879+
},
871880
{
872881
"command": "issue.startWorking",
873882
"when": "false"

src/issues/issueFeatureRegistrar.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ export class IssueFeatureRegistrar implements vscode.Disposable {
126126
this.telemetry.sendTelemetryEvent('issue.refresh');
127127
return this.refreshView();
128128
}, this));
129+
this.context.subscriptions.push(vscode.commands.registerCommand('issue.suggestRefresh', () => {
130+
/* __GDPR__
131+
"issue.suggestRefresh" : {}
132+
*/
133+
this.telemetry.sendTelemetryEvent('issue.suggestRefresh');
134+
return this.suggestRefresh();
135+
}, this));
129136
this.context.subscriptions.push(vscode.commands.registerCommand('issue.getCurrent', () => {
130137
/* __GDPR__
131138
"issue.getCurrent" : {}
@@ -289,6 +296,12 @@ export class IssueFeatureRegistrar implements vscode.Disposable {
289296
this._stateManager.refreshCacheNeeded();
290297
}
291298

299+
async suggestRefresh() {
300+
await vscode.commands.executeCommand('hideSuggestWidget');
301+
await this._stateManager.refresh();
302+
return vscode.commands.executeCommand('editor.action.triggerSuggest');
303+
}
304+
292305
openIssue(issueModel: any) {
293306
if (issueModel instanceof IssueModel) {
294307
return vscode.env.openExternal(vscode.Uri.parse(issueModel.html_url));

src/issues/stateManager.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ export class StateManager {
108108
this._onRefreshCacheNeeded.fire();
109109
}
110110

111+
async refresh(): Promise<void> {
112+
return this.setIssueData();
113+
}
114+
111115
private async doInitialize() {
112116
this.cleanIssueState();
113117
this._queries = vscode.workspace.getConfiguration(ISSUES_CONFIGURATION).get(QUERIES_CONFIGURATION, DEFAULT_QUERY_CONFIGURATION_VALUE);
@@ -127,7 +131,7 @@ export class StateManager {
127131
await this.setIssueData();
128132
this.registerRepositoryChangeEvent();
129133
this.context.subscriptions.push(this.onRefreshCacheNeeded(async () => {
130-
await this.setIssueData();
134+
await this.refresh();
131135
}));
132136
}
133137

0 commit comments

Comments
 (0)