Skip to content

Commit 994380e

Browse files
brdskggsjustinmk3
andcommitted
Apply suggestions from code review
Renaming `extractCellsSliceContext` to `getNotebookCellsSliceContext` Co-authored-by: Justin M. Keyes <[email protected]>
1 parent f156e17 commit 994380e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/amazonq/test/unit/codewhisperer/util/editorContext.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('editorContext', function () {
8686
assert.deepStrictEqual(actual, expected)
8787
})
8888

89-
it('Should include context from other cells when in a notebook', async function () {
89+
it('in a notebook, includes context from other cells', async function () {
9090
const cells: vscode.NotebookCellData[] = [
9191
new vscode.NotebookCellData(vscode.NotebookCellKind.Markup, 'Previous cell', 'python'),
9292
new vscode.NotebookCellData(
@@ -175,7 +175,7 @@ describe('editorContext', function () {
175175
})
176176
})
177177

178-
describe('extractSingleCellContext', function () {
178+
describe('getNotebookCellContext', function () {
179179
it('Should return cell text for python code cells when language is python', function () {
180180
const mockCodeCell = createNotebookCell(createMockDocument('def example():\n return "test"'))
181181
const result = EditorContext.extractSingleCellContext(mockCodeCell, 'python')

packages/core/src/codewhisperer/util/editorContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const languageCommentChars: Record<string, string> = {
2929
java: '// ',
3030
}
3131

32-
export function extractSingleCellContext(cell: vscode.NotebookCell, referenceLanguage?: string): string {
32+
export function getNotebookCellContext(cell: vscode.NotebookCell, referenceLanguage?: string): string {
3333
// Extract the text verbatim if the cell is code and the cell has the same language.
3434
// Otherwise, add the correct comment string for the refeference language
3535
const cellText = cell.document.getText()
@@ -51,7 +51,7 @@ export function extractSingleCellContext(cell: vscode.NotebookCell, referenceLan
5151
return cellText
5252
}
5353

54-
export function extractCellsSliceContext(
54+
export function getNotebookCellsSliceContext(
5555
cells: vscode.NotebookCell[],
5656
maxLength: number,
5757
referenceLanguage: string,

0 commit comments

Comments
 (0)