File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -554,14 +554,14 @@ namespace ts {
554554 const filesSeen : Map < boolean > = { } ;
555555
556556 let exclude : string [ ] = [ ] ;
557- if ( json [ "exclude" ] instanceof Array ) {
557+ if ( json [ "exclude" ] instanceof Array ) {
558558 exclude = json [ "exclude" ] ;
559559 }
560560 else {
561561 // by default exclude node_modules, and any specificied output directory
562- exclude = [ "node_modules" ]
563- let outDir = json [ "compilerOptions" ] && json [ "compilerOptions" ] [ "outDir" ] ;
564- if ( outDir ) {
562+ exclude = [ "node_modules" ] ;
563+ const outDir = json [ "compilerOptions" ] && json [ "compilerOptions" ] [ "outDir" ] ;
564+ if ( outDir ) {
565565 exclude . push ( outDir ) ;
566566 }
567567 }
Original file line number Diff line number Diff line change @@ -7,10 +7,16 @@ module ts {
77 }
88
99 function createDefaultServerHost ( fileMap : Map < File > ) : server . ServerHost {
10- const directories : Map < string > = { } ;
11- for ( const f in fileMap ) {
12- directories [ getDirectoryPath ( f ) ] = f ;
13- }
10+ let existingDirectories : Map < boolean > = { } ;
11+ forEachValue ( fileMap , v => {
12+ let dir = getDirectoryPath ( v . name ) ;
13+ let previous : string ;
14+ do {
15+ existingDirectories [ dir ] = true ;
16+ previous = dir ;
17+ dir = getDirectoryPath ( dir ) ;
18+ } while ( dir !== previous ) ;
19+ } ) ;
1420 return {
1521 args : < string [ ] > [ ] ,
1622 newLine : "\r\n" ,
@@ -30,7 +36,7 @@ module ts {
3036 return hasProperty ( fileMap , path ) ;
3137 } ,
3238 directoryExists : ( path : string ) : boolean => {
33- return hasProperty ( directories , path ) ;
39+ return hasProperty ( existingDirectories , path ) ;
3440 } ,
3541 createDirectory : ( path : string ) => {
3642 } ,
You can’t perform that action at this time.
0 commit comments