diff --git a/editors/code/package.json b/editors/code/package.json index c57fbdda2a..1326649266 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -158,6 +158,11 @@ "title": "Restart server", "category": "Rust Analyzer" }, + { + "command": "rust-analyzer.updateGithubToken", + "title": "Update Github API token", + "category": "Rust Analyzer" + }, { "command": "rust-analyzer.onEnter", "title": "Enhanced enter key", @@ -984,6 +989,10 @@ "command": "rust-analyzer.reload", "when": "inRustProject" }, + { + "command": "rust-analyzer.updateGithubToken", + "when": "inRustProject" + }, { "command": "rust-analyzer.onEnter", "when": "inRustProject" diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 409e4b5c26..2fcd853d44 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -95,6 +95,10 @@ async function tryActivate(context: vscode.ExtensionContext) { await activate(context).catch(log.error); }); + ctx.registerCommand('updateGithubToken', ctx => async () => { + await queryForGithubToken(new PersistentState(ctx.globalState)); + }); + ctx.registerCommand('analyzerStatus', commands.analyzerStatus); ctx.registerCommand('memoryUsage', commands.memoryUsage); ctx.registerCommand('reloadWorkspace', commands.reloadWorkspace);