File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
testRunner/unittests/tsserver Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -1599,6 +1599,10 @@ namespace ts.server {
1599
1599
return emptyArray ;
1600
1600
}
1601
1601
1602
+ function dtsChangeCanAffectEmit ( compilationSettings : CompilerOptions ) {
1603
+ return getEmitDeclarations ( compilationSettings ) || ! ! compilationSettings . emitDecoratorMetadata ;
1604
+ }
1605
+
1602
1606
return combineProjectOutput (
1603
1607
info ,
1604
1608
path => this . projectService . getScriptInfoForPath ( path ) ! ,
@@ -1610,8 +1614,8 @@ namespace ts.server {
1610
1614
1611
1615
const compilationSettings = project . getCompilationSettings ( ) ;
1612
1616
1613
- if ( ! ! compilationSettings . noEmit || fileExtensionIs ( info . fileName , Extension . Dts ) && ! getEmitDeclarations ( compilationSettings ) ) {
1614
- // avoid triggering emit when a change is made in a .d.ts when declaration emit is disabled
1617
+ if ( ! ! compilationSettings . noEmit || fileExtensionIs ( info . fileName , Extension . Dts ) && ! dtsChangeCanAffectEmit ( compilationSettings ) ) {
1618
+ // avoid triggering emit when a change is made in a .d.ts when declaration emit and decorator metadata emit are disabled
1615
1619
return undefined ;
1616
1620
}
1617
1621
Original file line number Diff line number Diff line change @@ -598,6 +598,15 @@ namespace ts.projectSystem {
598
598
/*expectDTSEmit*/ true
599
599
) ;
600
600
} ) ;
601
+
602
+ it ( "should return results if change is made in a global declaration file with decorator emit enabled" , ( ) => {
603
+ testDTS (
604
+ /*dtsFileContents*/ "declare const x: string;" ,
605
+ /*tsFileContents*/ "var y = 1;" ,
606
+ /*opts*/ { experimentalDecorators : true , emitDecoratorMetadata : true } ,
607
+ /*expectDTSEmit*/ true
608
+ ) ;
609
+ } ) ;
601
610
} ) ;
602
611
603
612
describe ( "tsserverProjectSystem emit with outFile or out setting" , ( ) => {
You can’t perform that action at this time.
0 commit comments