File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -211,9 +211,7 @@ export class TextDocuments {
211
211
this . changeNumber ++ ;
212
212
const file = uriToFileName ( event . textDocument . uri ) ;
213
213
if ( file ) {
214
- const savedContent = this . host . readFile ( file ) ;
215
- this . projectService . closeClientFile ( file ) ;
216
- this . projectService . openClientFile ( file , savedContent ) ;
214
+ this . projectService . reloadScript ( file ) ;
217
215
this . changeNumber ++ ;
218
216
}
219
217
} ) ) ;
Original file line number Diff line number Diff line change @@ -1641,6 +1641,15 @@ export class ProjectService {
1641
1641
this . report ( "change" , file , project ) ;
1642
1642
}
1643
1643
1644
+ reloadScript ( filename : string ) : void {
1645
+ const info : ScriptInfo = this . filenameToScriptInfo [ filename ] ;
1646
+ if ( info ) {
1647
+ info . svc . reloadFromFile ( filename ) ;
1648
+ this . changeSeq ++ ;
1649
+ this . report ( "change" , info . fileName )
1650
+ }
1651
+ }
1652
+
1644
1653
forcedGetProjectForFile ( fileName : string ) : Project {
1645
1654
const file = normalizePath ( fileName ) ;
1646
1655
const info = this . filenameToScriptInfo [ file ] ;
You can’t perform that action at this time.
0 commit comments