@@ -47,12 +47,12 @@ import globals from './shared/extensionGlobals'
4747import { Experiments , Settings , showSettingsFailedMsg } from './shared/settings'
4848import { isReleaseVersion } from './shared/vscode/env'
4949import { AuthStatus , AuthUserState , telemetry } from './shared/telemetry/telemetry'
50- import { Auth , SessionSeparationPrompt } from './auth/auth'
50+ import { Auth } from './auth/auth'
5151import { getTelemetryMetadataForConn } from './auth/connection'
5252import { registerSubmitFeedback } from './feedback/vue/submitFeedback'
5353import { activateCommon , deactivateCommon } from './extension'
5454import { learnMoreAmazonQCommand , qExtensionPageCommand , dismissQTree } from './amazonq/explorer/amazonQChildrenNodes'
55- import { AuthUtil , codeWhispererCoreScopes , isPreviousQUser } from './codewhisperer/util/authUtil'
55+ import { codeWhispererCoreScopes } from './codewhisperer/util/authUtil'
5656import { installAmazonQExtension } from './codewhisperer/commands/basicCommands'
5757import { isExtensionInstalled , VSCODE_EXTENSION_ID } from './shared/utilities'
5858import { ExtensionUse , getAuthFormIdsFromConnection , initializeCredentialsProviderManager } from './auth/utils'
@@ -140,16 +140,8 @@ export async function activate(context: vscode.ExtensionContext) {
140140 conn . scopes
141141 )
142142 await Auth . instance . forgetConnection ( conn )
143- await SessionSeparationPrompt . instance . showForCommand ( 'aws.toolkit.auth.manageConnections' )
144143 }
145144 }
146-
147- // Display last prompt if connections were forgotten in prior sessions
148- // but the user did not interact or sign in again. Useful in case the user misses it the first time.
149- await SessionSeparationPrompt . instance . showAnyPreviousPrompt ( )
150-
151- // MUST restore CW/Q auth so that we can see if this user is already a Q user.
152- await AuthUtil . instance . restore ( )
153145 } ,
154146 { emit : false , functionId : { name : 'activate' , class : 'ExtensionNodeCore' } }
155147 )
@@ -275,52 +267,47 @@ export async function deactivate() {
275267
276268async function handleAmazonQInstall ( ) {
277269 const dismissedInstall = globals . globalState . get < boolean > ( 'aws.toolkit.amazonqInstall.dismissed' )
278- if ( isExtensionInstalled ( VSCODE_EXTENSION_ID . amazonq ) || dismissedInstall ) {
270+ if ( dismissedInstall ) {
271+ return
272+ }
273+
274+ if ( isExtensionInstalled ( VSCODE_EXTENSION_ID . amazonq ) ) {
275+ await globals . globalState . update ( 'aws.toolkit.amazonqInstall.dismissed' , true )
279276 return
280277 }
281278
282279 await telemetry . toolkit_showNotification . run ( async ( ) => {
283- if ( isPreviousQUser ( ) ) {
284- await installAmazonQExtension . execute ( )
285- telemetry . record ( { id : 'amazonQStandaloneInstalled' } )
286- void vscode . window . showInformationMessage (
287- "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."
280+ telemetry . record ( { id : 'amazonQStandaloneChange' } )
281+ void vscode . window
282+ . showInformationMessage (
283+ 'Try Amazon Q, a generative AI assistant, with chat and code suggestions.' ,
284+ 'Install' ,
285+ 'Learn More'
288286 )
289- await globals . globalState . update ( 'aws.toolkit.amazonqInstall.dismissed' , true )
290- } else {
291- telemetry . record ( { id : 'amazonQStandaloneChange' } )
292- void vscode . window
293- . showInformationMessage (
294- 'Amazon Q has moved to its own extension.' +
295- '\nInstall it to use Amazon Q, a generative AI assistant, with chat and code suggestions.' ,
296- 'Install' ,
297- 'Learn More'
298- )
299- . then ( async ( resp ) => {
300- await telemetry . toolkit_invokeAction . run ( async ( ) => {
301- telemetry . record ( {
302- source : ExtensionUse . instance . isFirstUse ( )
303- ? ExtStartUpSources . firstStartUp
304- : ExtStartUpSources . none ,
305- } )
306-
307- if ( resp === 'Learn More' ) {
308- // Clicking learn more will open the q extension page
309- telemetry . record ( { action : 'learnMore' } )
310- await qExtensionPageCommand . execute ( )
311- return
312- }
313-
314- if ( resp === 'Install' ) {
315- telemetry . record ( { action : 'installAmazonQ' } )
316- await installAmazonQExtension . execute ( )
317- } else {
318- telemetry . record ( { action : 'dismissQNotification' } )
319- }
320- await globals . globalState . update ( 'aws.toolkit.amazonqInstall.dismissed' , true )
287+ . then ( async ( resp ) => {
288+ await telemetry . toolkit_invokeAction . run ( async ( ) => {
289+ telemetry . record ( {
290+ source : ExtensionUse . instance . isFirstUse ( )
291+ ? ExtStartUpSources . firstStartUp
292+ : ExtStartUpSources . none ,
321293 } )
294+
295+ if ( resp === 'Learn More' ) {
296+ // Clicking learn more will open the q extension page
297+ telemetry . record ( { action : 'learnMore' } )
298+ await qExtensionPageCommand . execute ( )
299+ return
300+ }
301+
302+ if ( resp === 'Install' ) {
303+ telemetry . record ( { action : 'installAmazonQ' } )
304+ await installAmazonQExtension . execute ( )
305+ } else {
306+ telemetry . record ( { action : 'dismissQNotification' } )
307+ }
308+ await globals . globalState . update ( 'aws.toolkit.amazonqInstall.dismissed' , true )
322309 } )
323- }
310+ } )
324311 } )
325312}
326313
0 commit comments