File tree Expand file tree Collapse file tree
testRunner/unittests/tsserver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1599,6 +1599,10 @@ namespace ts.server {
15991599 return emptyArray ;
16001600 }
16011601
1602+ function dtsChangeCanAffectEmit ( compilationSettings : CompilerOptions ) {
1603+ return getEmitDeclarations ( compilationSettings ) || ! ! compilationSettings . emitDecoratorMetadata ;
1604+ }
1605+
16021606 return combineProjectOutput (
16031607 info ,
16041608 path => this . projectService . getScriptInfoForPath ( path ) ! ,
@@ -1610,8 +1614,8 @@ namespace ts.server {
16101614
16111615 const compilationSettings = project . getCompilationSettings ( ) ;
16121616
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
16151619 return undefined ;
16161620 }
16171621
Original file line number Diff line number Diff line change @@ -598,6 +598,15 @@ namespace ts.projectSystem {
598598 /*expectDTSEmit*/ true
599599 ) ;
600600 } ) ;
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+ } ) ;
601610 } ) ;
602611
603612 describe ( "tsserverProjectSystem emit with outFile or out setting" , ( ) => {
You can’t perform that action at this time.
0 commit comments