Skip to content

Commit 520acb0

Browse files
refactor: move Q LSP startup code in to separate function
Signed-off-by: nkomonen-amazon <[email protected]>
1 parent 945c05f commit 520acb0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ export async function startLanguageServer(
177177
await client.onReady()
178178
AuthUtil.create(new auth2.LanguageClientAuth(client, clientId, encryptionKey))
179179

180+
await postStartLanguageServer(client, resourcePaths, toDispose)
181+
182+
return client
183+
}
184+
185+
async function postStartLanguageServer(
186+
client: LanguageClient,
187+
resourcePaths: AmazonQResourcePaths,
188+
toDispose: vscode.Disposable[]
189+
) {
180190
// Request handler for when the server wants to know about the clients auth connnection. Must be registered before the initial auth init call
181191
client.onRequest<ConnectionMetadata, Error>(auth2.notificationTypes.getConnectionMetadata.method, () => {
182192
return {
@@ -347,8 +357,6 @@ export async function startLanguageServer(
347357
// Set this inside onReady so that it only triggers on subsequent language server starts (not the first)
348358
onServerRestartHandler(client)
349359
)
350-
351-
return client
352360
}
353361

354362
/**

0 commit comments

Comments
 (0)