Skip to content

Commit dd2164a

Browse files
committed
Some logging for debugging further
1 parent 88e62d2 commit dd2164a

File tree

208 files changed

+3422
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+3422
-2
lines changed

src/compiler/sys.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -1120,10 +1120,15 @@ namespace ts {
11201120
recursive,
11211121
inodeWatching ?
11221122
callbackChangingToMissingFileSystemEntry :
1123-
callback
1123+
(eventName, relativeFileName) => {
1124+
1125+
sysLog(`sysLog:: watchPresentFileSystemEntry:: ${fileOrDirectory} ${entryKind} ${eventName}:: ${relativeFileName}`);
1126+
callback(eventName, relativeFileName);
1127+
}
11241128
);
11251129
// Watch the missing file or directory or error
11261130
presentWatcher.on("error", () => {
1131+
sysLog(`sysLog:: watchPresentFileSystemEntry:: on Error ${fileOrDirectory} ${entryKind} rename, ""`);
11271132
callback("rename", "");
11281133
updateWatcher(watchMissingFileSystemEntry);
11291134
});
@@ -1140,6 +1145,7 @@ namespace ts {
11401145
}
11411146

11421147
function callbackChangingToMissingFileSystemEntry(event: "rename" | "change", relativeName: string | undefined) {
1148+
sysLog(`sysLog:: callbackChangingToMissingFileSystemEntry:: ${fileOrDirectory} ${entryKind} ${event}:: ${relativeName} ${inodeWatching} ${lastDirectoryPart} ${lastDirectoryPartWithDirectorySeparator}`);
11431149
callback(event, relativeName);
11441150
// because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
11451151
// Eg on ubuntu while watching app/node_modules the relativeName is "node_modules" which is neither relative nor full path
@@ -1163,7 +1169,10 @@ namespace ts {
11631169
function watchPresentFileSystemEntryWithFsWatchFile(): FileWatcher {
11641170
return watchFile(
11651171
fileOrDirectory,
1166-
createFileWatcherCallback(callback),
1172+
createFileWatcherCallback((eventName, relativeFileName) => {
1173+
sysLog(`sysLog:: watchPresentFileSystemEntryWithFsWatchFile:: ${fileOrDirectory} ${entryKind} ${eventName}:: ${relativeFileName}`);
1174+
callback(eventName, relativeFileName);
1175+
}),
11671176
fallbackPollingInterval,
11681177
fallbackOptions
11691178
);
@@ -1177,7 +1186,9 @@ namespace ts {
11771186
return watchFile(
11781187
fileOrDirectory,
11791188
(_fileName, eventKind) => {
1189+
sysLog(`sysLog:: watchMissingFileSystemEntry:: ${fileOrDirectory} ${entryKind} ${_fileName}:: ${eventKind}`);
11801190
if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
1191+
sysLog(`sysLog:: watchMissingFileSystemEntry:: Callback :: rename, "" and will update the watcher`);
11811192
callback("rename", "");
11821193
// Call the callback for current file or directory
11831194
// For now it could be callback for the inner directory creation,

tests/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js

+2
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ export function lastElementOf<T>(arr: T[]): T | undefined {
433433

434434

435435
Output::
436+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/demo/core 1 change:: utilities.ts
437+
436438
>> Screen clear
437439
[12:01:07 AM] File change detected. Starting incremental compilation...
438440

tests/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js

+2
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ Input::
216216

217217

218218
Output::
219+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/demo/core 1 change:: tsconfig.json
220+
219221
>> Screen clear
220222
[12:00:52 AM] File change detected. Starting incremental compilation...
221223

tests/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js

+5
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ Input::
278278

279279

280280
Output::
281+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: package.json
282+
281283
>> Screen clear
282284
[12:01:17 AM] File change detected. Starting incremental compilation...
283285

@@ -370,6 +372,8 @@ Input::
370372

371373

372374
Output::
375+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: package.json
376+
373377
>> Screen clear
374378
[12:01:24 AM] File change detected. Starting incremental compilation...
375379

@@ -414,6 +418,7 @@ File '/user/username/projects/myproject/packages/pkg2/build/const.ts' does not e
414418
File '/user/username/projects/myproject/packages/pkg2/build/const.tsx' does not exist.
415419
File '/user/username/projects/myproject/packages/pkg2/build/const.d.ts' exist - use it as a name resolution result.
416420
======== Module name './const.js' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.ts'. ========
421+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: build/index.js
417422
[12:01:30 AM] Found 0 errors. Watching for file changes.
418423

419424

tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js

+21
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ Input::
269269

270270

271271
Output::
272+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: package.json
273+
272274
>> Screen clear
273275
[12:01:11 AM] File change detected. Starting incremental compilation...
274276

@@ -389,6 +391,8 @@ Input::
389391

390392

391393
Output::
394+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: package.json
395+
392396
>> Screen clear
393397
[12:01:18 AM] File change detected. Starting incremental compilation...
394398

@@ -432,6 +436,7 @@ File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist -
432436
File '/a/lib/package.json' does not exist.
433437
File '/a/package.json' does not exist.
434438
File '/package.json' does not exist.
439+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: build/index.js
435440
[12:01:24 AM] Found 0 errors. Watching for file changes.
436441

437442

@@ -499,6 +504,8 @@ Input::
499504

500505

501506
Output::
507+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: package.json
508+
502509
>> Screen clear
503510
[12:01:28 AM] File change detected. Starting incremental compilation...
504511

@@ -623,6 +630,12 @@ export type { TheNum } from './const.cjs';
623630
//// [/user/username/projects/myproject/packages/pkg2/index.ts] deleted
624631

625632
Output::
633+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: package.json
634+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 rename:: index.ts
635+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change::
636+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 rename:: index.cts
637+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change::
638+
626639
>> Screen clear
627640
[12:01:39 AM] File change detected. Starting incremental compilation...
628641

@@ -642,8 +655,16 @@ File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it
642655
File '/a/lib/package.json' does not exist.
643656
File '/a/package.json' does not exist.
644657
File '/package.json' does not exist.
658+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 rename:: build/index.cjs
659+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build
660+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 rename:: build/index.d.cts
661+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build
662+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build/tsconfig.tsbuildinfo
645663
[12:01:50 AM] Updating unchanged output timestamps of project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'...
646664

665+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build/const.cjs
666+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build/const.d.cts
667+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build/tsconfig.tsbuildinfo.readable.baseline.txt
647668

648669

649670
Program root files: ["/user/username/projects/myproject/packages/pkg2/const.cts","/user/username/projects/myproject/packages/pkg2/index.cts"]

tests/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js

+6
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ Input::
129129
//// [/user/username/projects/myproject/a.js] file written with same contents
130130

131131
Output::
132+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: a.js
133+
132134
>> Screen clear
133135
[12:00:35 AM] File change detected. Starting incremental compilation...
134136

@@ -177,13 +179,17 @@ const x = 10;
177179

178180

179181
Output::
182+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: a.js
183+
180184
>> Screen clear
181185
[12:00:42 AM] File change detected. Starting incremental compilation...
182186

183187
[12:00:43 AM] Project 'tsconfig.json' is out of date because output file 'b.js' does not exist
184188

185189
[12:00:44 AM] Building project '/user/username/projects/myproject/tsconfig.json'...
186190

191+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: tsconfig.tsbuildinfo
192+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: tsconfig.tsbuildinfo.readable.baseline.txt
187193
[12:00:51 AM] Found 0 errors. Watching for file changes.
188194

189195

tests/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ Input::
8181
//// [/user/username/projects/myproject/a.js] file written with same contents
8282

8383
Output::
84+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: a.js
85+
8486
>> Screen clear
8587
[12:00:31 AM] File change detected. Starting incremental compilation...
8688

@@ -129,6 +131,8 @@ const x = 10;
129131

130132

131133
Output::
134+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: a.js
135+
132136
>> Screen clear
133137
[12:00:38 AM] File change detected. Starting incremental compilation...
134138

tests/baselines/reference/tsbuildWatch/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js

+41
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ Input::
9898
//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents
9999

100100
Output::
101+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
102+
101103
>> Screen clear
102104
[12:00:39 AM] File change detected. Starting incremental compilation...
103105

@@ -157,13 +159,33 @@ const a = {
157159

158160

159161
Output::
162+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
163+
160164
>> Screen clear
161165
[12:00:46 AM] File change detected. Starting incremental compilation...
162166

163167
[12:00:47 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist
164168

165169
[12:00:48 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'...
166170

171+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build
172+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change::
173+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/shared
174+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build
175+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/shared/types
176+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/shared
177+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/shared/types/db.js
178+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/shared/types
179+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/src
180+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build
181+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/src/main.js
182+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src
183+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/src/other.js
184+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src
185+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/tsconfig.tsbuildinfo
186+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build
187+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/tsconfig.tsbuildinfo.readable.baseline.txt
188+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build
167189
[12:01:09 AM] Found 0 errors. Watching for file changes.
168190

169191

@@ -293,6 +315,8 @@ const a: string = 10;
293315

294316

295317
Output::
318+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
319+
296320
>> Screen clear
297321
[12:01:13 AM] File change detected. Starting incremental compilation...
298322

@@ -305,6 +329,8 @@ Output::
305329
2 const a: string = 10;
306330
   ~
307331

332+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo
333+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo.readable.baseline.txt
308334
[12:01:22 AM] Found 1 error. Watching for file changes.
309335

310336

@@ -424,6 +450,8 @@ Input::
424450
//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents
425451

426452
Output::
453+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
454+
427455
>> Screen clear
428456
[12:01:27 AM] File change detected. Starting incremental compilation...
429457

@@ -481,15 +509,22 @@ const a: string = "hello";
481509

482510

483511
Output::
512+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
513+
484514
>> Screen clear
485515
[12:01:34 AM] File change detected. Starting incremental compilation...
486516

487517
[12:01:35 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts'
488518

489519
[12:01:36 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'...
490520

521+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src/main.js
522+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo
491523
[12:01:44 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'...
492524

525+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/shared/types/db.js
526+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src/other.js
527+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo.readable.baseline.txt
493528
[12:01:48 AM] Found 0 errors. Watching for file changes.
494529

495530

@@ -599,6 +634,8 @@ Input::
599634
//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents
600635

601636
Output::
637+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
638+
602639
>> Screen clear
603640
[12:01:52 AM] File change detected. Starting incremental compilation...
604641

@@ -608,6 +645,10 @@ Output::
608645

609646
[12:01:56 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'...
610647

648+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/shared/types/db.js
649+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src/main.js
650+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src/other.js
651+
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo
611652
[12:01:57 AM] Found 0 errors. Watching for file changes.
612653

613654

0 commit comments

Comments
 (0)