mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
address terminal completion provider API feedback (#270249)
commit api feedback
This commit is contained in:
@@ -91,11 +91,11 @@ suite('Terminal Suggest', () => {
|
||||
}
|
||||
test(`'${testSpec.input}' -> ${expectedString}`, async () => {
|
||||
const commandLine = testSpec.input.split('|')[0];
|
||||
const cursorPosition = testSpec.input.indexOf('|');
|
||||
const currentCommandString = getCurrentCommandAndArgs(commandLine, cursorPosition, undefined);
|
||||
const filesRequested = testSpec.expectedResourceRequests?.type === 'files' || testSpec.expectedResourceRequests?.type === 'both';
|
||||
const foldersRequested = testSpec.expectedResourceRequests?.type === 'folders' || testSpec.expectedResourceRequests?.type === 'both';
|
||||
const terminalContext = { commandLine, cursorPosition, allowFallbackCompletions: true };
|
||||
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 terminalContext = { commandLine, cursorIndex, allowFallbackCompletions: true };
|
||||
const result = await getCompletionItemsFromSpecs(
|
||||
completionSpecs,
|
||||
terminalContext,
|
||||
@@ -118,8 +118,8 @@ suite('Terminal Suggest', () => {
|
||||
}).sort(),
|
||||
(testSpec.expectedCompletions ?? []).sort()
|
||||
);
|
||||
strictEqual(result.filesRequested, filesRequested, 'Files requested different than expected, got: ' + result.filesRequested);
|
||||
strictEqual(result.foldersRequested, foldersRequested, 'Folders requested different than expected, got: ' + result.foldersRequested);
|
||||
strictEqual(result.showFiles, showFiles, 'Show files different than expected, got: ' + result.showFiles);
|
||||
strictEqual(result.showFolders, showFolders, 'Show folders different than expected, got: ' + result.showFolders);
|
||||
if (testSpec.expectedResourceRequests?.cwd) {
|
||||
strictEqual(result.cwd?.fsPath, testSpec.expectedResourceRequests.cwd.fsPath, 'Non matching cwd');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user