@@ -7,7 +7,7 @@ import * as vscode from 'vscode'
77import { ExtensionContext , window } from 'vscode'
88import { telemetry } from 'aws-core-vscode/telemetry'
99import { AuthUtil , CodeWhispererSettings } from 'aws-core-vscode/codewhisperer'
10- import { Commands , placeholder , funcUtil , getLogger , setContext } from 'aws-core-vscode/shared'
10+ import { Commands , placeholder , funcUtil , setContext , isSageMaker } from 'aws-core-vscode/shared'
1111import * as amazonq from 'aws-core-vscode/amazonq'
1212import { scanChatAppInit } from '../amazonqScan'
1313import { init as inlineChatInit } from '../../inlineChat/app'
@@ -16,7 +16,7 @@ export async function activate(context: ExtensionContext) {
1616 const appInitContext = amazonq . DefaultAmazonQAppInitContext . instance
1717
1818 registerApps ( appInitContext , context )
19- await setupAmazonQState ( )
19+ await setIsSMUSContext ( )
2020
2121 const provider = new amazonq . AmazonQChatViewProvider (
2222 context ,
@@ -65,12 +65,10 @@ export async function activate(context: ExtensionContext) {
6565 void setupLsp ( )
6666 void setupAuthNotification ( )
6767
68- async function setupAmazonQState ( ) {
69- const serviceName = process . env . SERVICE_NAME ?? 'AmazonQ' // Fallback service name to a generic name AmazonQ
70- const amazonQState = amazonq . AmazonQState . initialize ( serviceName )
71- getLogger ( ) . info ( `In Extension activation - q state is initialized ${ amazonQState . serviceName } ` )
72- // Create a context key for SageMaker Studio state and set in context
73- await setContext ( 'aws.amazonq.isSagemakerUnifiedStudio' , amazonQState . isSageMakerUnifiedStudio ( ) )
68+ async function setIsSMUSContext ( ) {
69+ // set context key for SageMaker Unified Studio
70+ const isSMUS = isSageMaker ( true )
71+ await setContext ( 'aws.isSageMakerUnifiedStudio' , isSMUS )
7472 }
7573}
7674
0 commit comments