File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -1604,15 +1604,22 @@ namespace ts.server {
1604
1604
path => this . projectService . getScriptInfoForPath ( path ) ! ,
1605
1605
projects ,
1606
1606
( 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 ;
1614
1616
}
1615
- return result ;
1617
+
1618
+ return {
1619
+ projectFileName : project . getProjectName ( ) ,
1620
+ fileNames : project . getCompileOnSaveAffectedFileList ( info ) ,
1621
+ projectUsesOutFile : ! ! compilationSettings . outFile || ! ! compilationSettings . out
1622
+ } ;
1616
1623
}
1617
1624
) ;
1618
1625
}
You can’t perform that action at this time.
0 commit comments