From 33c3dbafa45481bc27ee42499cc4185ccb4cdb07 Mon Sep 17 00:00:00 2001 From: Aman Karmani Date: Tue, 7 Jan 2025 18:03:38 -0800 Subject: [PATCH 1/2] tsb - normalize filenames consistently in add/removeScriptSnapshot --- build/lib/tsb/builder.js | 3 ++- build/lib/tsb/builder.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build/lib/tsb/builder.js b/build/lib/tsb/builder.js index e7a2519d1c92d..c039131a57de6 100644 --- a/build/lib/tsb/builder.js +++ b/build/lib/tsb/builder.js @@ -521,10 +521,11 @@ class LanguageServiceHost { return old; } removeScriptSnapshot(filename) { + filename = normalize(filename); + this._log('removeScriptSnapshot', filename); this._filesInProject.delete(filename); this._filesAdded.delete(filename); this._projectVersion++; - filename = normalize(filename); delete this._fileNameToDeclaredModule[filename]; return delete this._snapshots[filename]; } diff --git a/build/lib/tsb/builder.ts b/build/lib/tsb/builder.ts index 509284d0cdcbc..53e9f597e514a 100644 --- a/build/lib/tsb/builder.ts +++ b/build/lib/tsb/builder.ts @@ -629,10 +629,11 @@ class LanguageServiceHost implements ts.LanguageServiceHost { } removeScriptSnapshot(filename: string): boolean { + filename = normalize(filename); + this._log('removeScriptSnapshot', filename); this._filesInProject.delete(filename); this._filesAdded.delete(filename); this._projectVersion++; - filename = normalize(filename); delete this._fileNameToDeclaredModule[filename]; return delete this._snapshots[filename]; } From fb0388deb63a88031ad4dd7ab7fe1ae362eeaece Mon Sep 17 00:00:00 2001 From: Aman Karmani Date: Tue, 7 Jan 2025 18:04:08 -0800 Subject: [PATCH 2/2] tsb: avoid processing css imports --- build/lib/tsb/builder.js | 3 +++ build/lib/tsb/builder.ts | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build/lib/tsb/builder.js b/build/lib/tsb/builder.js index c039131a57de6..9ecd9bdea5b66 100644 --- a/build/lib/tsb/builder.js +++ b/build/lib/tsb/builder.js @@ -586,6 +586,9 @@ class LanguageServiceHost { // node module? return; } + if (ref.fileName.endsWith('.css')) { + return; + } const stopDirname = normalize(this.getCurrentDirectory()); let dirname = filename; let found = false; diff --git a/build/lib/tsb/builder.ts b/build/lib/tsb/builder.ts index 53e9f597e514a..e60a2ecfad8d2 100644 --- a/build/lib/tsb/builder.ts +++ b/build/lib/tsb/builder.ts @@ -706,7 +706,9 @@ class LanguageServiceHost implements ts.LanguageServiceHost { // node module? return; } - + if (ref.fileName.endsWith('.css')) { + return; + } const stopDirname = normalize(this.getCurrentDirectory()); let dirname = filename;