From 43d3ca240a0054842b86657549a093ffe9c26ed8 Mon Sep 17 00:00:00 2001 From: Avi Alpert Date: Tue, 8 Apr 2025 12:58:05 -0400 Subject: [PATCH] feat(amazonq): Add @Code context for PHP, Ruby, Scala, Shell, and Swift projects --- .../Feature-846afd38-d618-4bd1-a3aa-7c74597502f1.json | 4 ++++ packages/core/src/amazonq/lsp/config.ts | 2 +- packages/core/src/amazonq/lsp/lspClient.ts | 2 +- .../src/codewhispererChat/controllers/chat/controller.ts | 8 +------- 4 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 packages/amazonq/.changes/next-release/Feature-846afd38-d618-4bd1-a3aa-7c74597502f1.json diff --git a/packages/amazonq/.changes/next-release/Feature-846afd38-d618-4bd1-a3aa-7c74597502f1.json b/packages/amazonq/.changes/next-release/Feature-846afd38-d618-4bd1-a3aa-7c74597502f1.json new file mode 100644 index 00000000000..d1ca1554322 --- /dev/null +++ b/packages/amazonq/.changes/next-release/Feature-846afd38-d618-4bd1-a3aa-7c74597502f1.json @@ -0,0 +1,4 @@ +{ + "type": "Feature", + "description": "Amazon Q Chat: Add @Code context for PHP, Ruby, Scala, Shell, and Swift projects" +} diff --git a/packages/core/src/amazonq/lsp/config.ts b/packages/core/src/amazonq/lsp/config.ts index 613a60dc729..5670d0d0ce4 100644 --- a/packages/core/src/amazonq/lsp/config.ts +++ b/packages/core/src/amazonq/lsp/config.ts @@ -16,7 +16,7 @@ export interface LspConfig { export const defaultAmazonQWorkspaceLspConfig: LspConfig = { manifestUrl: 'https://aws-toolkit-language-servers.amazonaws.com/q-context/manifest.json', - supportedVersions: '0.1.46', + supportedVersions: '0.1.47', id: 'AmazonQ-Workspace', // used across IDEs for identifying global storage/local disk locations. Do not change. suppressPromptPrefix: 'amazonQWorkspace', path: undefined, diff --git a/packages/core/src/amazonq/lsp/lspClient.ts b/packages/core/src/amazonq/lsp/lspClient.ts index 6b62208fe38..f2bfaca8d8a 100644 --- a/packages/core/src/amazonq/lsp/lspClient.ts +++ b/packages/core/src/amazonq/lsp/lspClient.ts @@ -188,7 +188,7 @@ export class LspClient { GetContextCommandPromptRequestType, await this.encrypt(request) ) - return resp + return resp || [] } catch (e) { getLogger().error(`LspClient: getContextCommandPrompt error: ${e}`) throw e diff --git a/packages/core/src/codewhispererChat/controllers/chat/controller.ts b/packages/core/src/codewhispererChat/controllers/chat/controller.ts index b9c7bac8ada..00ad913d3a4 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/controller.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/controller.ts @@ -577,13 +577,7 @@ export class ChatController { id: contextCommandItem.id, icon: 'folder' as MynahIconsType, }) - } - // TODO: Remove the limit of 25k once the performance issue of mynahUI in webview is fixed. - else if ( - contextCommandItem.symbol && - symbolsCmd.children && - symbolsCmd.children[0].commands.length < 25_000 - ) { + } else if (contextCommandItem.symbol && symbolsCmd.children) { symbolsCmd.children?.[0].commands.push({ command: contextCommandItem.symbol.name, description: `${contextCommandItem.symbol.kind}, ${path.join(wsFolderName, contextCommandItem.relativePath)}, L${contextCommandItem.symbol.range.start.line}-${contextCommandItem.symbol.range.end.line}`,