From 278584dc08ca60ecf17e62bf9beb19d3eeeef4b7 Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 3 Oct 2024 15:24:27 -0400 Subject: [PATCH 1/3] add comment --- .../controllers/chat/messenger/messenger.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts b/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts index 6bad96cd2fa..b6c65047aed 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts @@ -91,8 +91,14 @@ export class Messenger { ) ) } - + /** + * Guesses the total number of code blocks. + * NOTE: Not correct on all examples. Some may cause it to return 0 unexpectedly. + * @param message raw message response from codewhisperer client. + * @returns count of multi-line code blocks in response. + */ public async countTotalNumberOfCodeBlocks(message: string): Promise { + //TODO: remove this when moved to server-side. if (message === undefined) { return 0 } From 97861329e39677766174a5da7fec8f3858121fd3 Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 3 Oct 2024 15:26:53 -0400 Subject: [PATCH 2/3] update comment with PR link --- .../controllers/chat/messenger/messenger.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts b/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts index b6c65047aed..0a93fe6222b 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts @@ -93,7 +93,10 @@ export class Messenger { } /** * Guesses the total number of code blocks. - * NOTE: Not correct on all examples. Some may cause it to return 0 unexpectedly. + * NOTES: + * - Not correct on all examples. Some may cause it to return 0 unexpectedly. + * - Plans in place (as of 4/22/2024) to move this server side. + * - See original pr: https://github.com/aws/aws-toolkit-vscode/pull/4761 for more details. * @param message raw message response from codewhisperer client. * @returns count of multi-line code blocks in response. */ @@ -103,7 +106,7 @@ export class Messenger { return 0 } - // // To Convert Markdown text to HTML using marked library + // To Convert Markdown text to HTML using marked library const html = await marked(message) const dom = new JSDOM(html) From 4d2b2f0eae9cd55f1e18ed9159d80d8be2e1522a Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 3 Oct 2024 15:28:42 -0400 Subject: [PATCH 3/3] change language --- .../codewhispererChat/controllers/chat/messenger/messenger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts b/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts index 0a93fe6222b..1cee652df57 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts @@ -92,7 +92,7 @@ export class Messenger { ) } /** - * Guesses the total number of code blocks. + * Tries to calculate the total number of code blocks. * NOTES: * - Not correct on all examples. Some may cause it to return 0 unexpectedly. * - Plans in place (as of 4/22/2024) to move this server side.