11import { commands , ExtensionContext , LogOutputChannel , Terminal , Uri } from 'vscode' ;
22
3- import { PythonEnvironmentManagers } from './features/envManagers' ;
3+ import { PythonEnvironment , PythonEnvironmentApi } from './api' ;
4+ import { ensureCorrectVersion } from './common/extVersion' ;
5+ import { registerTools } from './common/lm.apis' ;
46import { registerLogger , traceInfo } from './common/logging' ;
5- import { EnvManagerView } from './features/views/envManagersView' ;
7+ import { setPersistentState } from './common/persistentState' ;
8+ import { StopWatch } from './common/stopWatch' ;
9+ import { EventNames } from './common/telemetry/constants' ;
10+ import { sendTelemetryEvent } from './common/telemetry/sender' ;
11+ import {
12+ activeTerminal ,
13+ createLogOutputChannel ,
14+ onDidChangeActiveTerminal ,
15+ onDidChangeActiveTextEditor ,
16+ onDidChangeTerminalShellIntegration ,
17+ } from './common/window.apis' ;
18+ import { GetEnvironmentInfoTool , InstallPackageTool } from './features/copilotTools' ;
19+ import { AutoFindProjects } from './features/creators/autoFindProjects' ;
20+ import { ExistingProjects } from './features/creators/existingProjects' ;
21+ import { ProjectCreatorsImpl } from './features/creators/projectCreators' ;
622import {
723 addPythonProject ,
24+ copyPathToClipboard ,
25+ createAnyEnvironmentCommand ,
826 createEnvironmentCommand ,
927 createTerminalCommand ,
1028 getPackageCommandOptions ,
29+ handlePackageUninstall ,
1130 refreshManagerCommand ,
31+ refreshPackagesCommand ,
1232 removeEnvironmentCommand ,
1333 removePythonProject ,
34+ resetEnvironmentCommand ,
1435 runAsTaskCommand ,
36+ runInDedicatedTerminalCommand ,
1537 runInTerminalCommand ,
16- setEnvManagerCommand ,
1738 setEnvironmentCommand ,
39+ setEnvManagerCommand ,
1840 setPackageManagerCommand ,
19- resetEnvironmentCommand ,
20- refreshPackagesCommand ,
21- createAnyEnvironmentCommand ,
22- runInDedicatedTerminalCommand ,
23- handlePackageUninstall ,
24- copyPathToClipboard ,
2541} from './features/envCommands' ;
26- import { registerCondaFeatures } from './managers/conda/main ' ;
27- import { registerSystemPythonFeatures } from './managers/builtin/main ' ;
42+ import { PythonEnvironmentManagers } from './features/envManagers ' ;
43+ import { EnvVarManager , PythonEnvVariableManager } from './features/execution/envVariableManager ' ;
2844import { PythonProjectManagerImpl } from './features/projectManager' ;
29- import { EnvironmentManagers , ProjectCreators , PythonProjectManager } from './internal.api' ;
3045import { getPythonApi , setPythonApi } from './features/pythonApi' ;
31- import { setPersistentState } from './common/persistentState' ;
32- import { createNativePythonFinder , NativePythonFinder } from './managers/common/nativePythonFinder' ;
33- import { PythonEnvironment , PythonEnvironmentApi } from './api' ;
34- import { ProjectCreatorsImpl } from './features/creators/projectCreators' ;
35- import { ProjectView } from './features/views/projectView' ;
3646import { registerCompletionProvider } from './features/settings/settingCompletions' ;
37- import { TerminalManager , TerminalManagerImpl } from './features/terminal/terminalManager' ;
38- import {
39- activeTerminal ,
40- createLogOutputChannel ,
41- onDidChangeActiveTerminal ,
42- onDidChangeActiveTextEditor ,
43- onDidChangeTerminalShellIntegration ,
44- } from './common/window.apis' ;
4547import { setActivateMenuButtonContext } from './features/terminal/activateMenuButton' ;
48+ import { ShellStartupActivationManagerImpl } from './features/terminal/shells/activateUsingShellStartup' ;
49+ import { normalizeShellPath } from './features/terminal/shells/common/shellUtils' ;
50+ import { createShellEnvProviders , createShellStartupProviders } from './features/terminal/shells/providers' ;
51+ import { TerminalActivationImpl } from './features/terminal/terminalActivationState' ;
52+ import { TerminalManager , TerminalManagerImpl } from './features/terminal/terminalManager' ;
53+ import { getEnvironmentForTerminal } from './features/terminal/utils' ;
54+ import { EnvManagerView } from './features/views/envManagersView' ;
55+ import { ProjectView } from './features/views/projectView' ;
4656import { PythonStatusBarImpl } from './features/views/pythonStatusBar' ;
4757import { updateViewsAndStatus } from './features/views/revealHandler' ;
48- import { EnvVarManager , PythonEnvVariableManager } from './features/execution/envVariableManager' ;
49- import { StopWatch } from './common/stopWatch' ;
50- import { sendTelemetryEvent } from './common/telemetry/sender' ;
51- import { EventNames } from './common/telemetry/constants' ;
52- import { ensureCorrectVersion } from './common/extVersion' ;
53- import { ExistingProjects } from './features/creators/existingProjects' ;
54- import { AutoFindProjects } from './features/creators/autoFindProjects' ;
55- import { registerTools } from './common/lm.apis' ;
56- import { GetEnvironmentInfoTool , InstallPackageTool } from './features/copilotTools' ;
57- import { TerminalActivationImpl } from './features/terminal/terminalActivationState' ;
58- import { getEnvironmentForTerminal , normalizeShellPath } from './features/terminal/utils' ;
59- import { PwshStartupProvider } from './features/terminal/shells/pwsh/pwshStartup' ;
60- import { ShellStartupActivationManagerImpl } from './features/terminal/shells/activateUsingShellStartup' ;
61- import {
62- BashStartupProvider ,
63- GitBashStartupProvider ,
64- ZshStartupProvider ,
65- } from './features/terminal/shells/bash/bashStartup' ;
66- import { FishStartupProvider } from './features/terminal/shells/fishStartup' ;
67- import { isWindows } from './common/utils/platformUtils' ;
68- import { CmdStartupProvider } from './features/terminal/shells/cmdStartup' ;
58+ import { EnvironmentManagers , ProjectCreators , PythonProjectManager } from './internal.api' ;
59+ import { registerSystemPythonFeatures } from './managers/builtin/main' ;
60+ import { createNativePythonFinder , NativePythonFinder } from './managers/common/nativePythonFinder' ;
61+ import { registerCondaFeatures } from './managers/conda/main' ;
6962
7063export async function activate ( context : ExtensionContext ) : Promise < PythonEnvironmentApi > {
7164 const start = new StopWatch ( ) ;
@@ -92,15 +85,14 @@ export async function activate(context: ExtensionContext): Promise<PythonEnviron
9285 context . subscriptions . push ( envManagers ) ;
9386
9487 const terminalActivation = new TerminalActivationImpl ( ) ;
95- const shellStartupProviders = isWindows ( )
96- ? [ new PwshStartupProvider ( ) , new GitBashStartupProvider ( ) , new CmdStartupProvider ( ) ]
97- : [ new PwshStartupProvider ( ) , new BashStartupProvider ( ) , new ZshStartupProvider ( ) , new FishStartupProvider ( ) ] ;
88+ const shellEnvsProviders = createShellEnvProviders ( ) ;
89+ const shellStartupProviders = createShellStartupProviders ( ) ;
9890 const shellStartupActivationManager = new ShellStartupActivationManagerImpl (
9991 context . environmentVariableCollection ,
10092 shellStartupProviders ,
10193 envManagers ,
10294 ) ;
103- const terminalManager : TerminalManager = new TerminalManagerImpl ( terminalActivation , shellStartupProviders ) ;
95+ const terminalManager : TerminalManager = new TerminalManagerImpl ( terminalActivation , shellEnvsProviders ) ;
10496 context . subscriptions . push ( terminalActivation , terminalManager , shellStartupActivationManager ) ;
10597
10698 const projectCreators : ProjectCreators = new ProjectCreatorsImpl ( ) ;
0 commit comments