Skip to content

Commit 5f46e48

Browse files
committed
Mark containing project as dirty when file is closed
(Note: adding this until PR #12789 is merged in so that unit tests pass)
1 parent 4cb5a36 commit 5f46e48

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/server/project.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ namespace ts.server {
212212
*/
213213
private projectStateVersion = 0;
214214

215-
216215
private typingFiles: SortedReadonlyArray<string>;
217216

218217
protected projectErrors: Diagnostic[];

src/server/scriptInfo.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ namespace ts.server {
2828
this.switchToScriptVersionCache(newText);
2929
}
3030

31-
public useText() {
31+
public useText(newText?: string) {
3232
this.svc = undefined;
33-
this.reloadFromFile();
33+
this.setText(newText);
3434
}
3535

3636
public edit(start: number, end: number, newText: string) {
@@ -198,7 +198,8 @@ namespace ts.server {
198198

199199
public close() {
200200
this.isOpen = false;
201-
this.textStorage.useText();
201+
this.textStorage.useText(this.hasMixedContent ? "" : undefined);
202+
this.markContainingProjectsAsDirty();
202203
}
203204

204205
public getSnapshot() {

0 commit comments

Comments
 (0)