Skip to content

Commit 501b516

Browse files
committed
Add a command for updating the Github API token
1 parent a0a7cd3 commit 501b516

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

editors/code/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@
158158
"title": "Restart server",
159159
"category": "Rust Analyzer"
160160
},
161+
{
162+
"command": "rust-analyzer.updateGithubToken",
163+
"title": "Update Github API token",
164+
"category": "Rust Analyzer"
165+
},
161166
{
162167
"command": "rust-analyzer.onEnter",
163168
"title": "Enhanced enter key",
@@ -984,6 +989,10 @@
984989
"command": "rust-analyzer.reload",
985990
"when": "inRustProject"
986991
},
992+
{
993+
"command": "rust-analyzer.updateGithubToken",
994+
"when": "inRustProject"
995+
},
987996
{
988997
"command": "rust-analyzer.onEnter",
989998
"when": "inRustProject"

editors/code/src/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ async function tryActivate(context: vscode.ExtensionContext) {
9595
await activate(context).catch(log.error);
9696
});
9797

98+
ctx.registerCommand('updateGithubToken', ctx => async () => {
99+
await queryForGithubToken(new PersistentState(ctx.globalState));
100+
});
101+
98102
ctx.registerCommand('analyzerStatus', commands.analyzerStatus);
99103
ctx.registerCommand('memoryUsage', commands.memoryUsage);
100104
ctx.registerCommand('reloadWorkspace', commands.reloadWorkspace);

0 commit comments

Comments
 (0)