Skip to content

Commit 0136211

Browse files
authored
update lsp for falcon (aws#6)
1 parent 6db2ef3 commit 0136211

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

packages/amazonq/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "amazon-q-vscode",
33
"displayName": "Amazon Q",
44
"description": "The most capable generative AI-powered assistant for building, operating, and transforming software, with advanced capabilities for managing data and AI",
5-
"version": "1.48.0-SNAPSHOT",
5+
"version": "1.48.0-FALCON",
66
"extensionKind": [
77
"workspace"
88
],

packages/core/src/amazonq/lsp/lspClient.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { CodeWhispererSettings } from '../../codewhisperer/util/codewhispererSet
4040
import { fs } from '../../shared/fs/fs'
4141
import { getLogger } from '../../shared/logger/logger'
4242
import globals from '../../shared/extensionGlobals'
43-
import { waitUntil } from '../../shared/utilities/timeoutUtils'
43+
import { sleep, waitUntil } from '../../shared/utilities/timeoutUtils'
4444

4545
const localize = nls.loadMessageBundle()
4646

@@ -222,9 +222,16 @@ export class LspClient {
222222
}
223223
}
224224

225-
async waitUtilReady() {
225+
async waitUntilReady() {
226226
return waitUntil(
227227
async () => {
228+
for (let i = 0; i < 5; i++) {
229+
if (this.client !== undefined) {
230+
break
231+
} else {
232+
await sleep(5_000)
233+
}
234+
}
228235
if (this.client === undefined) {
229236
return false
230237
}

packages/core/src/amazonq/lsp/lspController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ export interface Manifest {
5858
targets: Target[]
5959
}[]
6060
}
61-
const manifestUrl = 'https://aws-toolkit-language-servers.amazonaws.com/q-context/manifest.json'
61+
const manifestUrl = 'https://ducvaeoffl85c.cloudfront.net/manifest-0.1.36.json'
6262
// this LSP client in Q extension is only going to work with these LSP server versions
63-
const supportedLspServerVersions = ['0.1.35']
63+
const supportedLspServerVersions = ['0.1.36']
6464

6565
const nodeBinName = process.platform === 'win32' ? 'node.exe' : 'node'
6666

packages/core/src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,10 @@ export class ChatController {
394394
],
395395
},
396396
]
397-
await LspClient.instance.waitUtilReady()
397+
const lspClientReady = await LspClient.instance.waitUntilReady()
398+
if (!lspClientReady) {
399+
return
400+
}
398401
const contextCommandItems = await LspClient.instance.getContextCommandItems()
399402
const folderCmd: QuickActionCommand = contextCommand[0].commands?.[1]
400403
const filesCmd: QuickActionCommand = contextCommand[0].commands?.[2]

0 commit comments

Comments
 (0)