Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,22 @@ export class Messenger {
)
)
}

/**
* 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.
* - 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.
*/
public async countTotalNumberOfCodeBlocks(message: string): Promise<number> {
//TODO: remove this when moved to server-side.
if (message === undefined) {
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)
Expand Down
Loading