From 501b516db4a9a50c39e2fb90b389d77c9541e43f Mon Sep 17 00:00:00 2001 From: Matthias Einwag Date: Wed, 23 Sep 2020 00:50:34 -0700 Subject: [PATCH] Add a command for updating the Github API token --- editors/code/package.json | 9 +++++++++ editors/code/src/main.ts | 4 ++++ 2 files changed, 13 insertions(+) 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);