summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands/ideCommand.ts
diff options
context:
space:
mode:
authorShreya Keshive <[email protected]>2025-08-20 14:11:31 -0700
committerGitHub <[email protected]>2025-08-20 21:11:31 +0000
commit0e9b06d5c24ac83dbe5aef1c249b26c140414a7a (patch)
tree856e32f35438ed90fe9bcc8ee75e4be67f759e8d /packages/cli/src/ui/commands/ideCommand.ts
parent80ff3cd25ef7544ff4e6bde29770d711e820119f (diff)
feat(ide): improve IDE installation UX and feedback (#6677)
Diffstat (limited to 'packages/cli/src/ui/commands/ideCommand.ts')
-rw-r--r--packages/cli/src/ui/commands/ideCommand.ts37
1 files changed, 33 insertions, 4 deletions
diff --git a/packages/cli/src/ui/commands/ideCommand.ts b/packages/cli/src/ui/commands/ideCommand.ts
index 49766b8d..19a8090e 100644
--- a/packages/cli/src/ui/commands/ideCommand.ts
+++ b/packages/cli/src/ui/commands/ideCommand.ts
@@ -187,10 +187,6 @@ export const ideCommand = (config: Config | null): SlashCommand | null => {
);
const result = await installer.install();
- if (result.success) {
- config.setIdeMode(true);
- context.services.settings.setValue(SettingScope.User, 'ideMode', true);
- }
context.ui.addItem(
{
type: result.success ? 'info' : 'error',
@@ -198,6 +194,39 @@ export const ideCommand = (config: Config | null): SlashCommand | null => {
},
Date.now(),
);
+ if (result.success) {
+ context.services.settings.setValue(SettingScope.User, 'ideMode', true);
+ // Poll for up to 5 seconds for the extension to activate.
+ for (let i = 0; i < 10; i++) {
+ await config.setIdeModeAndSyncConnection(true);
+ if (
+ ideClient.getConnectionStatus().status ===
+ IDEConnectionStatus.Connected
+ ) {
+ break;
+ }
+ await new Promise((resolve) => setTimeout(resolve, 500));
+ }
+
+ const { messageType, content } = getIdeStatusMessage(ideClient);
+ if (messageType === 'error') {
+ context.ui.addItem(
+ {
+ type: messageType,
+ text: `Failed to automatically enable IDE integration. To fix this, run the CLI in a new terminal window.`,
+ },
+ Date.now(),
+ );
+ } else {
+ context.ui.addItem(
+ {
+ type: messageType,
+ text: content,
+ },
+ Date.now(),
+ );
+ }
+ }
},
};