Get terminal-suggest completions working on Windows

- The shell was checked without removing the extension.
- The creationOptions hack to pull the shell type was also not working.
- Added the (terminal-suggest) note to resource completions as well.

Fixes #235272
This commit is contained in:
Daniel Imms
2024-12-04 06:45:38 -08:00
parent e305e5b88b
commit e09971e1ed
2 changed files with 16 additions and 11 deletions
@@ -18,7 +18,7 @@ export const availableSpecs = [codeCompletionSpec, codeInsidersCompletionSpec, c
function getBuiltinCommands(shell: string): string[] | undefined {
try {
const shellType = path.basename(shell);
const shellType = path.basename(shell, path.extname(shell));
const cachedCommands = cachedBuiltinCommands?.get(shellType);
if (cachedCommands) {
return cachedCommands;
@@ -76,7 +76,7 @@ export async function activate(context: vscode.ExtensionContext) {
}
// TODO: Leverage shellType when available https://github.com/microsoft/vscode/issues/230165
const shellPath = 'shellPath' in terminal.creationOptions ? terminal.creationOptions.shellPath : vscode.env.shell;
const shellPath = ('shellPath' in terminal.creationOptions ? terminal.creationOptions.shellPath : undefined) ?? vscode.env.shell;
if (!shellPath) {
return;
}