Skip to content

Commit c363389

Browse files
authored
feat(amazonq): Notify users to reload when amazonqLSP experiment flag has changed (#6494)
## Problem - The amazonqLSP flag is only checked at start. This sidesteps the amount of work that would be required to enable/disable codewhisperer at runtime. However, its not obvious they need to restart their editor ## Solution - Notify users that they should reload when they change the experiments setting --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 411c6bf commit c363389

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/amazonq/src/extension.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,23 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
154154
void focusAmazonQPanel.execute(placeholder, 'firstStartUp')
155155
}, 1000)
156156
}
157+
158+
context.subscriptions.push(
159+
Experiments.instance.onDidChange(async (event) => {
160+
if (event.key === 'amazonqLSP') {
161+
await vscode.window
162+
.showInformationMessage(
163+
'Amazon Q LSP setting has changed. Reload VS Code for the changes to take effect.',
164+
'Reload Now'
165+
)
166+
.then(async (selection) => {
167+
if (selection === 'Reload Now') {
168+
await vscode.commands.executeCommand('workbench.action.reloadWindow')
169+
}
170+
})
171+
}
172+
})
173+
)
157174
}
158175

159176
export async function deactivateCommon() {

0 commit comments

Comments
 (0)