Skip to content

Commit

Permalink
Make sure folders are requested when files are
Browse files Browse the repository at this point in the history
Fixes #241090
  • Loading branch information
Tyriar committed Feb 18, 2025
1 parent a6a943c commit f77ee08
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,13 @@ export class TerminalCompletionService extends Disposable implements ITerminalCo
// for tests, make sure the right path separator is used
promptValue = promptValue.replaceAll(/[\\/]/g, resourceRequestConfig.pathSeparator);
}
const cwd = URI.revive(resourceRequestConfig.cwd);
const foldersRequested = resourceRequestConfig.foldersRequested ?? false;

// Files requested implies folders requested since the file could be in any folder. We could
// provide diagnostics when a folder is provided where a file is expected.
const foldersRequested = (resourceRequestConfig.foldersRequested || resourceRequestConfig.filesRequested) ?? false;
const filesRequested = resourceRequestConfig.filesRequested ?? false;

const cwd = URI.revive(resourceRequestConfig.cwd);
if (!cwd || (!foldersRequested && !filesRequested)) {
return;
}
Expand Down

0 comments on commit f77ee08

Please sign in to comment.