Add a command for updating the Github API token

This commit is contained in:
Matthias Einwag 2020-09-23 00:50:34 -07:00
parent a0a7cd306e
commit 501b516db4
2 changed files with 13 additions and 0 deletions

View file

@ -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"

View file

@ -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);