Skip to content

Commit 031b03f

Browse files
committed
remove cancellation token usage for crossfile code path
1 parent ece1cad commit 031b03f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/core/src/codewhisperer/util/supplementalContext/crossFileContextUtil.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ interface Chunk {
6565
type SupplementalContextConfig = 'none' | 'opentabs' | 'codemap' | 'bm25' | 'default'
6666

6767
export async function fetchSupplementalContextForSrc(
68-
editor: vscode.TextEditor,
69-
cancellationToken: vscode.CancellationToken
68+
editor: vscode.TextEditor
7069
): Promise<Pick<CodeWhispererSupplementalContext, 'supplementalContextItems' | 'strategy'> | undefined> {
7170
const supplementalContextConfig = getSupplementalContextConfig(editor.document.languageId)
7271

@@ -78,7 +77,7 @@ export async function fetchSupplementalContextForSrc(
7877
// fallback to opentabs if projectContext timeout
7978
const opentabsContextPromise = waitUntil(
8079
async function () {
81-
return await fetchOpentabsContext(editor, cancellationToken)
80+
return await fetchOpentabsContext(editor)
8281
},
8382
{ timeout: supplementalContextTimeoutInMs, interval: 5, truthy: false }
8483
)
@@ -100,7 +99,7 @@ export async function fetchSupplementalContextForSrc(
10099
const opentabsContextAndCodemap = await waitUntil(
101100
async function () {
102101
const result: CodeWhispererSupplementalContextItem[] = []
103-
const opentabsContext = await fetchOpentabsContext(editor, cancellationToken)
102+
const opentabsContext = await fetchOpentabsContext(editor)
104103
const codemap = await fetchProjectContext(editor, 'codemap')
105104

106105
function addToResult(items: CodeWhispererSupplementalContextItem[]) {
@@ -207,8 +206,7 @@ export async function fetchProjectContext(
207206
}
208207

209208
export async function fetchOpentabsContext(
210-
editor: vscode.TextEditor,
211-
cancellationToken: vscode.CancellationToken
209+
editor: vscode.TextEditor
212210
): Promise<CodeWhispererSupplementalContextItem[] | undefined> {
213211
const codeChunksCalculated = crossFileContextConfig.numberOfChunkToFetch
214212

packages/core/src/codewhisperer/util/supplementalContext/supplementalContextUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function fetchSupplementalContext(
3030
if (isUtg) {
3131
supplementalContextPromise = fetchSupplementalContextForTest(editor, cancellationToken)
3232
} else {
33-
supplementalContextPromise = fetchSupplementalContextForSrc(editor, cancellationToken)
33+
supplementalContextPromise = fetchSupplementalContextForSrc(editor)
3434
}
3535

3636
return supplementalContextPromise

0 commit comments

Comments
 (0)