Fix terminal completion items not appearing when resourceOptions provided (#284148)

This commit is contained in:
Copilot
2025-12-18 09:58:31 -06:00
committed by GitHub
parent 385329863f
commit 96cc23e2e2
6 changed files with 28 additions and 28 deletions

View File

@@ -94,7 +94,7 @@ suite('Terminal Suggest', () => {
const cursorIndex = testSpec.input.indexOf('|');
const currentCommandString = getCurrentCommandAndArgs(commandLine, cursorIndex, undefined);
const showFiles = testSpec.expectedResourceRequests?.type === 'files' || testSpec.expectedResourceRequests?.type === 'both';
const showFolders = testSpec.expectedResourceRequests?.type === 'folders' || testSpec.expectedResourceRequests?.type === 'both';
const showDirectories = testSpec.expectedResourceRequests?.type === 'folders' || testSpec.expectedResourceRequests?.type === 'both';
const terminalContext = { commandLine, cursorIndex };
const result = await getCompletionItemsFromSpecs(
completionSpecs,
@@ -119,7 +119,7 @@ suite('Terminal Suggest', () => {
(testSpec.expectedCompletions ?? []).sort()
);
strictEqual(result.showFiles, showFiles, 'Show files different than expected, got: ' + result.showFiles);
strictEqual(result.showFolders, showFolders, 'Show folders different than expected, got: ' + result.showFolders);
strictEqual(result.showDirectories, showDirectories, 'Show directories different than expected, got: ' + result.showDirectories);
if (testSpec.expectedResourceRequests?.cwd) {
strictEqual(result.cwd?.fsPath, testSpec.expectedResourceRequests.cwd.fsPath, 'Non matching cwd');
}