Skip to content

Commit 3083846

Browse files
committed
patch
1 parent 1b9bf64 commit 3083846

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import { fs } from '../../../shared'
88
import path = require('path')
99
import { BM25Document, BM25Okapi } from './rankBm25'
1010
import { ToolkitError } from '../../../shared/errors'
11-
import { UserGroup, crossFileContextConfig, supplemetalContextFetchingTimeoutMsg } from '../../models/constants'
11+
import { crossFileContextConfig, supplemetalContextFetchingTimeoutMsg } from '../../models/constants'
1212
import { CancellationError } from '../../../shared/utilities/timeoutUtils'
13-
import { CodeWhispererUserGroupSettings } from '../userGroupUtil'
1413
import { isTestFile } from './codeParsingUtil'
1514
import { getFileDistance } from '../../../shared/filesystemUtilities'
1615
import { getOpenFilesInWindow } from '../../../shared/utilities/editorUtilities'
@@ -52,10 +51,7 @@ export async function fetchSupplementalContextForSrc(
5251
editor: vscode.TextEditor,
5352
cancellationToken: vscode.CancellationToken
5453
): Promise<Pick<CodeWhispererSupplementalContext, 'supplementalContextItems' | 'strategy'> | undefined> {
55-
const shouldProceed = shouldFetchCrossFileContext(
56-
editor.document.languageId,
57-
CodeWhispererUserGroupSettings.instance.userGroup
58-
)
54+
const shouldProceed = shouldFetchCrossFileContext(editor.document.languageId)
5955

6056
if (!shouldProceed) {
6157
return shouldProceed === undefined
@@ -155,10 +151,7 @@ function getInputChunk(editor: vscode.TextEditor, chunkSize: number) {
155151
* @returns specifically returning undefined if the langueage is not supported,
156152
* otherwise true/false depending on if the language is fully supported or not belonging to the user group
157153
*/
158-
function shouldFetchCrossFileContext(
159-
languageId: vscode.TextDocument['languageId'],
160-
userGroup: UserGroup
161-
): boolean | undefined {
154+
function shouldFetchCrossFileContext(languageId: vscode.TextDocument['languageId']): boolean | undefined {
162155
if (!isCrossFileSupported(languageId)) {
163156
return undefined
164157
}

0 commit comments

Comments
 (0)