@@ -174,7 +174,7 @@ var serverCoreSources = [
174
174
"lsHost.ts" ,
175
175
"project.ts" ,
176
176
"editorServices.ts" ,
177
- "protocol.d. ts" ,
177
+ "protocol.ts" ,
178
178
"session.ts" ,
179
179
"server.ts"
180
180
] . map ( function ( f ) {
@@ -198,14 +198,13 @@ var typingsInstallerSources = [
198
198
var serverSources = serverCoreSources . concat ( servicesSources ) ;
199
199
200
200
var languageServiceLibrarySources = [
201
- "protocol.d. ts" ,
201
+ "protocol.ts" ,
202
202
"utilities.ts" ,
203
203
"scriptVersionCache.ts" ,
204
204
"scriptInfo.ts" ,
205
205
"lsHost.ts" ,
206
206
"project.ts" ,
207
207
"editorServices.ts" ,
208
- "protocol.d.ts" ,
209
208
"session.ts" ,
210
209
211
210
] . map ( function ( f ) {
@@ -259,15 +258,14 @@ var harnessSources = harnessCoreSources.concat([
259
258
] . map ( function ( f ) {
260
259
return path . join ( unittestsDirectory , f ) ;
261
260
} ) ) . concat ( [
262
- "protocol.d. ts" ,
261
+ "protocol.ts" ,
263
262
"utilities.ts" ,
264
263
"scriptVersionCache.ts" ,
265
264
"scriptInfo.ts" ,
266
265
"lsHost.ts" ,
267
266
"project.ts" ,
268
267
"typingsCache.ts" ,
269
268
"editorServices.ts" ,
270
- "protocol.d.ts" ,
271
269
"session.ts" ,
272
270
] . map ( function ( f ) {
273
271
return path . join ( serverDirectory , f ) ;
@@ -518,6 +516,40 @@ compileFile(processDiagnosticMessagesJs,
518
516
[ ] ,
519
517
/*useBuiltCompiler*/ false ) ;
520
518
519
+ var buildProtocolTs = path . join ( scriptsDirectory , "buildProtocol.ts" ) ;
520
+ var buildProtocolJs = path . join ( scriptsDirectory , "buildProtocol.js" ) ;
521
+ var buildProtocolDts = path . join ( builtLocalDirectory , "protocol.d.ts" ) ;
522
+ var typescriptServicesDts = path . join ( builtLocalDirectory , "typescriptServices.d.ts" ) ;
523
+
524
+ file ( buildProtocolTs ) ;
525
+
526
+ compileFile ( buildProtocolJs ,
527
+ [ buildProtocolTs ] ,
528
+ [ buildProtocolTs ] ,
529
+ [ ] ,
530
+ /*useBuiltCompiler*/ false ,
531
+ { noOutFile : true } ) ;
532
+
533
+ file ( buildProtocolDts , [ buildProtocolTs , buildProtocolJs , typescriptServicesDts ] , function ( ) {
534
+
535
+ var protocolTs = path . join ( serverDirectory , "protocol.ts" ) ;
536
+
537
+ var cmd = host + " " + buildProtocolJs + " " + protocolTs + " " + typescriptServicesDts + " " + buildProtocolDts ;
538
+ console . log ( cmd ) ;
539
+ var ex = jake . createExec ( [ cmd ] ) ;
540
+ // Add listeners for output and error
541
+ ex . addListener ( "stdout" , function ( output ) {
542
+ process . stdout . write ( output ) ;
543
+ } ) ;
544
+ ex . addListener ( "stderr" , function ( error ) {
545
+ process . stderr . write ( error ) ;
546
+ } ) ;
547
+ ex . addListener ( "cmdEnd" , function ( ) {
548
+ complete ( ) ;
549
+ } ) ;
550
+ ex . run ( ) ;
551
+ } , { async : true } )
552
+
521
553
// The generated diagnostics map; built for the compiler and for the 'generate-diagnostics' task
522
554
file ( diagnosticInfoMapTs , [ processDiagnosticMessagesJs , diagnosticMessagesJson ] , function ( ) {
523
555
var cmd = host + " " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson ;
@@ -655,6 +687,8 @@ compileFile(
655
687
inlineSourceMap : true
656
688
} ) ;
657
689
690
+ file ( typescriptServicesDts , [ servicesFile ] ) ;
691
+
658
692
var cancellationTokenFile = path . join ( builtLocalDirectory , "cancellationToken.js" ) ;
659
693
compileFile ( cancellationTokenFile , cancellationTokenSources , [ builtLocalDirectory ] . concat ( cancellationTokenSources ) , /*prefixes*/ [ copyright ] , /*useBuiltCompiler*/ true , { outDir : builtLocalDirectory , noOutFile : true } ) ;
660
694
@@ -689,7 +723,7 @@ task("build-fold-end", [], function () {
689
723
690
724
// Local target to build the compiler and services
691
725
desc ( "Builds the full compiler and services" ) ;
692
- task ( "local" , [ "build-fold-start" , "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile , serverFile , builtGeneratedDiagnosticMessagesJSON , "lssl" , "build-fold-end" ] ) ;
726
+ task ( "local" , [ "build-fold-start" , "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile , serverFile , buildProtocolDts , builtGeneratedDiagnosticMessagesJSON , "lssl" , "build-fold-end" ] ) ;
693
727
694
728
// Local target to build only tsc.js
695
729
desc ( "Builds only the compiler" ) ;
@@ -745,7 +779,7 @@ task("generate-spec", [specMd]);
745
779
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
746
780
desc ( "Makes a new LKG out of the built js files" ) ;
747
781
task ( "LKG" , [ "clean" , "release" , "local" ] . concat ( libraryTargets ) , function ( ) {
748
- var expectedFiles = [ tscFile , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile , cancellationTokenFile , typingsInstallerFile ] . concat ( libraryTargets ) ;
782
+ var expectedFiles = [ tscFile , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile , cancellationTokenFile , typingsInstallerFile , buildProtocolDts ] . concat ( libraryTargets ) ;
749
783
var missingFiles = expectedFiles . filter ( function ( f ) {
750
784
return ! fs . existsSync ( f ) ;
751
785
} ) ;
0 commit comments