File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
server/aws-lsp-codewhisperer/src/shared Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -361,9 +361,20 @@ export function getBearerTokenFromProviderWithType(credentialsProvider: Credenti
361361
362362 return credentials . token
363363}
364+ function isSagemakerEnv ( ) : boolean {
365+ return (
366+ process . env . SAGEMAKER_APP_TYPE !== undefined ||
367+ process . env . SAGEMAKER_INTERNAL_IMAGE_URI !== undefined ||
368+ process . env . STUDIO_LOGGING_DIR ?. includes ( '/var/log/studio' ) === true ||
369+ process . env . SM_APP_TYPE !== undefined ||
370+ process . env . SM_INTERNAL_IMAGE_URI !== undefined ||
371+ process . env . SERVICE_NAME === 'SageMakerUnifiedStudio'
372+ )
373+ }
374+
364375export function getClientName ( lspParams : InitializeParams | undefined ) : string | undefined {
365- return process . env . SERVICE_NAME === SAGEMAKER_UNIFIED_STUDIO_SERVICE
366- ? lspParams ?. initializationOptions ?. aws ?. clientInfo ?. name
376+ return isSagemakerEnv ( )
377+ ? lspParams ?. initializationOptions ?. aws ?. clientInfo ?. name || lspParams ?. clientInfo ?. name
367378 : lspParams ?. clientInfo ?. name
368379}
369380
You can’t perform that action at this time.
0 commit comments