File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1604,15 +1604,22 @@ namespace ts.server {
16041604 path => this . projectService . getScriptInfoForPath ( path ) ! ,
16051605 projects ,
16061606 ( project , info ) => {
1607- let result : protocol . CompileOnSaveAffectedFileListSingleProject | undefined ;
1608- if ( project . compileOnSaveEnabled && project . languageServiceEnabled && ! project . isOrphan ( ) && ! project . getCompilationSettings ( ) . noEmit ) {
1609- result = {
1610- projectFileName : project . getProjectName ( ) ,
1611- fileNames : project . getCompileOnSaveAffectedFileList ( info ) ,
1612- projectUsesOutFile : ! ! project . getCompilationSettings ( ) . outFile || ! ! project . getCompilationSettings ( ) . out
1613- } ;
1607+ if ( ! project . compileOnSaveEnabled || ! project . languageServiceEnabled || project . isOrphan ( ) ) {
1608+ return undefined ;
1609+ }
1610+
1611+ const compilationSettings = project . getCompilationSettings ( ) ;
1612+
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
1615+ return undefined ;
16141616 }
1615- return result ;
1617+
1618+ return {
1619+ projectFileName : project . getProjectName ( ) ,
1620+ fileNames : project . getCompileOnSaveAffectedFileList ( info ) ,
1621+ projectUsesOutFile : ! ! compilationSettings . outFile || ! ! compilationSettings . out
1622+ } ;
16161623 }
16171624 ) ;
16181625 }
You can’t perform that action at this time.
0 commit comments