@@ -19,7 +19,7 @@ import {
19
19
20
20
import { CaseInsensitiveMap } from './fs' ;
21
21
import { isCaseInsensitive } from '../helpers' ;
22
-
22
+
23
23
const caseInsensitive = isCaseInsensitive ( ) ;
24
24
25
25
if ( ! module . parent ) {
@@ -95,10 +95,10 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
95
95
fileName => fileName . toLowerCase ( ) :
96
96
( fileName => fileName ) ;
97
97
98
- let watchHost : ts . WatchCompilerHostOfFilesAndCompilerOptions ;
98
+ let watchHost : ts . WatchCompilerHostOfFilesAndCompilerOptions < ts . SemanticDiagnosticsBuilderProgram > ;
99
99
let watch : ts . WatchOfFilesAndCompilerOptions < ts . SemanticDiagnosticsBuilderProgram > ;
100
-
101
- function createWatchHost ( ) : ts . WatchCompilerHostOfFilesAndCompilerOptions & ts . BuilderProgramHost {
100
+
101
+ function createWatchHost ( ) : ts . WatchCompilerHostOfFilesAndCompilerOptions < ts . SemanticDiagnosticsBuilderProgram > & ts . BuilderProgramHost {
102
102
return {
103
103
rootFiles : getRootFiles ( ) ,
104
104
options : compilerOptions ,
@@ -117,7 +117,9 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
117
117
watchFile,
118
118
watchDirectory,
119
119
120
- createHash : ( ...args ) => compiler . sys . createHash . apply ( compiler . sys , args )
120
+ createProgram : compiler . createSemanticDiagnosticsBuilderProgram ,
121
+
122
+ createHash : ( ...args ) => compiler . sys . createHash . apply ( compiler . sys , args )
121
123
} ;
122
124
123
125
function readFile ( fileName : string ) {
@@ -131,7 +133,7 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
131
133
132
134
function createWatch ( ) : ts . WatchOfFilesAndCompilerOptions < ts . SemanticDiagnosticsBuilderProgram > {
133
135
watchHost = createWatchHost ( ) ;
134
- return compiler . createWatchBuilderProgram ( watchHost , compiler . createSemanticDiagnosticsBuilderProgram ) ;
136
+ return compiler . createWatchProgram ( watchHost ) ;
135
137
}
136
138
137
139
function getProgram ( ) : ts . SemanticDiagnosticsBuilderProgram {
@@ -385,10 +387,10 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
385
387
replyOk ( seq , {
386
388
files : getProgram ( ) . getSourceFiles ( ) . map ( f => f . fileName )
387
389
} ) ;
388
- }
389
-
390
- function isAffectedSourceFile ( affected : ts . SourceFile | ts . Program ) : affected is ts . SourceFile {
391
- return ( affected as ts . SourceFile ) . kind === compiler . SyntaxKind . SourceFile ;
390
+ }
391
+
392
+ function isAffectedSourceFile ( affected : ts . SourceFile | ts . Program ) : affected is ts . SourceFile {
393
+ return ( affected as ts . SourceFile ) . kind === compiler . SyntaxKind . SourceFile ;
392
394
}
393
395
394
396
function processDiagnostics ( { seq } : Diagnostics . Request ) {
0 commit comments