@@ -39,9 +39,11 @@ const gulp = helpMaker(originalGulp);
3939const mochaParallel = require ( "./scripts/mocha-parallel.js" ) ;
4040const { runTestsInParallel} = mochaParallel ;
4141
42+ Error . stackTraceLimit = 1000 ;
43+
4244const cmdLineOptions = minimist ( process . argv . slice ( 2 ) , {
4345 boolean : [ "debug" , "light" , "colors" , "lint" , "soft" ] ,
44- string : [ "browser" , "tests" , "host" , "reporter" ] ,
46+ string : [ "browser" , "tests" , "host" , "reporter" , "stackTraceLimit" ] ,
4547 alias : {
4648 d : "debug" ,
4749 t : "tests" ,
@@ -416,9 +418,35 @@ gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => {
416418 ] ) . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
417419} ) ;
418420
421+ // cancellationToken.js
422+ const cancellationTokenJs = path . join ( builtLocalDirectory , "cancellationToken.js" ) ;
423+ gulp . task ( cancellationTokenJs , false , [ servicesFile ] , ( ) => {
424+ const cancellationTokenProject = tsc . createProject ( "src/server/cancellationToken/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
425+ return cancellationTokenProject . src ( )
426+ . pipe ( newer ( cancellationTokenJs ) )
427+ . pipe ( sourcemaps . init ( ) )
428+ . pipe ( tsc ( cancellationTokenProject ) )
429+ . pipe ( prependCopyright ( ) )
430+ . pipe ( sourcemaps . write ( "." ) )
431+ . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
432+ } ) ;
433+
434+ // typingsInstallerFile.js
435+ const typingsInstallerJs = path . join ( builtLocalDirectory , "typingsInstaller.js" ) ;
436+ gulp . task ( typingsInstallerJs , false , [ servicesFile ] , ( ) => {
437+ const cancellationTokenProject = tsc . createProject ( "src/server/typingsInstaller/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
438+ return cancellationTokenProject . src ( )
439+ . pipe ( newer ( typingsInstallerJs ) )
440+ . pipe ( sourcemaps . init ( ) )
441+ . pipe ( tsc ( cancellationTokenProject ) )
442+ . pipe ( prependCopyright ( ) )
443+ . pipe ( sourcemaps . write ( "." ) )
444+ . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
445+ } ) ;
446+
419447const serverFile = path . join ( builtLocalDirectory , "tsserver.js" ) ;
420448
421- gulp . task ( serverFile , false , [ servicesFile ] , ( ) => {
449+ gulp . task ( serverFile , false , [ servicesFile , typingsInstallerJs , cancellationTokenJs ] , ( ) => {
422450 const serverProject = tsc . createProject ( "src/server/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
423451 return serverProject . src ( )
424452 . pipe ( newer ( serverFile ) )
@@ -452,7 +480,6 @@ gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile
452480gulp . task ( "local" , "Builds the full compiler and services" , [ builtLocalCompiler , servicesFile , serverFile , builtGeneratedDiagnosticMessagesJSON , tsserverLibraryFile ] ) ;
453481gulp . task ( "tsc" , "Builds only the compiler" , [ builtLocalCompiler ] ) ;
454482
455-
456483// Generate Markdown spec
457484const word2mdJs = path . join ( scriptsDirectory , "word2md.js" ) ;
458485const word2mdTs = path . join ( scriptsDirectory , "word2md.ts" ) ;
@@ -491,7 +518,7 @@ gulp.task("useDebugMode", false, [], (done) => { useDebugMode = true; done(); })
491518gulp . task ( "dontUseDebugMode" , false , [ ] , ( done ) => { useDebugMode = false ; done ( ) ; } ) ;
492519
493520gulp . task ( "VerifyLKG" , false , [ ] , ( ) => {
494- const expectedFiles = [ builtLocalCompiler , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile ] . concat ( libraryTargets ) ;
521+ const expectedFiles = [ builtLocalCompiler , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile , typingsInstallerJs , cancellationTokenJs ] . concat ( libraryTargets ) ;
495522 const missingFiles = expectedFiles . filter ( function ( f ) {
496523 return ! fs . existsSync ( f ) ;
497524 } ) ;
@@ -551,14 +578,15 @@ function restoreSavedNodeEnv() {
551578 process . env . NODE_ENV = savedNodeEnv ;
552579}
553580
554- let testTimeout = 20000 ;
581+ let testTimeout = 40000 ;
555582function runConsoleTests ( defaultReporter : string , runInParallel : boolean , done : ( e ?: any ) => void ) {
556583 const lintFlag = cmdLineOptions [ "lint" ] ;
557584 cleanTestDirs ( ( err ) => {
558585 if ( err ) { console . error ( err ) ; failWithStatus ( err , 1 ) ; }
559586 const debug = cmdLineOptions [ "debug" ] ;
560587 const tests = cmdLineOptions [ "tests" ] ;
561588 const light = cmdLineOptions [ "light" ] ;
589+ const stackTraceLimit = cmdLineOptions [ "stackTraceLimit" ] ;
562590 const testConfigFile = "test.config" ;
563591 if ( fs . existsSync ( testConfigFile ) ) {
564592 fs . unlinkSync ( testConfigFile ) ;
@@ -578,7 +606,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
578606 }
579607
580608 if ( tests || light || taskConfigsFolder ) {
581- writeTestConfigFile ( tests , light , taskConfigsFolder , workerCount ) ;
609+ writeTestConfigFile ( tests , light , taskConfigsFolder , workerCount , stackTraceLimit ) ;
582610 }
583611
584612 if ( tests && tests . toLocaleLowerCase ( ) === "rwc" ) {
@@ -727,6 +755,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
727755 sourcemaps : {
728756 "built/local/_stream_0.js" : originalMap ,
729757 "built/local/bundle.js" : maps ,
758+ "node_modules/source-map-support/source-map-support.js" : undefined ,
730759 }
731760 } ) ;
732761 const finalMap = chain . apply ( ) ;
@@ -756,8 +785,8 @@ function cleanTestDirs(done: (e?: any) => void) {
756785}
757786
758787// used to pass data from jake command line directly to run.js
759- function writeTestConfigFile ( tests : string , light : boolean , taskConfigsFolder ?: string , workerCount ?: number ) {
760- const testConfigContents = JSON . stringify ( { test : tests ? [ tests ] : undefined , light : light , workerCount : workerCount , taskConfigsFolder : taskConfigsFolder } ) ;
788+ function writeTestConfigFile ( tests : string , light : boolean , taskConfigsFolder ?: string , workerCount ?: number , stackTraceLimit ?: string ) {
789+ const testConfigContents = JSON . stringify ( { test : tests ? [ tests ] : undefined , light, workerCount, stackTraceLimit , taskConfigsFolder } ) ;
761790 console . log ( "Running tests with config: " + testConfigContents ) ;
762791 fs . writeFileSync ( "test.config" , testConfigContents ) ;
763792}
@@ -887,7 +916,7 @@ gulp.task(loggedIOJsPath, false, [], (done) => {
887916 const temp = path . join ( builtLocalDirectory , "temp" ) ;
888917 mkdirP ( temp , ( err ) => {
889918 if ( err ) { console . error ( err ) ; done ( err ) ; process . exit ( 1 ) ; } ;
890- exec ( host , [ LKGCompiler , "--outdir" , temp , loggedIOpath ] , ( ) => {
919+ exec ( host , [ LKGCompiler , "--types -- outdir" , temp , loggedIOpath ] , ( ) => {
891920 fs . renameSync ( path . join ( temp , "/harness/loggedIO.js" ) , loggedIOJsPath ) ;
892921 del ( temp ) . then ( ( ) => done ( ) , done ) ;
893922 } , done ) ;
@@ -908,8 +937,8 @@ gulp.task(instrumenterJsPath, false, [servicesFile], () => {
908937 . pipe ( gulp . dest ( "." ) ) ;
909938} ) ;
910939
911- gulp . task ( "tsc-instrumented" , "Builds an instrumented tsc.js" , [ loggedIOJsPath , instrumenterJsPath , servicesFile ] , ( done ) => {
912- exec ( host , [ instrumenterJsPath , "record" , "iocapture" , builtLocalDirectory , compilerFilename ] , done , done ) ;
940+ gulp . task ( "tsc-instrumented" , "Builds an instrumented tsc.js" , [ "local" , loggedIOJsPath , instrumenterJsPath , servicesFile ] , ( done ) => {
941+ exec ( host , [ instrumenterJsPath , "record" , "iocapture" , builtLocalCompiler ] , done , done ) ;
913942} ) ;
914943
915944gulp . task ( "update-sublime" , "Updates the sublime plugin's tsserver" , [ "local" , serverFile ] , ( ) => {
0 commit comments