@@ -44,7 +44,7 @@ import {
4444 CodeLensParams ,
4545 CodeLensRequest ,
4646} from 'vscode-languageserver' ;
47- import { InitializeParams , createConnection } from 'vscode-languageserver/node' ;
47+ import { createConnection } from 'vscode-languageserver/node' ;
4848import { IamCredentialsUpdateRequest , IamCredentialsDeleteNotification } from '../../src/auth/AuthProtocol' ;
4949import { UpdateCredentialsParams } from '../../src/auth/AwsLspAuthTypes' ;
5050import { MultiDataStoreFactoryProvider } from '../../src/datastore/DataStore' ;
@@ -58,6 +58,7 @@ import { CfnExternal } from '../../src/server/CfnExternal';
5858import { CfnInfraCore } from '../../src/server/CfnInfraCore' ;
5959import { CfnLspProviders } from '../../src/server/CfnLspProviders' ;
6060import { CfnServer } from '../../src/server/CfnServer' ;
61+ import { AwsMetadata , ExtendedInitializeParams } from '../../src/server/InitParams' ;
6162import { RelationshipSchemaService } from '../../src/services/RelationshipSchemaService' ;
6263import { LoggerFactory } from '../../src/telemetry/LoggerFactory' ;
6364import { Closeable } from '../../src/utils/Closeable' ;
@@ -66,7 +67,19 @@ import { createMockCfnLintService, createMockGuardService, mockCfnAi } from './M
6667import { getTestPrivateSchemas } from './SchemaUtils' ;
6768import { wait } from './Utils' ;
6869
69- const clientInfo = { name : `Test ${ ExtensionName } ` , version : '1.0.0-test' } ;
70+ const awsMetadata : AwsMetadata = {
71+ clientInfo : {
72+ extension : {
73+ name : `Test ${ ExtensionName } ` ,
74+ version : '1.0.0-test' ,
75+ } ,
76+ clientId : '1111-1111-1111-1111' ,
77+ } ,
78+ encryption : {
79+ key : randomBytes ( 32 ) . toString ( 'base64' ) ,
80+ mode : 'JWT' ,
81+ } ,
82+ } ;
7083
7184export class TestExtension implements Closeable {
7285 private readonly readStream = new PassThrough ( ) ;
@@ -85,32 +98,23 @@ export class TestExtension implements Closeable {
8598 private isReady = false ;
8699
87100 constructor (
88- private readonly initializeParams = {
101+ private readonly initializeParams : ExtendedInitializeParams = {
89102 processId : process . pid ,
90103 rootUri : null ,
91104 capabilities : { } ,
92- clientInfo,
105+ clientInfo : awsMetadata . clientInfo ?. extension ,
93106 workspaceFolders : [ ] ,
94107 initializationOptions : {
95- encryption : {
96- key : randomBytes ( 32 ) . toString ( 'base64' ) ,
97- } ,
108+ aws : awsMetadata ,
98109 } ,
99- } as InitializeParams ,
110+ } ,
100111 ) {
101112 this . serverConnection = new LspConnection (
102113 createConnection ( new StreamMessageReader ( this . readStream ) , new StreamMessageWriter ( this . writeStream ) ) ,
103114 {
104115 onInitialize : ( params ) => {
105116 const lsp = this . serverConnection . components ;
106- LoggerFactory . initialize ( {
107- clientInfo : {
108- extension : clientInfo ,
109- clientId : '1111-1111-1111-1111' ,
110- } ,
111- telemetryEnabled : true ,
112- logLevel : 'info' ,
113- } ) ;
117+ LoggerFactory . initialize ( awsMetadata ) ;
114118
115119 const dataStoreFactory = new MultiDataStoreFactoryProvider ( ) ;
116120 this . core = new CfnInfraCore ( lsp , params , {
0 commit comments