Skip to content

Commit 4153ff8

Browse files
committed
wip
1 parent 6988762 commit 4153ff8

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

packages/amazonq/test/e2e/amazonq/framework/framework.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ export class qTestingFramework {
151151
await bundle(connectorPath, bundlePath)
152152
}
153153

154+
const langaugeClient = await startLanguageServer(globals.context, lsp.resourcePaths)
155+
156+
const provider = await activateLspChat(langaugeClient, encryptionKey, uiPath)
157+
provider.uiPath = uiPath
158+
provider.connectorAdapterPath = connectorPath
159+
154160
// const provider = new AmazonQChatViewProvider(uiPath)
155161
// provider.uiPath = uiPath
156162
// provider.connectorAdapterPath = connectorPath
@@ -190,19 +196,18 @@ export class qTestingFramework {
190196
connectorScript.textContent = connectorContent
191197
document.body.appendChild(connectorScript)
192198

193-
// postMessage: (message: string) => {
194-
// const appMessagePublisher = DefaultAmazonQAppInitContext.instance
195-
// .getWebViewToAppsMessagePublishers()
196-
// .get(featureName)
197-
// if (appMessagePublisher === undefined) {
198-
// return
199-
// }
200-
// appMessagePublisher.publish(message)
201-
// },
202-
203199
const vscodeApi = {
204200
postMessage: (message: any) => {
205201
console.log('VSCode postMessage:', message)
202+
const appMessagePublisher = DefaultAmazonQAppInitContext.instance
203+
.getWebViewToAppsMessagePublishers()
204+
.get(featureName)
205+
if (appMessagePublisher === undefined) {
206+
console.log('appMessagePublisher undefined')
207+
return
208+
}
209+
appMessagePublisher.publish(message)
210+
console.log('appMessagePublisher published')
206211
},
207212
getState: () => ({}),
208213
setState: (state: any) => console.log('setState:', state),
@@ -241,13 +246,6 @@ export class qTestingFramework {
241246
//registerMessageListeners(languageClient, provider, encryptionKey)
242247

243248
const framework = new qTestingFramework(featureName, amazonQEnabled, featureConfigsSerialized)
244-
//(framework as any).m = window.qChat;
245-
246-
const langaugeClient = await startLanguageServer(globals.context, lsp.resourcePaths)
247-
248-
const provider = await activateLspChat(langaugeClient, encryptionKey, uiPath)
249-
provider.uiPath = uiPath
250-
provider.connectorAdapterPath = connectorPath
251249

252250
return framework
253251
}

0 commit comments

Comments
 (0)