We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21e30e0 commit f91bee0Copy full SHA for f91bee0
src/server/editorServices.ts
@@ -683,6 +683,11 @@ namespace ts.server {
683
* @param info The file that has been closed or newly configured
684
*/
685
closeOpenFile(info: ScriptInfo) {
686
+ // Closing file should trigger re-reading the file content from disk. This is
687
+ // because the user may chose to discard the buffer content before saving
688
+ // to the disk, and the server's version of the file can be out of sync.
689
+ info.svc.reloadFromFile(info.fileName);
690
+
691
var openFileRoots: ScriptInfo[] = [];
692
var removedProject: Project;
693
for (var i = 0, len = this.openFileRoots.length; i < len; i++) {
0 commit comments