Skip to content

Commit

Permalink
Add prompt to optionally reload window on configuration change
Browse files Browse the repository at this point in the history
  • Loading branch information
wk1 committed Apr 4, 2022
1 parent 53762b6 commit f822cd4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,23 @@ export function activate(context: vscode.ExtensionContext) {
tabmix_decoration_type && activeEditor.setDecorations(tabmix_decoration_type, tabmix_decorator);
clearMe = true;
}
/**
* Listen for configuration change in indentRainbow section
* When anything changes in the section, show a prompt to reload
* VSCode window
*/
vscode.workspace.onDidChangeConfiguration(configChangeEvent => {

if (configChangeEvent.affectsConfiguration('indentRainbow')) {
const actions = ['Reload now', 'Later'];

vscode.window
.showInformationMessage('The VSCode window needs to reload for the changes to take effect. Would you like to reload the window now?', ...actions)
.then(action => {
if (action === actions[0]) {
vscode.commands.executeCommand('workbench.action.reloadWindow');
}
});
}
});
}

0 comments on commit f822cd4

Please sign in to comment.