File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1465,13 +1465,24 @@ namespace ts.server {
1465
1465
}
1466
1466
1467
1467
private getCompileOnSaveAffectedFileList ( args : protocol . FileRequestArgs ) : ReadonlyArray < protocol . CompileOnSaveAffectedFileListSingleProject > {
1468
- const info = this . projectService . getScriptInfoEnsuringProjectsUptoDate ( args . file ) ;
1468
+ let info : ScriptInfo | undefined ;
1469
+ let project : Project | undefined ;
1470
+ if ( args . projectFileName ) {
1471
+ // Do not update all projects if we are looking for specific project to compile on save
1472
+ project = this . projectService . findProject ( args . projectFileName ) ! ;
1473
+ if ( project . dirty ) project . updateGraph ( ) ;
1474
+ info = this . projectService . getScriptInfo ( args . file ) ;
1475
+ }
1476
+ else {
1477
+ info = this . projectService . getScriptInfoEnsuringProjectsUptoDate ( args . file ) ;
1478
+ }
1479
+
1469
1480
if ( ! info ) {
1470
1481
return emptyArray ;
1471
1482
}
1472
1483
1473
1484
// if specified a project, we only return affected file list in this project
1474
- const projects = args . projectFileName ? [ this . projectService . findProject ( args . projectFileName ) ! ] : info . containingProjects ;
1485
+ const projects = args . projectFileName ? [ project ! ] : info . containingProjects ;
1475
1486
const symLinkedProjects = ! args . projectFileName && this . projectService . getSymlinkedProjects ( info ) ;
1476
1487
return combineProjectOutput (
1477
1488
info ,
You can’t perform that action at this time.
0 commit comments