@@ -17,27 +17,13 @@ namespace ts.projectSystem {
17
17
} )
18
18
} ;
19
19
20
- const typeMapList = {
20
+ const customSafeList = {
21
21
path : < Path > "/typeMapList.json" ,
22
22
content : JSON . stringify ( {
23
- "jquery" : {
24
- // jquery files can have names like "jquery-1.10.2.min.js" (or "jquery.intellisense.js")
25
- "match" : "/jquery(-(\\.?\\d+)+)?(\\.intellisense)?(\\.min)?\\.js$" ,
26
- "types" : [ "jquery" ]
23
+ "quack" : {
24
+ "match" : "/duckquack-(\\d+)\\.min\\.js" ,
25
+ "types" : [ "duck-types" ]
27
26
} ,
28
- "WinJS" : {
29
- "match" : "^(.*/winjs)/base\\.js$" , // If the winjs/base.js file is found..
30
- "exclude" : [ [ "^" , 1 , "/.*" ] ] , // ..then exclude all files under the winjs folder
31
- "types" : [ "winjs" ] // And fetch the @types package for WinJS
32
- } ,
33
- "Office Nuget" : {
34
- "match" : "^(.*/1/office)/excel\\.debug\\.js$" , // Office NuGet package is installed under a "1/office" folder
35
- "exclude" : [ [ "^" , 1 , "/.*" ] ] , // Exclude that whole folder if the file indicated above is found in it
36
- "types" : [ "office" ] // @types package to fetch instead
37
- } ,
38
- "Minified files" : {
39
- "match" : "^.*\\.min\\.js$" // Catch-all for minified files. Default exclude is the matched file.
40
- }
41
27
} )
42
28
} ;
43
29
@@ -1475,17 +1461,20 @@ namespace ts.projectSystem {
1475
1461
content : "export let x = 5"
1476
1462
} ;
1477
1463
const office = {
1478
- path : "lib/1/office/excel.debug .js" ,
1464
+ path : "/ lib/duckquack-3.min .js" ,
1479
1465
content : "whoa do @@ not parse me ok thanks!!!"
1480
1466
} ;
1481
- const host = createServerHost ( [ typeMapList , file1 , office ] ) ;
1467
+ const host = createServerHost ( [ customSafeList , file1 , office ] ) ;
1482
1468
const projectService = createProjectService ( host ) ;
1483
- projectService . loadSafeList ( typeMapList . path ) ;
1484
-
1485
- projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path , office . path ] ) } ) ;
1486
- const proj = projectService . externalProjects [ 0 ] ;
1487
- assert . deepEqual ( proj . getFileNames ( true ) , [ file1 . path ] ) ;
1488
- assert . deepEqual ( proj . getTypeAcquisition ( ) . include , [ "office" ] ) ;
1469
+ projectService . loadSafeList ( customSafeList . path ) ;
1470
+ try {
1471
+ projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path , office . path ] ) } ) ;
1472
+ const proj = projectService . externalProjects [ 0 ] ;
1473
+ assert . deepEqual ( proj . getFileNames ( true ) , [ file1 . path ] ) ;
1474
+ assert . deepEqual ( proj . getTypeAcquisition ( ) . include , [ "duck-types" ] ) ;
1475
+ } finally {
1476
+ projectService . resetSafeList ( ) ;
1477
+ }
1489
1478
} ) ;
1490
1479
1491
1480
it ( "open file become a part of configured project if it is referenced from root file" , ( ) => {
0 commit comments