@@ -46,12 +46,12 @@ import globals from './shared/extensionGlobals'
4646import { Experiments , Settings , showSettingsFailedMsg } from './shared/settings'
4747import { isReleaseVersion } from './shared/vscode/env'
4848import { AuthStatus , AuthUserState , telemetry } from './shared/telemetry/telemetry'
49- import { Auth , SessionSeparationPrompt } from './auth/auth'
49+ import { Auth } from './auth/auth'
5050import { getTelemetryMetadataForConn } from './auth/connection'
5151import { registerSubmitFeedback } from './feedback/vue/submitFeedback'
5252import { activateCommon , deactivateCommon } from './extension'
5353import { learnMoreAmazonQCommand , qExtensionPageCommand , dismissQTree } from './amazonq/explorer/amazonQChildrenNodes'
54- import { AuthUtil , codeWhispererCoreScopes , isPreviousQUser } from './codewhisperer/util/authUtil'
54+ import { codeWhispererCoreScopes } from './codewhisperer/util/authUtil'
5555import { installAmazonQExtension } from './codewhisperer/commands/basicCommands'
5656import { isExtensionInstalled , VSCODE_EXTENSION_ID } from './shared/utilities'
5757import { ExtensionUse , getAuthFormIdsFromConnection , initializeCredentialsProviderManager } from './auth/utils'
@@ -139,16 +139,8 @@ export async function activate(context: vscode.ExtensionContext) {
139139 conn . scopes
140140 )
141141 await Auth . instance . forgetConnection ( conn )
142- await SessionSeparationPrompt . instance . showForCommand ( 'aws.toolkit.auth.manageConnections' )
143142 }
144143 }
145-
146- // Display last prompt if connections were forgotten in prior sessions
147- // but the user did not interact or sign in again. Useful in case the user misses it the first time.
148- await SessionSeparationPrompt . instance . showAnyPreviousPrompt ( )
149-
150- // MUST restore CW/Q auth so that we can see if this user is already a Q user.
151- await AuthUtil . instance . restore ( )
152144 } ,
153145 { emit : false , functionId : { name : 'activate' , class : 'ExtensionNodeCore' } }
154146 )
@@ -272,52 +264,47 @@ export async function deactivate() {
272264
273265async function handleAmazonQInstall ( ) {
274266 const dismissedInstall = globals . globalState . get < boolean > ( 'aws.toolkit.amazonqInstall.dismissed' )
275- if ( isExtensionInstalled ( VSCODE_EXTENSION_ID . amazonq ) || dismissedInstall ) {
267+ if ( dismissedInstall ) {
268+ return
269+ }
270+
271+ if ( isExtensionInstalled ( VSCODE_EXTENSION_ID . amazonq ) ) {
272+ await globals . globalState . update ( 'aws.toolkit.amazonqInstall.dismissed' , true )
276273 return
277274 }
278275
279276 await telemetry . toolkit_showNotification . run ( async ( ) => {
280- if ( isPreviousQUser ( ) ) {
281- await installAmazonQExtension . execute ( )
282- telemetry . record ( { id : 'amazonQStandaloneInstalled' } )
283- void vscode . window . showInformationMessage (
284- "Amazon Q is now its own extension.\n\nWe've auto-installed it for you with all the same features and settings from CodeWhisperer and Amazon Q chat."
277+ telemetry . record ( { id : 'amazonQStandaloneChange' } )
278+ void vscode . window
279+ . showInformationMessage (
280+ 'Try Amazon Q, a generative AI assistant, with chat and code suggestions.' ,
281+ 'Install' ,
282+ 'Learn More'
285283 )
286- await globals . globalState . update ( 'aws.toolkit.amazonqInstall.dismissed' , true )
287- } else {
288- telemetry . record ( { id : 'amazonQStandaloneChange' } )
289- void vscode . window
290- . showInformationMessage (
291- 'Amazon Q has moved to its own extension.' +
292- '\nInstall it to use Amazon Q, a generative AI assistant, with chat and code suggestions.' ,
293- 'Install' ,
294- 'Learn More'
295- )
296- . then ( async ( resp ) => {
297- await telemetry . toolkit_invokeAction . run ( async ( ) => {
298- telemetry . record ( {
299- source : ExtensionUse . instance . isFirstUse ( )
300- ? ExtStartUpSources . firstStartUp
301- : ExtStartUpSources . none ,
302- } )
303-
304- if ( resp === 'Learn More' ) {
305- // Clicking learn more will open the q extension page
306- telemetry . record ( { action : 'learnMore' } )
307- await qExtensionPageCommand . execute ( )
308- return
309- }
310-
311- if ( resp === 'Install' ) {
312- telemetry . record ( { action : 'installAmazonQ' } )
313- await installAmazonQExtension . execute ( )
314- } else {
315- telemetry . record ( { action : 'dismissQNotification' } )
316- }
317- await globals . globalState . update ( 'aws.toolkit.amazonqInstall.dismissed' , true )
284+ . then ( async ( resp ) => {
285+ await telemetry . toolkit_invokeAction . run ( async ( ) => {
286+ telemetry . record ( {
287+ source : ExtensionUse . instance . isFirstUse ( )
288+ ? ExtStartUpSources . firstStartUp
289+ : ExtStartUpSources . none ,
318290 } )
291+
292+ if ( resp === 'Learn More' ) {
293+ // Clicking learn more will open the q extension page
294+ telemetry . record ( { action : 'learnMore' } )
295+ await qExtensionPageCommand . execute ( )
296+ return
297+ }
298+
299+ if ( resp === 'Install' ) {
300+ telemetry . record ( { action : 'installAmazonQ' } )
301+ await installAmazonQExtension . execute ( )
302+ } else {
303+ telemetry . record ( { action : 'dismissQNotification' } )
304+ }
305+ await globals . globalState . update ( 'aws.toolkit.amazonqInstall.dismissed' , true )
319306 } )
320- }
307+ } )
321308 } )
322309}
323310
0 commit comments