Skip to content

Commit 22729bd

Browse files
committed
Remove unnnessary
1 parent 95fbc10 commit 22729bd

File tree

1 file changed

+0
-96
lines changed
  • src/client/terminals/envCollectionActivation

1 file changed

+0
-96
lines changed

src/client/terminals/envCollectionActivation/service.ts

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -442,102 +442,6 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
442442
envVarCollection.description = description;
443443
}
444444

445-
/**
446-
* Builds the full activation command for the given shell type and script path.
447-
*/
448-
private buildActivateCommand(shellType: TerminalShellType, scriptPath: string): string {
449-
switch (shellType) {
450-
case TerminalShellType.bash:
451-
case TerminalShellType.gitbash:
452-
case TerminalShellType.wsl:
453-
case TerminalShellType.zsh:
454-
case TerminalShellType.fish:
455-
return `source ${scriptPath}`;
456-
case TerminalShellType.powershell:
457-
case TerminalShellType.powershellCore:
458-
return `& ${scriptPath}`;
459-
case TerminalShellType.commandPrompt:
460-
return scriptPath;
461-
default:
462-
return `source ${scriptPath}`;
463-
}
464-
}
465-
466-
/**
467-
* Returns the environment variable name for shell integration activation based on shell type.
468-
* Only supports bash, fish, PowerShell, and Command Prompt.
469-
*/
470-
private getShellActivateEnvVarName(shellType: TerminalShellType): string | undefined {
471-
switch (shellType) {
472-
case TerminalShellType.bash:
473-
case TerminalShellType.gitbash:
474-
case TerminalShellType.wsl:
475-
return 'VSCODE_PYTHON_BASH_ACTIVATE';
476-
case TerminalShellType.zsh:
477-
return 'VSCODE_PYTHON_ZSH_ACTIVATE';
478-
case TerminalShellType.fish:
479-
return 'VSCODE_PYTHON_FISH_ACTIVATE';
480-
case TerminalShellType.powershell:
481-
case TerminalShellType.powershellCore:
482-
return 'VSCODE_PYTHON_PS1_ACTIVATE';
483-
case TerminalShellType.commandPrompt:
484-
return 'VSCODE_PYTHON_CMD_ACTIVATE';
485-
default:
486-
return undefined;
487-
}
488-
}
489-
490-
/**
491-
* Gets the path to the activate script for the given interpreter.
492-
*/
493-
private async getActivateScriptPath(interpreter: PythonEnvironment, shell: string): Promise<string | undefined> {
494-
const shellType = identifyShellFromShellPath(shell);
495-
496-
// For virtual environments, look for activate script in bin directory
497-
if (interpreter.envType === EnvironmentType.Venv || interpreter.type === PythonEnvType.Virtual) {
498-
const binDir = path.dirname(interpreter.path);
499-
const activateScripts = this.getActivateScriptNames(shellType);
500-
501-
if (!activateScripts) {
502-
return undefined;
503-
}
504-
505-
for (const scriptName of activateScripts) {
506-
const scriptPath = path.join(binDir, scriptName);
507-
if (await pathExists(scriptPath)) {
508-
return scriptPath;
509-
}
510-
}
511-
}
512-
513-
// For conda environments, we would need a different approach
514-
// For now, return undefined for unsupported environment types
515-
return undefined;
516-
}
517-
518-
/**
519-
* Returns the activate script names to look for based on shell type.
520-
* Only supports bash, fish, PowerShell, and Command Prompt.
521-
*/
522-
private getActivateScriptNames(shellType: TerminalShellType): string[] | undefined {
523-
switch (shellType) {
524-
case TerminalShellType.bash:
525-
case TerminalShellType.gitbash:
526-
case TerminalShellType.zsh:
527-
case TerminalShellType.wsl:
528-
return ['activate', 'activate.sh'];
529-
case TerminalShellType.fish:
530-
return ['activate.fish'];
531-
case TerminalShellType.powershell:
532-
case TerminalShellType.powershellCore:
533-
return ['Activate.ps1'];
534-
case TerminalShellType.commandPrompt:
535-
return ['activate.bat'];
536-
default:
537-
return undefined;
538-
}
539-
}
540-
541445
private isPromptSet = new Map<number | undefined, boolean>();
542446

543447
// eslint-disable-next-line class-methods-use-this

0 commit comments

Comments
 (0)