@@ -33,7 +33,7 @@ import {
3333} from './plus/webviews/graph/registration' ;
3434import { GraphStatusBarController } from './plus/webviews/graph/statusbar' ;
3535import { registerTimelineWebviewPanel , registerTimelineWebviewView } from './plus/webviews/timeline/registration' ;
36- import { WorkspacesService } from './plus/workspaces/workspacesService' ;
36+ import { scheduleAddMissingCurrentWorkspaceRepos , WorkspacesService } from './plus/workspaces/workspacesService' ;
3737import { StatusBarController } from './statusbar/statusBarController' ;
3838import { executeCommand } from './system/command' ;
3939import { configuration } from './system/configuration' ;
@@ -166,6 +166,7 @@ export class Container {
166166 } ,
167167 } ;
168168
169+ private readonly _connection : ServerConnection ;
169170 private _disposables : Disposable [ ] ;
170171 private _terminalLinks : GitTerminalLinkProvider | undefined ;
171172 private _webviews : WebviewsController ;
@@ -191,16 +192,15 @@ export class Container {
191192
192193 this . _richRemoteProviders = new RichRemoteProviderService ( this ) ;
193194
194- const connection = new ServerConnection ( this ) ;
195- this . _disposables . push ( connection ) ;
195+ this . _disposables . push ( ( this . _connection = new ServerConnection ( this ) ) ) ;
196196
197- this . _disposables . push ( ( this . _accountAuthentication = new AccountAuthenticationProvider ( this , connection ) ) ) ;
198- this . _disposables . push ( ( this . _subscription = new SubscriptionService ( this , connection , previousVersion ) ) ) ;
199- this . _disposables . push ( ( this . _workspaces = new WorkspacesService ( this , connection ) ) ) ;
197+ this . _disposables . push (
198+ ( this . _accountAuthentication = new AccountAuthenticationProvider ( this , this . _connection ) ) ,
199+ ) ;
200+ this . _disposables . push ( ( this . _subscription = new SubscriptionService ( this , this . _connection , previousVersion ) ) ) ;
200201
201202 this . _disposables . push ( ( this . _git = new GitProviderService ( this ) ) ) ;
202203 this . _disposables . push ( new GitFileSystemProvider ( this ) ) ;
203- this . _disposables . push ( ( this . _repositoryPathMapping = getSupportedRepositoryPathMappingProvider ( this ) ) ) ;
204204
205205 this . _disposables . push ( ( this . _uri = new UriService ( this ) ) ) ;
206206
@@ -212,7 +212,6 @@ export class Container {
212212 this . _disposables . push ( ( this . _keyboard = new Keyboard ( ) ) ) ;
213213 this . _disposables . push ( ( this . _vsls = new VslsController ( this ) ) ) ;
214214 this . _disposables . push ( ( this . _eventBus = new EventBus ( ) ) ) ;
215- this . _disposables . push ( ( this . _ai = new AIProviderService ( this ) ) ) ;
216215
217216 this . _disposables . push ( ( this . _fileAnnotationController = new FileAnnotationController ( this ) ) ) ;
218217 this . _disposables . push ( ( this . _lineAnnotationController = new LineAnnotationController ( this ) ) ) ;
@@ -274,6 +273,8 @@ export class Container {
274273 context . subscriptions . push ( {
275274 dispose : ( ) => this . _disposables . reverse ( ) . forEach ( d => void d . dispose ( ) ) ,
276275 } ) ;
276+
277+ scheduleAddMissingCurrentWorkspaceRepos ( this ) ;
277278 }
278279
279280 deactivate ( ) {
@@ -334,8 +335,11 @@ export class Container {
334335 return this . _actionRunners ;
335336 }
336337
337- private readonly _ai : AIProviderService ;
338+ private _ai : AIProviderService | undefined ;
338339 get ai ( ) {
340+ if ( this . _ai == null ) {
341+ this . _disposables . push ( ( this . _ai = new AIProviderService ( this ) ) ) ;
342+ }
339343 return this . _ai ;
340344 }
341345
@@ -529,8 +533,11 @@ export class Container {
529533 return this . _lineTracker ;
530534 }
531535
532- private readonly _repositoryPathMapping : RepositoryPathMappingProvider ;
536+ private _repositoryPathMapping : RepositoryPathMappingProvider | undefined ;
533537 get repositoryPathMapping ( ) {
538+ if ( this . _repositoryPathMapping == null ) {
539+ this . _disposables . push ( ( this . _repositoryPathMapping = getSupportedRepositoryPathMappingProvider ( this ) ) ) ;
540+ }
534541 return this . _repositoryPathMapping ;
535542 }
536543
@@ -632,8 +639,11 @@ export class Container {
632639 return this . _vsls ;
633640 }
634641
635- private _workspaces : WorkspacesService ;
642+ private _workspaces : WorkspacesService | undefined ;
636643 get workspaces ( ) {
644+ if ( this . _workspaces == null ) {
645+ this . _disposables . push ( ( this . _workspaces = new WorkspacesService ( this , this . _connection ) ) ) ;
646+ }
637647 return this . _workspaces ;
638648 }
639649
0 commit comments