Declare typingsInstaller as optional for ProjectService (#53896)

This commit is contained in:
Jake Bailey 2023-04-18 14:10:30 -07:00 committed by GitHub
parent ece33b7b59
commit 5402998c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -579,7 +579,7 @@ export interface ProjectServiceOptions {
cancellationToken: HostCancellationToken;
useSingleInferredProject: boolean;
useInferredProjectPerProjectRoot: boolean;
typingsInstaller: ITypingsInstaller;
typingsInstaller?: ITypingsInstaller;
eventHandler?: ProjectServiceEventHandler;
suppressDiagnosticEvents?: boolean;
throttleWaitMilliseconds?: number;

View File

@ -161,6 +161,7 @@ import {
LogLevel,
Msg,
NormalizedPath,
nullTypingsInstaller,
Project,
ProjectInfoTelemetryEvent,
ProjectKind,
@ -926,7 +927,7 @@ export interface SessionOptions {
cancellationToken: ServerCancellationToken;
useSingleInferredProject: boolean;
useInferredProjectPerProjectRoot: boolean;
typingsInstaller: ITypingsInstaller;
typingsInstaller?: ITypingsInstaller;
byteLength: (buf: string, encoding?: BufferEncoding) => number;
hrtime: (start?: [number, number]) => [number, number];
logger: Logger;
@ -972,7 +973,7 @@ export class Session<TMessage = string> implements EventSender {
constructor(opts: SessionOptions) {
this.host = opts.host;
this.cancellationToken = opts.cancellationToken;
this.typingsInstaller = opts.typingsInstaller;
this.typingsInstaller = opts.typingsInstaller || nullTypingsInstaller;
this.byteLength = opts.byteLength;
this.hrtime = opts.hrtime;
this.logger = opts.logger;

View File

@ -3554,7 +3554,7 @@ declare namespace ts {
cancellationToken: HostCancellationToken;
useSingleInferredProject: boolean;
useInferredProjectPerProjectRoot: boolean;
typingsInstaller: ITypingsInstaller;
typingsInstaller?: ITypingsInstaller;
eventHandler?: ProjectServiceEventHandler;
suppressDiagnosticEvents?: boolean;
throttleWaitMilliseconds?: number;
@ -3826,7 +3826,7 @@ declare namespace ts {
cancellationToken: ServerCancellationToken;
useSingleInferredProject: boolean;
useInferredProjectPerProjectRoot: boolean;
typingsInstaller: ITypingsInstaller;
typingsInstaller?: ITypingsInstaller;
byteLength: (buf: string, encoding?: BufferEncoding) => number;
hrtime: (start?: [
number,