Skip to content

Commit a43077a

Browse files
committed
Handle click event on reload button
1 parent 295c398 commit a43077a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/extension.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ function listener(previousConfiguration) {
3737
if (hasSemicolons !== previousConfiguration.get('semicolons')) {
3838
try {
3939
writeSnippets(snippets(hasSemicolons));
40-
// TODO: Provide item (presented as button) that'd on click reload window
41-
vscode.window.showWarningMessage(
42-
`Run 'Reload Window' command from 'Command Palette' in order for change in extension \`${EXTENSION_ID}\` configuration to take effect.`
43-
);
40+
41+
const action = 'Reload';
42+
vscode.window
43+
.showInformationMessage(
44+
`Reload window in order for change in extension \`${EXTENSION_ID}\` configuration to take effect.`,
45+
action
46+
)
47+
.then(selectedAction => {
48+
if (selectedAction === action) {
49+
vscode.commands.executeCommand('workbench.action.reloadWindow');
50+
}
51+
});
4452
} catch (error) {
4553
vscode.window.showErrorMessage(
4654
`Extension \`${EXTENSION_ID}\` failed to write snippets to the file.`

0 commit comments

Comments
 (0)