Skip to content

Commit 0f4c914

Browse files
committed
Adds explicit return types
1 parent 7078075 commit 0f4c914

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

src/container.ts

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class Container {
8686
prerelease: boolean,
8787
version: string,
8888
previousVersion: string | undefined,
89-
) {
89+
): Container {
9090
if (Container.#instance != null) throw new Error('Container is already initialized');
9191

9292
Container.#instance = new Container(context, storage, prerelease, version, previousVersion);
@@ -276,18 +276,18 @@ export class Container {
276276
scheduleAddMissingCurrentWorkspaceRepos(this);
277277
}
278278

279-
deactivate() {
279+
deactivate(): void {
280280
this._deactivating = true;
281281
}
282282

283283
private _deactivating: boolean = false;
284-
get deactivating() {
284+
get deactivating(): boolean {
285285
return this._deactivating;
286286
}
287287

288288
private _ready: boolean = false;
289289

290-
async ready() {
290+
async ready(): Promise<void> {
291291
if (this._ready) throw new Error('Container is already ready');
292292

293293
this._ready = true;
@@ -296,7 +296,7 @@ export class Container {
296296
}
297297

298298
@log()
299-
private async registerGitProviders() {
299+
private async registerGitProviders(): Promise<void> {
300300
const providers = await getSupportedGitProviders(this);
301301
for (const provider of providers) {
302302
this._disposables.push(this._git.register(provider.descriptor.id, provider));
@@ -325,17 +325,17 @@ export class Container {
325325
}
326326

327327
private _accountAuthentication: AccountAuthenticationProvider;
328-
get accountAuthentication() {
328+
get accountAuthentication(): AccountAuthenticationProvider {
329329
return this._accountAuthentication;
330330
}
331331

332332
private readonly _actionRunners: ActionRunners;
333-
get actionRunners() {
333+
get actionRunners(): ActionRunners {
334334
return this._actionRunners;
335335
}
336336

337337
private _ai: Promise<AIProviderService | undefined> | undefined;
338-
get ai() {
338+
get ai(): Promise<AIProviderService | undefined> {
339339
if (this._ai == null) {
340340
async function load(this: Container) {
341341
try {
@@ -356,7 +356,7 @@ export class Container {
356356
}
357357

358358
private _autolinks: Autolinks | undefined;
359-
get autolinks() {
359+
get autolinks(): Autolinks {
360360
if (this._autolinks == null) {
361361
this._disposables.push((this._autolinks = new Autolinks(this)));
362362
}
@@ -365,7 +365,7 @@ export class Container {
365365
}
366366

367367
private _cache: CacheProvider | undefined;
368-
get cache() {
368+
get cache(): CacheProvider {
369369
if (this._cache == null) {
370370
this._disposables.push((this._cache = new CacheProvider(this)));
371371
}
@@ -374,7 +374,7 @@ export class Container {
374374
}
375375

376376
private _cloudIntegrations: Promise<CloudIntegrationService | undefined> | undefined;
377-
get cloudIntegrations() {
377+
get cloudIntegrations(): Promise<CloudIntegrationService | undefined> {
378378
if (this._cloudIntegrations == null) {
379379
async function load(this: Container) {
380380
try {
@@ -397,48 +397,48 @@ export class Container {
397397
}
398398

399399
private _drafts: DraftService | undefined;
400-
get drafts() {
400+
get drafts(): DraftService {
401401
if (this._drafts == null) {
402402
this._disposables.push((this._drafts = new DraftService(this, this._connection)));
403403
}
404404
return this._drafts;
405405
}
406406

407407
private _repositoryIdentity: RepositoryIdentityService | undefined;
408-
get repositoryIdentity() {
408+
get repositoryIdentity(): RepositoryIdentityService {
409409
if (this._repositoryIdentity == null) {
410410
this._disposables.push((this._repositoryIdentity = new RepositoryIdentityService(this, this._connection)));
411411
}
412412
return this._repositoryIdentity;
413413
}
414414

415415
private readonly _codeLensController: GitCodeLensController;
416-
get codeLens() {
416+
get codeLens(): GitCodeLensController {
417417
return this._codeLensController;
418418
}
419419

420420
private readonly _context: ExtensionContext;
421-
get context() {
421+
get context(): ExtensionContext {
422422
return this._context;
423423
}
424424

425425
@memoize()
426-
get debugging() {
426+
get debugging(): boolean {
427427
return this._context.extensionMode === ExtensionMode.Development;
428428
}
429429

430430
private readonly _deepLinks: DeepLinkService;
431-
get deepLinks() {
431+
get deepLinks(): DeepLinkService {
432432
return this._deepLinks;
433433
}
434434

435435
private readonly _documentTracker: GitDocumentTracker;
436-
get documentTracker() {
436+
get documentTracker(): GitDocumentTracker {
437437
return this._documentTracker;
438438
}
439439

440440
private _enrichments: EnrichmentService | undefined;
441-
get enrichments() {
441+
get enrichments(): EnrichmentService {
442442
if (this._enrichments == null) {
443443
this._disposables.push((this._enrichments = new EnrichmentService(this, new ServerConnection(this))));
444444
}
@@ -458,12 +458,12 @@ export class Container {
458458
}
459459

460460
private readonly _eventBus: EventBus;
461-
get events() {
461+
get events(): EventBus {
462462
return this._eventBus;
463463
}
464464

465465
private readonly _fileAnnotationController: FileAnnotationController;
466-
get fileAnnotations() {
466+
get fileAnnotations(): FileAnnotationController {
467467
return this._fileAnnotationController;
468468
}
469469

@@ -473,12 +473,12 @@ export class Container {
473473
}
474474

475475
private readonly _git: GitProviderService;
476-
get git() {
476+
get git(): GitProviderService {
477477
return this._git;
478478
}
479479

480480
private _github: Promise<GitHubApi | undefined> | undefined;
481-
get github() {
481+
get github(): Promise<GitHubApi | undefined> {
482482
if (this._github == null) {
483483
async function load(this: Container) {
484484
try {
@@ -502,7 +502,7 @@ export class Container {
502502
}
503503

504504
private _gitlab: Promise<GitLabApi | undefined> | undefined;
505-
get gitlab() {
505+
get gitlab(): Promise<GitLabApi | undefined> {
506506
if (this._gitlab == null) {
507507
async function load(this: Container) {
508508
try {
@@ -526,7 +526,7 @@ export class Container {
526526
}
527527

528528
@memoize()
529-
get id() {
529+
get id(): string {
530530
return this._context.extension.id;
531531
}
532532

@@ -540,63 +540,63 @@ export class Container {
540540
}
541541

542542
private readonly _keyboard: Keyboard;
543-
get keyboard() {
543+
get keyboard(): Keyboard {
544544
return this._keyboard;
545545
}
546546

547547
private readonly _lineAnnotationController: LineAnnotationController;
548-
get lineAnnotations() {
548+
get lineAnnotations(): LineAnnotationController {
549549
return this._lineAnnotationController;
550550
}
551551

552552
private readonly _lineHoverController: LineHoverController;
553-
get lineHovers() {
553+
get lineHovers(): LineHoverController {
554554
return this._lineHoverController;
555555
}
556556

557557
private readonly _lineTracker: LineTracker;
558-
get lineTracker() {
558+
get lineTracker(): LineTracker {
559559
return this._lineTracker;
560560
}
561561

562562
private _mode: Mode | undefined;
563-
get mode() {
563+
get mode(): Mode | undefined {
564564
if (this._mode == null) {
565565
this._mode = configuration.get('modes')?.[configuration.get('mode.active')];
566566
}
567567
return this._mode;
568568
}
569569

570570
private _organizations: OrganizationService;
571-
get organizations() {
571+
get organizations(): OrganizationService {
572572
return this._organizations;
573573
}
574574

575575
private readonly _prerelease;
576-
get prerelease() {
576+
get prerelease(): boolean {
577577
return this._prerelease;
578578
}
579579

580580
@memoize()
581-
get prereleaseOrDebugging() {
581+
get prereleaseOrDebugging(): boolean {
582582
return this._prerelease || this.debugging;
583583
}
584584

585585
private readonly _rebaseEditor: RebaseEditorProvider;
586-
get rebaseEditor() {
586+
get rebaseEditor(): RebaseEditorProvider {
587587
return this._rebaseEditor;
588588
}
589589

590590
private _repositoryPathMapping: RepositoryPathMappingProvider | undefined;
591-
get repositoryPathMapping() {
591+
get repositoryPathMapping(): RepositoryPathMappingProvider {
592592
if (this._repositoryPathMapping == null) {
593593
this._disposables.push((this._repositoryPathMapping = getSupportedRepositoryPathMappingProvider(this)));
594594
}
595595
return this._repositoryPathMapping;
596596
}
597597

598598
private readonly _statusBarController: StatusBarController;
599-
get statusBar() {
599+
get statusBar(): StatusBarController {
600600
return this._statusBarController;
601601
}
602602

@@ -606,7 +606,7 @@ export class Container {
606606
}
607607

608608
private _subscription: SubscriptionService;
609-
get subscription() {
609+
get subscription(): SubscriptionService {
610610
return this._subscription;
611611
}
612612

@@ -616,7 +616,7 @@ export class Container {
616616
}
617617

618618
private readonly _uri: UriService;
619-
get uri() {
619+
get uri(): UriService {
620620
return this._uri;
621621
}
622622

@@ -641,12 +641,12 @@ export class Container {
641641
}
642642

643643
private readonly _vsls: VslsController;
644-
get vsls() {
644+
get vsls(): VslsController {
645645
return this._vsls;
646646
}
647647

648648
private _workspaces: WorkspacesService | undefined;
649-
get workspaces() {
649+
get workspaces(): WorkspacesService {
650650
if (this._workspaces == null) {
651651
this._disposables.push((this._workspaces = new WorkspacesService(this, this._connection)));
652652
}

0 commit comments

Comments
 (0)