@@ -8,6 +8,7 @@ var child_process = require("child_process");
88// Variables
99var compilerDirectory = "src/compiler/" ;
1010var servicesDirectory = "src/services/" ;
11+ var serverDirectory = "src/server/" ;
1112var harnessDirectory = "src/harness/" ;
1213var libraryDirectory = "src/lib/" ;
1314var scriptsDirectory = "scripts/" ;
@@ -64,8 +65,10 @@ var servicesSources = [
6465 return path . join ( compilerDirectory , f ) ;
6566} ) . concat ( [
6667 "breakpoints.ts" ,
68+ "navigateTo.ts" ,
6769 "navigationBar.ts" ,
6870 "outliningElementsCollector.ts" ,
71+ "patternMatcher.ts" ,
6972 "services.ts" ,
7073 "shims.ts" ,
7174 "signatureHelp.ts" ,
@@ -90,6 +93,16 @@ var servicesSources = [
9093 return path . join ( servicesDirectory , f ) ;
9194} ) ) ;
9295
96+ var serverSources = [
97+ "node.d.ts" ,
98+ "editorServices.ts" ,
99+ "protocol.d.ts" ,
100+ "session.ts" ,
101+ "server.ts"
102+ ] . map ( function ( f ) {
103+ return path . join ( serverDirectory , f ) ;
104+ } ) ;
105+
93106var definitionsRoots = [
94107 "compiler/types.d.ts" ,
95108 "compiler/scanner.d.ts" ,
@@ -127,9 +140,17 @@ var harnessSources = [
127140 "incrementalParser.ts" ,
128141 "services/colorization.ts" ,
129142 "services/documentRegistry.ts" ,
130- "services/preProcessFile.ts"
143+ "services/preProcessFile.ts" ,
144+ "services/patternMatcher.ts"
131145] . map ( function ( f ) {
132146 return path . join ( unittestsDirectory , f ) ;
147+ } ) ) . concat ( [
148+ "protocol.d.ts" ,
149+ "session.ts" ,
150+ "client.ts" ,
151+ "editorServices.ts" ,
152+ ] . map ( function ( f ) {
153+ return path . join ( serverDirectory , f ) ;
133154} ) ) ;
134155
135156var librarySourceMap = [
@@ -327,6 +348,7 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
327348compileFile ( tscFile , compilerSources , [ builtLocalDirectory , copyright ] . concat ( compilerSources ) , [ copyright ] , /*useBuiltCompiler:*/ false ) ;
328349
329350var servicesFile = path . join ( builtLocalDirectory , "typescriptServices.js" ) ;
351+ var nodePackageFile = path . join ( builtLocalDirectory , "typescript.js" ) ;
330352compileFile ( servicesFile , servicesSources , [ builtLocalDirectory , copyright ] . concat ( servicesSources ) ,
331353 /*prefixes*/ [ copyright ] ,
332354 /*useBuiltCompiler*/ true ,
@@ -336,7 +358,10 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
336358 /*preserveConstEnums*/ true ,
337359 /*keepComments*/ false ,
338360 /*noResolve*/ false ,
339- /*stripInternal*/ false ) ;
361+ /*stripInternal*/ false ,
362+ /*callback*/ function ( ) {
363+ jake . cpR ( servicesFile , nodePackageFile , { silent : true } ) ;
364+ } ) ;
340365
341366var nodeDefinitionsFile = path . join ( builtLocalDirectory , "typescript.d.ts" ) ;
342367var standaloneDefinitionsFile = path . join ( builtLocalDirectory , "typescriptServices.d.ts" ) ;
@@ -378,9 +403,12 @@ compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright
378403 jake . rmRf ( tempDirPath , { silent : true } ) ;
379404 } ) ;
380405
406+ var serverFile = path . join ( builtLocalDirectory , "tsserver.js" ) ;
407+ compileFile ( serverFile , serverSources , [ builtLocalDirectory , copyright ] . concat ( serverSources ) , /*prefixes*/ [ copyright ] , /*useBuiltCompiler*/ true ) ;
408+
381409// Local target to build the compiler and services
382410desc ( "Builds the full compiler and services" ) ;
383- task ( "local" , [ "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile ] ) ;
411+ task ( "local" , [ "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile , serverFile ] ) ;
384412
385413// Local target to build only tsc.js
386414desc ( "Builds only the compiler" ) ;
@@ -435,7 +463,7 @@ task("generate-spec", [specMd])
435463// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
436464desc ( "Makes a new LKG out of the built js files" ) ;
437465task ( "LKG" , [ "clean" , "release" , "local" ] . concat ( libraryTargets ) , function ( ) {
438- var expectedFiles = [ tscFile , servicesFile , nodeDefinitionsFile , standaloneDefinitionsFile , internalNodeDefinitionsFile , internalStandaloneDefinitionsFile ] . concat ( libraryTargets ) ;
466+ var expectedFiles = [ tscFile , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , internalNodeDefinitionsFile , internalStandaloneDefinitionsFile ] . concat ( libraryTargets ) ;
439467 var missingFiles = expectedFiles . filter ( function ( f ) {
440468 return ! fs . existsSync ( f ) ;
441469 } ) ;
@@ -542,11 +570,11 @@ task("runtests", ["tests", builtLocalDirectory], function() {
542570 }
543571
544572 if ( tests && tests . toLocaleLowerCase ( ) === "rwc" ) {
545- testTimeout = 50000 ;
573+ testTimeout = 100000 ;
546574 }
547575
548576 colors = process . env . colors || process . env . color
549- colors = colors ? ' --no-colors ' : ''
577+ colors = colors ? ' --no-colors ' : ' --colors ' ;
550578 tests = tests ? ' -g ' + tests : '' ;
551579 reporter = process . env . reporter || process . env . r || 'dot' ;
552580 // timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
0 commit comments