From f2f91ccc64c862b077a7d5e7a5f9fadbb8cf0692 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 25 Jun 2024 10:19:01 -0700 Subject: [PATCH] Make canUseWatchEvents test framework more generic so we can add more tests easily (#58962) --- src/testRunner/unittests/helpers/tsserver.ts | 136 ++++ .../helpers/virtualFileSystemWithWatch.ts | 6 + .../unittests/tsserver/events/watchEvents.ts | 449 ++---------- .../canUseWatchEvents-on-windows.js | 687 +++++++++--------- .../canUseWatchEvents-without-canUseEvents.js | 583 +++++++++++++-- .../events/watchEvents/canUseWatchEvents.js | 651 +++++++++-------- 6 files changed, 1435 insertions(+), 1077 deletions(-) diff --git a/src/testRunner/unittests/helpers/tsserver.ts b/src/testRunner/unittests/helpers/tsserver.ts index 7f086e11e943e..55ce8a1891b70 100644 --- a/src/testRunner/unittests/helpers/tsserver.ts +++ b/src/testRunner/unittests/helpers/tsserver.ts @@ -1,3 +1,4 @@ +import path from "path"; import { incrementalVerifier } from "../../../harness/incrementalUtils.js"; import { patchServiceForStateBaseline } from "../../../harness/projectServiceStateLogger.js"; import { @@ -67,6 +68,130 @@ export function patchHostTimeouts( } } +function patchSessionToHandleWatchEvents(session: TestSession) { + const event = session.event; + const idToClose = new Map void>(); + session.event = (data, eventName) => { + event.call(session, data, eventName); + switch (eventName) { + case ts.server.CreateFileWatcherEvent: + watchFile(data as ts.server.protocol.CreateFileWatcherEventBody); + break; + case ts.server.CreateDirectoryWatcherEvent: + watchDirectory(data as ts.server.protocol.CreateDirectoryWatcherEventBody); + break; + case ts.server.CloseFileWatcherEvent: + closeWatcher(data as ts.server.protocol.CloseFileWatcherEventBody); + break; + default: + break; + } + }; + + function watchFile(event: ts.server.protocol.CreateFileWatcherEventBody) { + createWatcher( + "watchFile", + event, + recordChange => + session.host.watchUtils.pollingWatch( + session.host.toNormalizedAbsolutePath(event.path), + { + cb: (fileName, eventKind) => + recordChange( + event.id, + session.host.windowsStyleRoot ? + path.win32.resolve(fileName) : + path.posix.resolve(fileName), + eventKind === ts.FileWatcherEventKind.Created ? + "created" : + eventKind === ts.FileWatcherEventKind.Deleted ? "deleted" : "updated", + /*ignoreUpdate*/ false, + ), + pollingInterval: undefined!, + event, + }, + ), + ); + } + + function watchDirectory(event: ts.server.protocol.CreateDirectoryWatcherEventBody) { + createWatcher( + "watchDirectory", + event, + recordChange => + session.host.watchUtils.fsWatch( + session.host.toNormalizedAbsolutePath(event.path), + event.recursive, + { + cb: (eventName, relativeFileName) => { + if (!relativeFileName) return; + const fileName = session.host.windowsStyleRoot ? + path.win32.join(event.path, relativeFileName) : + path.posix.join(event.path, relativeFileName); + if (eventName === "change") { + recordChange( + event.id, + fileName, + "updated", + !!event.ignoreUpdate, + ); + } + else { + recordChange( + event.id, + fileName, + session.host.fileExists(fileName) || session.host.directoryExists(fileName) ? + "created" : + "deleted", + !!event.ignoreUpdate, + ); + } + }, + inode: undefined, + event, + }, + ), + ); + } + + function createWatcher( + watchType: string, + event: ts.server.protocol.CreateFileWatcherEventBody | ts.server.protocol.CreateDirectoryWatcherEventBody, + create: ( + recordChange: ( + id: number, + file: string, + eventType: "created" | "deleted" | "updated", + ignoreUpdate: boolean, + ) => void, + ) => ts.FileWatcher, + ) { + session.logger.log(`Custom ${watchType}:: Added:: ${JSON.stringify(event)}`); + ts.Debug.assert(!idToClose.has(event.id)); + const result = create((id, file, eventType, ignoreUpdate) => { + const ignored = eventType === "updated" && ignoreUpdate; + session.logger.log(`Custom ${watchType}:: Triggered${ignoreUpdate ? " Ignored" : ""}:: ${JSON.stringify(event)}:: ${file} ${eventType}`); + if (!ignored) { + let watchChange = session.watchChanges.get(id); + if (!watchChange) session.watchChanges.set(id, watchChange = { id }); + (watchChange[eventType] ??= []).push(file); + } + }); + idToClose.set(event.id, () => { + session.logger.log(`Custom ${watchType}:: Close:: ${JSON.stringify(event)}`); + result.close(); + }); + } + + function closeWatcher(data: ts.server.protocol.CloseFileWatcherEventBody) { + const close = idToClose.get(data.id); + if (close) { + idToClose.delete(data.id); + close(); + } + } +} + export interface TestSessionOptions extends ts.server.SessionOptions, TestTypingsInstallerOptions { host: TestServerHost; logger: LoggerWithInMemoryLogs; @@ -90,6 +215,7 @@ export class TestSession extends ts.server.Session { public override logger!: LoggerWithInMemoryLogs; public override readonly typingsInstaller!: TestTypingsInstallerAdapter; public serverCancellationToken: TestServerCancellationToken; + public watchChanges = new Map(); constructor(optsOrHost: TestSessionConstructorOptions) { const opts = getTestSessionPartialOptionsAndHost(optsOrHost); @@ -125,6 +251,7 @@ export class TestSession extends ts.server.Session { if (opts.regionDiagLineCountThreshold !== undefined) { this.regionDiagLineCountThreshold = opts.regionDiagLineCountThreshold; } + if (opts.canUseWatchEvents) patchSessionToHandleWatchEvents(this); } getProjectService() { @@ -159,6 +286,15 @@ export class TestSession extends ts.server.Session { request.type = "request"; return this.executeCommand(request); } + + public invokeWatchChanges() { + const changes = ts.singleOrMany(ts.arrayFrom(this.watchChanges.values())); + this.watchChanges.clear(); + this.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.WatchChange, + arguments: changes, + }); + } } export function createSessionWithCustomEventHandler( diff --git a/src/testRunner/unittests/helpers/virtualFileSystemWithWatch.ts b/src/testRunner/unittests/helpers/virtualFileSystemWithWatch.ts index ab487a77abdd3..fed29682e93fa 100644 --- a/src/testRunner/unittests/helpers/virtualFileSystemWithWatch.ts +++ b/src/testRunner/unittests/helpers/virtualFileSystemWithWatch.ts @@ -3,6 +3,10 @@ import { Watches, WatchUtils, } from "../../../harness/watchUtils.js"; +import { + CreateDirectoryWatcherEventBody, + CreateFileWatcherEventBody, +} from "../../../server/protocol.js"; import { append, arrayFrom, @@ -276,11 +280,13 @@ type TimeOutCallback = (...args: any[]) => void; export interface TestFileWatcher { cb: FileWatcherCallback; pollingInterval: PollingInterval; + event?: CreateFileWatcherEventBody; } export interface TestFsWatcher { cb: FsWatchCallback; inode: number | undefined; + event?: CreateDirectoryWatcherEventBody; } export interface WatchInvokeOptions { diff --git a/src/testRunner/unittests/tsserver/events/watchEvents.ts b/src/testRunner/unittests/tsserver/events/watchEvents.ts index 8093406908c50..74ae790d3d7f0 100644 --- a/src/testRunner/unittests/tsserver/events/watchEvents.ts +++ b/src/testRunner/unittests/tsserver/events/watchEvents.ts @@ -1,403 +1,80 @@ -import { - createLoggerWithInMemoryLogs, - LoggerWithInMemoryLogs, -} from "../../../../harness/tsserverLogger.js"; -import { - createWatchUtils, - Watches, - WatchUtils, -} from "../../../../harness/watchUtils.js"; -import * as ts from "../../../_namespaces/ts.js"; import { baselineTsserverLogs, closeFilesForSession, - createSessionWithCustomEventHandler, openFilesForSession, TestSession, } from "../../helpers/tsserver.js"; import { createServerHost, libFile, - TestServerHost, } from "../../helpers/virtualFileSystemWithWatch.js"; describe("unittests:: tsserver:: events:: watchEvents", () => { - interface TestServerHostWithCustomWatch extends TestServerHost { - factoryData: { - watchUtils: WatchUtils; - watchFile(data: ts.server.protocol.CreateFileWatcherEventBody): void; - watchDirectory(data: ts.server.protocol.CreateDirectoryWatcherEventBody): void; - closeWatcher(data: ts.server.protocol.CloseFileWatcherEventBody): void; - }; - } - - function createTestServerHostWithCustomWatch( - logger: LoggerWithInMemoryLogs, + function verifyCanUseWatchEvents( + canUseEvents: boolean, + projectPath: string, + directorySeparator: string, + windowsStyleRoot?: string, ) { - const idToClose = new Map void>(); - const host = logger.host as TestServerHostWithCustomWatch; - const originalSerializeWatches = host.serializeWatches; - host.serializeWatches = serializeWatches; - host.factoryData = { - watchUtils: createWatchUtils( - "Custom WatchedFiles", - "Custom WatchedDirectories", - host.getCanonicalFileName, - host, - ), - watchFile, - watchDirectory, - closeWatcher, - }; - return host; - - function watchFile(data: ts.server.protocol.CreateFileWatcherEventBody) { - logger.log(`Custom watchFile: ${data.id}: ${data.path}`); - ts.Debug.assert(!idToClose.has(data.id)); - const result = host.factoryData.watchUtils.pollingWatch(data.path, data); - idToClose.set(data.id, () => { - logger.log(`Custom watchFile:: Close:: ${data.id}: ${data.path}`); - result.close(); - }); - } - - function watchDirectory(data: ts.server.protocol.CreateDirectoryWatcherEventBody) { - logger.log(`Custom watchDirectory: ${data.id}: ${data.path} ${data.recursive} ${data.ignoreUpdate}`); - ts.Debug.assert(!idToClose.has(data.id)); - const result = host.factoryData.watchUtils.fsWatch(data.path, data.recursive, data); - idToClose.set(data.id, () => { - logger.log(`Custom watchDirectory:: Close:: ${data.id}: ${data.path} ${data.recursive} ${data.ignoreUpdate}`); - result.close(); - }); - } - - function closeWatcher(data: ts.server.protocol.CloseFileWatcherEventBody) { - const close = idToClose.get(data.id); - if (close) { - idToClose.delete(data.id); - close(); - } - } - - function serializeWatches(baseline: string[] = []) { - if (host.factoryData.watchUtils.getHasWatchChanges()) host.watchUtils.setHasWatchChanges(); - const hasWatchChanges = host.watchUtils.getHasWatchChanges(); - originalSerializeWatches.call(host, baseline); - if (hasWatchChanges) { - host.factoryData.watchUtils.setHasWatchChanges(); - host.factoryData.watchUtils.serializeWatches(baseline); - } - return baseline; - } - } - - function updateFileOnHost(session: TestSession, file: string, log: string, content?: string) { - // Change b.ts - session.logger.log(`${log}: ${file}`); - if (content && session.host.fileExists(file)) session.host.appendFile(file, content); - else session.host.writeFile(file, content ?? session.host.readFile("/user/username/projects/myproject/a.ts")!); - session.host.runQueuedTimeoutCallbacks(); - } - - function collectWatchChanges( - session: TestSession, - watches: Watches, - path: string, - eventPath: string, - eventType: "created" | "deleted" | "updated", - ignoreUpdate?: (data: T) => boolean, - ) { - session.logger.log(`Custom watch:: ${path} ${eventPath} ${eventType}`); - let result: ts.server.protocol.WatchChangeRequestArgs[] | undefined; - watches.forEach( - path, - data => { - if (ignoreUpdate?.(data)) return; - switch (eventType) { - case "created": - (result ??= []).push({ id: data.id, created: [eventPath] }); - break; - case "deleted": - (result ??= []).push({ id: data.id, deleted: [eventPath] }); - break; - case "updated": - (result ??= []).push({ id: data.id, updated: [eventPath] }); - break; - default: - ts.Debug.assertNever(eventType); - } - }, - ); - return result; - } - - function collectDirectoryWatcherChanges( - session: TestSession, - dir: string, - eventPath: string, - eventType: "created" | "deleted" | "updated", - ) { - return collectWatchChanges( - session, - (session.logger.host as TestServerHostWithCustomWatch).factoryData.watchUtils.fsWatchesRecursive, - dir, - eventPath, - eventType, - data => !!data.ignoreUpdate && eventType === "updated", - ); - } - - function collectFileWatcherChanges( - session: TestSession, - file: string, - eventType: "created" | "deleted" | "updated", - eventPath?: string, - ) { - return collectWatchChanges( - session, - (session.logger.host as TestServerHostWithCustomWatch).factoryData.watchUtils.pollingWatches, - file, - eventPath ?? file, - eventType, - ); - } - - function invokeWatchChange( - session: TestSession, - ...args: (ts.server.protocol.WatchChangeRequestArgs[] | undefined)[] - ) { - let result: Map | undefined; - args.forEach(arg => - arg?.forEach(value => { - result ??= new Map(); - const valueInResult = result.get(value.id); - if (!valueInResult) result.set(value.id, value); - else { - valueInResult.created = ts.combine(valueInResult.created, value.created); - valueInResult.deleted = ts.combine(valueInResult.deleted, value.deleted); - valueInResult.updated = ts.combine(valueInResult.updated, value.updated); - } - }) - ); - if (result) { - session.executeCommandSeq({ - command: ts.server.protocol.CommandTypes.WatchChange, - arguments: ts.singleOrMany(ts.arrayFrom(result.values())), - }); - } - } - - function addFile(session: TestSession, path: string, content?: string, eventPath?: string) { - updateFileOnHost(session, path, "Add file", content); - invokeWatchChange( - session, - collectDirectoryWatcherChanges(session, ts.getDirectoryPath(path), eventPath ?? path, "created"), - ); - session.host.runQueuedTimeoutCallbacks(); - } - - function changeFile(session: TestSession, path: string, content?: string, eventPath?: string) { - updateFileOnHost(session, path, "Change File", content); - invokeWatchChange( - session, - collectFileWatcherChanges(session, path, "updated", eventPath), - collectDirectoryWatcherChanges(session, ts.getDirectoryPath(path), eventPath ?? path, "updated"), - ); - session.host.runQueuedTimeoutCallbacks(); - } - - function npmInstall(session: TestSession) { - session.logger.log("update with npm install"); - session.host.appendFile("/user/username/projects/myproject/node_modules/something/index.d.ts", `export const y = 20;`); - session.host.runQueuedTimeoutCallbacks(); - invokeWatchChange( - session, - collectDirectoryWatcherChanges( - session, - "/user/username/projects/myproject/node_modules", - "/user/username/projects/myproject/node_modules/something/index.d.ts", - "updated", - ), - ); - session.host.runQueuedTimeoutCallbacks(); - } - - function setup() { - const inputHost = createServerHost({ - "/user/username/projects/myproject/tsconfig.json": "{}", - "/user/username/projects/myproject/a.ts": `export class a { prop = "hello"; foo() { return this.prop; } }`, - "/user/username/projects/myproject/b.ts": `export class b { prop = "hello"; foo() { return this.prop; } }`, - "/user/username/projects/myproject/m.ts": `import { x } from "something"`, - "/user/username/projects/myproject/node_modules/something/index.d.ts": `export const x = 10;`, - [libFile.path]: libFile.content, + it(canUseEvents ? windowsStyleRoot ? "canUseWatchEvents on windows" : "canUseWatchEvents" : "canUseWatchEvents without canUseEvents", () => { + const host = createServerHost({ + [`${projectPath}${directorySeparator}tsconfig.json`]: "{}", + [`${projectPath}${directorySeparator}a.ts`]: `export class a { prop = "hello"; foo() { return this.prop; } }`, + [`${projectPath}${directorySeparator}b.ts`]: `export class b { prop = "hello"; foo() { return this.prop; } }`, + [`${projectPath}${directorySeparator}m.ts`]: `import { x } from "something"`, + [`${projectPath}${directorySeparator}node_modules${directorySeparator}something${directorySeparator}index.d.ts`]: `export const x = 10;`, + [libFile.path]: libFile.content, + }, { windowsStyleRoot }); + const session = new TestSession({ host, canUseWatchEvents: true, canUseEvents }); + if (!canUseEvents) session.logger.msg = (s, type) => session.logger.info(`${type}:: ${s}`); + openFilesForSession([`${projectPath}${directorySeparator}a.ts`], session); + + // Directory watcher + host.writeFile(`${projectPath}${directorySeparator}c.ts`, `export class a { prop = "hello"; foo() { return this.prop; } }`); + host.runQueuedTimeoutCallbacks(); + session.invokeWatchChanges(); + host.runQueuedTimeoutCallbacks(); + + // File Watcher + host.writeFile(`${projectPath}${directorySeparator}b.ts`, `export class a { prop = "hello"; foo() { return this.prop; } }`); + host.runQueuedTimeoutCallbacks(); + session.invokeWatchChanges(); + host.runQueuedTimeoutCallbacks(); + + // Close watcher + openFilesForSession([`${projectPath}${directorySeparator}b.ts`], session); + + // Re watch + closeFilesForSession([`${projectPath}${directorySeparator}b.ts`], session); + + // Update c.ts + host.appendFile(`${projectPath}${directorySeparator}c.ts`, `export const y = 20;`); + host.runQueuedTimeoutCallbacks(); + session.invokeWatchChanges(); + host.runQueuedTimeoutCallbacks(); + + // Add and change multiple files - combine and send multiple requests together + session.host.writeFile(`${projectPath}${directorySeparator}d.ts`, `export class a { prop = "hello"; foo() { return this.prop; } }`); + session.host.runQueuedTimeoutCallbacks(); + session.host.appendFile(`${projectPath}${directorySeparator}c.ts`, `export const z = 30;`); + session.host.runQueuedTimeoutCallbacks(); + session.host.writeFile(`${projectPath}${directorySeparator}e.ts`, `export class a { prop = "hello"; foo() { return this.prop; } }`); + session.host.runQueuedTimeoutCallbacks(); + session.invokeWatchChanges(); + host.runQueuedTimeoutCallbacks(); + + // Update with npm install + host.appendFile(`${projectPath}${directorySeparator}node_modules${directorySeparator}something${directorySeparator}index.d.ts`, `export const y = 20;`); + host.runQueuedTimeoutCallbacks(); + session.invokeWatchChanges(); + host.runQueuedTimeoutCallbacks(); + host.runQueuedTimeoutCallbacks(); + + baselineTsserverLogs("events/watchEvents", canUseEvents ? windowsStyleRoot ? "canUseWatchEvents on windows" : "canUseWatchEvents" : "canUseWatchEvents without canUseEvents", session); }); - const logger = createLoggerWithInMemoryLogs(inputHost); - const host = createTestServerHostWithCustomWatch(logger); - return { host, logger }; } - it("canUseWatchEvents", () => { - const { host, logger } = setup(); - const session = createSessionWithCustomEventHandler({ host, canUseWatchEvents: true, logger }, handleWatchEvents); - openFilesForSession(["/user/username/projects/myproject/a.ts"], session); - - // Directory watcher - addFile(session, "/user/username/projects/myproject/c.ts"); - - // File Watcher - changeFile(session, "/user/username/projects/myproject/b.ts"); - - // Close watcher - openFilesForSession(["/user/username/projects/myproject/b.ts"], session); - - // Re watch - closeFilesForSession(["/user/username/projects/myproject/b.ts"], session); - - // Update c.ts - changeFile(session, "/user/username/projects/myproject/c.ts", `export const y = 20;`); - - // Update with npm install - npmInstall(session); - host.runQueuedTimeoutCallbacks(); - - // Add and change multiple files - combine and send multiple requests together - updateFileOnHost(session, "/user/username/projects/myproject/d.ts", "Add file"); - updateFileOnHost(session, "/user/username/projects/myproject/c.ts", "Change File", `export const z = 30;`); - updateFileOnHost(session, "/user/username/projects/myproject/e.ts", "Add File"); - invokeWatchChange( - session, - collectDirectoryWatcherChanges(session, "/user/username/projects/myproject", "/user/username/projects/myproject/d.ts", "created"), - collectFileWatcherChanges(session, "/user/username/projects/myproject/c.ts", "updated"), - collectDirectoryWatcherChanges(session, "/user/username/projects/myproject", "/user/username/projects/myproject/c.ts", "updated"), - collectDirectoryWatcherChanges(session, "/user/username/projects/myproject", "/user/username/projects/myproject/e.ts", "created"), - ); - session.host.runQueuedTimeoutCallbacks(); - - baselineTsserverLogs("events/watchEvents", `canUseWatchEvents`, session); - function handleWatchEvents(event: ts.server.ProjectServiceEvent) { - switch (event.eventName) { - case ts.server.CreateFileWatcherEvent: - host.factoryData.watchFile(event.data); - break; - case ts.server.CreateDirectoryWatcherEvent: - host.factoryData.watchDirectory(event.data); - break; - case ts.server.CloseFileWatcherEvent: - host.factoryData.closeWatcher(event.data); - break; - default: - break; - } - } - }); - - it("canUseWatchEvents without canUseEvents", () => { - const { host, logger } = setup(); - const session = new TestSession({ host, canUseEvents: false, canUseWatchEvents: true, logger }); - openFilesForSession(["/user/username/projects/myproject/a.ts"], session); - - // Directory watcher - addFile(session, "/user/username/projects/myproject/c.ts"); - - // File Watcher - changeFile(session, "/user/username/projects/myproject/b.ts"); - - // Close watcher - openFilesForSession(["/user/username/projects/myproject/b.ts"], session); - - // Re watch - closeFilesForSession(["/user/username/projects/myproject/b.ts"], session); - - // Shouldnt have watch change request - logger.msg = (s, type) => logger.info(`${type}:: ${s}`); - session.executeCommandSeq({ - command: ts.server.protocol.CommandTypes.WatchChange, - arguments: { id: 1, updated: ["/user/username/projects/myproject/b.ts"] }, - }); - - // Update c.ts - changeFile(session, "/user/username/projects/myproject/c.ts", `export const y = 20;`); - - // Update with npm install - npmInstall(session); - - baselineTsserverLogs("events/watchEvents", `canUseWatchEvents without canUseEvents`, session); - }); - - it("canUseWatchEvents on windows", () => { - const inputHost = createServerHost({ - "c:\\projects\\myproject\\tsconfig.json": "{}", - "c:\\projects\\myproject\\a.ts": `export class a { prop = "hello"; foo() { return this.prop; } }`, - "c:\\projects\\myproject\\b.ts": `export class b { prop = "hello"; foo() { return this.prop; } }`, - "c:\\projects\\myproject\\m.ts": `import { x } from "something"`, - "c:\\projects\\myproject\\node_modules\\something\\index.d.ts": `export const x = 10;`, - [libFile.path]: libFile.content, - }, { windowsStyleRoot: "c:\\" }); - const logger = createLoggerWithInMemoryLogs(inputHost); - const host = createTestServerHostWithCustomWatch(logger); - - const session = createSessionWithCustomEventHandler({ host, canUseWatchEvents: true, logger }, handleWatchEvents); - openFilesForSession(["c:\\projects\\myproject\\a.ts"], session); - - // Directory watcher - addFile(session, "c:/projects/myproject/c.ts", `export xyx = 10;`, "c:\\projects\\myproject\\c.ts"); - - // File Watcher - changeFile(session, "c:/projects/myproject/b.ts", "export const ss = 20;", "c:\\projects\\myproject\\b.ts"); - - // Close watcher - openFilesForSession(["c:\\projects\\myproject\\b.ts"], session); - - // Re watch - closeFilesForSession(["c:\\projects\\myproject\\b.ts"], session); - - // Update c.ts - changeFile(session, "c:/projects/myproject/c.ts", "export const ss = 20;", "c:\\projects\\myproject\\b.ts"); - - // Update with npm install - session.logger.log("update with npm install"); - session.host.appendFile("c:\\projects\\myproject\\node_modules\\something\\index.d.ts", `export const y = 20;`); - session.host.runQueuedTimeoutCallbacks(); - invokeWatchChange( - session, - collectDirectoryWatcherChanges( - session, - "c:/projects/myproject/node_modules", - "c:\\projects\\myproject\\node_modules\\something\\index.d.ts", - "updated", - ), - ); - session.host.runQueuedTimeoutCallbacks(); - host.runQueuedTimeoutCallbacks(); - - // Add and change multiple files - combine and send multiple requests together - updateFileOnHost(session, "c:/projects/myproject/d.ts", "Add file", "export const yy = 10;"); - updateFileOnHost(session, "c:/projects/myproject/c.ts", "Change File", `export const z = 30;`); - updateFileOnHost(session, "c:/projects/myproject/e.ts", "Add File", "export const zz = 40;"); - invokeWatchChange( - session, - collectDirectoryWatcherChanges(session, "c:/projects/myproject", "c:\\projects\\myproject\\d.ts", "created"), - collectFileWatcherChanges(session, "c:/projects/myproject/c.ts", "updated", "c:\\projects\\myproject\\c.ts"), - collectDirectoryWatcherChanges(session, "c:/projects/myproject", "c:\\projects\\myproject\\c.ts", "updated"), - collectDirectoryWatcherChanges(session, "c:/projects/myproject", "c:\\projects\\myproject\\e.ts", "created"), - ); - session.host.runQueuedTimeoutCallbacks(); - - baselineTsserverLogs("events/watchEvents", `canUseWatchEvents on windows`, session); - function handleWatchEvents(event: ts.server.ProjectServiceEvent) { - switch (event.eventName) { - case ts.server.CreateFileWatcherEvent: - host.factoryData.watchFile(event.data); - break; - case ts.server.CreateDirectoryWatcherEvent: - host.factoryData.watchDirectory(event.data); - break; - case ts.server.CloseFileWatcherEvent: - host.factoryData.closeWatcher(event.data); - break; - default: - break; - } - } - }); + verifyCanUseWatchEvents(/*canUseEvents*/ true, "/user/username/projects/myproject", "/"); + verifyCanUseWatchEvents(/*canUseEvents*/ false, "/user/username/projects/myproject", "/"); + verifyCanUseWatchEvents(/*canUseEvents*/ true, "c:\\projects\\myproject", "\\", "c:\\"); }); diff --git a/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents-on-windows.js b/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents-on-windows.js index b6464373bbdd5..4419e7303d696 100644 --- a/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents-on-windows.js +++ b/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents-on-windows.js @@ -46,20 +46,20 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 1, "path": "c:/projects/myproject/tsconfig.json" } } -Custom watchFile: 1: c:/projects/myproject/tsconfig.json +Custom watchFile:: Added:: {"id":1,"path":"c:/projects/myproject/tsconfig.json"} Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectLoadingStart", + "event": "projectLoadingStart", "body": { - "project": "c:/projects/myproject/tsconfig.json", + "projectName": "c:/projects/myproject/tsconfig.json", "reason": "Creating possible configured project for c:/projects/myproject/a.ts to open" } } @@ -78,7 +78,7 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createDirectoryWatcher", + "event": "createDirectoryWatcher", "body": { "id": 2, "path": "c:/projects/myproject", @@ -86,59 +86,59 @@ Info seq [hh:mm:ss:mss] event: "ignoreUpdate": true } } -Custom watchDirectory: 2: c:/projects/myproject true true +Custom watchDirectory:: Added:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true} Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: c:/projects/myproject 1 undefined Config: c:/projects/myproject/tsconfig.json WatchType: Wild card directory Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: c:/projects/myproject/b.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 3, "path": "c:/projects/myproject/b.ts" } } -Custom watchFile: 3: c:/projects/myproject/b.ts +Custom watchFile:: Added:: {"id":3,"path":"c:/projects/myproject/b.ts"} Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: c:/projects/myproject/m.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 4, "path": "c:/projects/myproject/m.ts" } } -Custom watchFile: 4: c:/projects/myproject/m.ts +Custom watchFile:: Added:: {"id":4,"path":"c:/projects/myproject/m.ts"} Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: c:/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: c:/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createDirectoryWatcher", + "event": "createDirectoryWatcher", "body": { "id": 5, "path": "c:/projects/myproject/node_modules", "recursive": true } } -Custom watchDirectory: 5: c:/projects/myproject/node_modules true undefined +Custom watchDirectory:: Added:: {"id":5,"path":"c:/projects/myproject/node_modules","recursive":true} Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: c:/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: c:/a/lib/lib.d.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 6, "path": "c:/a/lib/lib.d.ts" } } -Custom watchFile: 6: c:/a/lib/lib.d.ts +Custom watchFile:: Added:: {"id":6,"path":"c:/a/lib/lib.d.ts"} Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: c:/projects/myproject/node_modules 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: c:/projects/myproject/node_modules 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: c:/projects/myproject/node_modules/@types 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Type roots @@ -146,7 +146,7 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createDirectoryWatcher", + "event": "createDirectoryWatcher", "body": { "id": 7, "path": "c:/projects/myproject/node_modules/@types", @@ -154,14 +154,14 @@ Info seq [hh:mm:ss:mss] event: "ignoreUpdate": true } } -Custom watchDirectory: 7: c:/projects/myproject/node_modules/@types true true +Custom watchDirectory:: Added:: {"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: c:/projects/myproject/node_modules/@types 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: c:/projects/node_modules/@types 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createDirectoryWatcher", + "event": "createDirectoryWatcher", "body": { "id": 8, "path": "c:/projects/node_modules/@types", @@ -169,7 +169,7 @@ Info seq [hh:mm:ss:mss] event: "ignoreUpdate": true } } -Custom watchDirectory: 8: c:/projects/node_modules/@types true true +Custom watchDirectory:: Added:: {"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: c:/projects/node_modules/@types 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: c:/projects/myproject/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) @@ -197,58 +197,61 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectLoadingFinish", + "event": "projectLoadingFinish", "body": { - "project": "c:/projects/myproject/tsconfig.json" + "projectName": "c:/projects/myproject/tsconfig.json" } } Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectInfo", + "event": "telemetry", "body": { - "projectId": "97f177d0a126eace4239f1be3ea802bded2784e559d112a10ed01c6617b1a28f", - "fileStats": { - "js": 0, - "jsSize": 0, - "jsx": 0, - "jsxSize": 0, - "ts": 3, - "tsSize": 153, - "tsx": 0, - "tsxSize": 0, - "dts": 2, - "dtsSize": 354, - "deferred": 0, - "deferredSize": 0 - }, - "compilerOptions": {}, - "typeAcquisition": { - "enable": false, + "telemetryEventName": "projectInfo", + "payload": { + "projectId": "97f177d0a126eace4239f1be3ea802bded2784e559d112a10ed01c6617b1a28f", + "fileStats": { + "js": 0, + "jsSize": 0, + "jsx": 0, + "jsxSize": 0, + "ts": 3, + "tsSize": 153, + "tsx": 0, + "tsxSize": 0, + "dts": 2, + "dtsSize": 354, + "deferred": 0, + "deferredSize": 0 + }, + "compilerOptions": {}, + "typeAcquisition": { + "enable": false, + "include": false, + "exclude": false + }, + "extends": false, + "files": false, "include": false, - "exclude": false - }, - "extends": false, - "files": false, - "include": false, - "exclude": false, - "compileOnSave": false, - "configFileName": "tsconfig.json", - "projectType": "configured", - "languageServiceEnabled": true, - "version": "FakeVersion" + "exclude": false, + "compileOnSave": false, + "configFileName": "tsconfig.json", + "projectType": "configured", + "languageServiceEnabled": true, + "version": "FakeVersion" + } } } Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::configFileDiag", + "event": "configFileDiag", "body": { - "configFileName": "c:/projects/myproject/tsconfig.json", - "diagnostics": [], - "triggerFile": "c:/projects/myproject/a.ts" + "triggerFile": "c:/projects/myproject/a.ts", + "configFile": "c:/projects/myproject/tsconfig.json", + "diagnostics": [] } } Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) @@ -271,25 +274,25 @@ Info seq [hh:mm:ss:mss] response: } After request -Custom WatchedFiles:: +PolledWatches:: c:/a/lib/lib.d.ts: *new* - {"id":6,"path":"c:/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"c:/a/lib/lib.d.ts"}} c:/projects/myproject/b.ts: *new* - {"id":3,"path":"c:/projects/myproject/b.ts"} + {"event":{"id":3,"path":"c:/projects/myproject/b.ts"}} c:/projects/myproject/m.ts: *new* - {"id":4,"path":"c:/projects/myproject/m.ts"} + {"event":{"id":4,"path":"c:/projects/myproject/m.ts"}} c:/projects/myproject/tsconfig.json: *new* - {"id":1,"path":"c:/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"c:/projects/myproject/tsconfig.json"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: c:/projects/myproject: *new* - {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}} c:/projects/myproject/node_modules: *new* - {"id":5,"path":"c:/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"c:/projects/myproject/node_modules","recursive":true}} c:/projects/myproject/node_modules/@types: *new* - {"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} c:/projects/node_modules/@types: *new* - {"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} Projects:: c:/projects/myproject/tsconfig.json (Configured) *new* @@ -318,15 +321,15 @@ c:/projects/myproject/node_modules/something/index.d.ts *new* containingProjects: 1 c:/projects/myproject/tsconfig.json -Add file: c:/projects/myproject/c.ts +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\c.ts created +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\c.ts updated Before running Timeout callback:: count: 0 //// [c:/projects/myproject/c.ts] -export xyx = 10; +export class a { prop = "hello"; foo() { return this.prop; } } After running Timeout callback:: count: 0 -Custom watch:: c:/projects/myproject c:\projects\myproject\c.ts created Before request Info seq [hh:mm:ss:mss] request: @@ -367,13 +370,13 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 9, "path": "c:/projects/myproject/c.ts" } } -Custom watchFile: 9: c:/projects/myproject/c.ts +Custom watchFile:: Added:: {"id":9,"path":"c:/projects/myproject/c.ts"} Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: c:/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: c:/projects/myproject/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) @@ -383,7 +386,7 @@ Info seq [hh:mm:ss:mss] Files (6) c:/projects/myproject/b.ts Text-1 "export class b { prop = \"hello\"; foo() { return this.prop; } }" c:/projects/myproject/node_modules/something/index.d.ts Text-1 "export const x = 10;" c:/projects/myproject/m.ts Text-1 "import { x } from \"something\"" - c:/projects/myproject/c.ts Text-1 "export xyx = 10;" + c:/projects/myproject/c.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" ../../a/lib/lib.d.ts @@ -417,11 +420,12 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: c:/projects/myproject/a.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: c:/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background c:/projects/myproject/a.ts Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", + "event": "projectsUpdatedInBackground", "body": { "openFiles": [ "c:/projects/myproject/a.ts" @@ -430,27 +434,27 @@ Info seq [hh:mm:ss:mss] event: } After running Timeout callback:: count: 0 -Custom WatchedFiles:: +PolledWatches:: c:/a/lib/lib.d.ts: - {"id":6,"path":"c:/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"c:/a/lib/lib.d.ts"}} c:/projects/myproject/b.ts: - {"id":3,"path":"c:/projects/myproject/b.ts"} + {"event":{"id":3,"path":"c:/projects/myproject/b.ts"}} c:/projects/myproject/c.ts: *new* - {"id":9,"path":"c:/projects/myproject/c.ts"} + {"event":{"id":9,"path":"c:/projects/myproject/c.ts"}} c:/projects/myproject/m.ts: - {"id":4,"path":"c:/projects/myproject/m.ts"} + {"event":{"id":4,"path":"c:/projects/myproject/m.ts"}} c:/projects/myproject/tsconfig.json: - {"id":1,"path":"c:/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"c:/projects/myproject/tsconfig.json"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: c:/projects/myproject: - {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}} c:/projects/myproject/node_modules: - {"id":5,"path":"c:/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"c:/projects/myproject/node_modules","recursive":true}} c:/projects/myproject/node_modules/@types: - {"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} c:/projects/node_modules/@types: - {"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} Projects:: c:/projects/myproject/tsconfig.json (Configured) *changed* @@ -484,16 +488,15 @@ c:/projects/myproject/node_modules/something/index.d.ts containingProjects: 1 c:/projects/myproject/tsconfig.json -Change File: c:/projects/myproject/b.ts +Custom watchFile:: Triggered:: {"id":3,"path":"c:/projects/myproject/b.ts"}:: c:\projects\myproject\b.ts updated +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\b.ts updated Before running Timeout callback:: count: 0 //// [c:/projects/myproject/b.ts] -export class b { prop = "hello"; foo() { return this.prop; } }export const ss = 20; +export class a { prop = "hello"; foo() { return this.prop; } } After running Timeout callback:: count: 0 -Custom watch:: c:/projects/myproject/b.ts c:\projects\myproject\b.ts updated -Custom watch:: c:/projects/myproject c:\projects\myproject\b.ts updated Before request Info seq [hh:mm:ss:mss] request: @@ -562,10 +565,10 @@ Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configur Info seq [hh:mm:ss:mss] Files (6) c:/a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" c:/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" - c:/projects/myproject/b.ts Text-2 "export class b { prop = \"hello\"; foo() { return this.prop; } }export const ss = 20;" + c:/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" c:/projects/myproject/node_modules/something/index.d.ts Text-1 "export const x = 10;" c:/projects/myproject/m.ts Text-1 "import { x } from \"something\"" - c:/projects/myproject/c.ts Text-1 "export xyx = 10;" + c:/projects/myproject/c.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* @@ -585,11 +588,12 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: c:/projects/myproject/a.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: c:/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background c:/projects/myproject/a.ts Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", + "event": "projectsUpdatedInBackground", "body": { "openFiles": [ "c:/projects/myproject/a.ts" @@ -647,12 +651,12 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::closeFileWatcher", + "event": "closeFileWatcher", "body": { "id": 3 } } -Custom watchFile:: Close:: 3: c:/projects/myproject/b.ts +Custom watchFile:: Close:: {"id":3,"path":"c:/projects/myproject/b.ts"} Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: c:/projects/myproject/b.ts ProjectRootPath: undefined:: Result: c:/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -673,29 +677,29 @@ Info seq [hh:mm:ss:mss] response: } After request -Custom WatchedFiles:: +PolledWatches:: c:/a/lib/lib.d.ts: - {"id":6,"path":"c:/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"c:/a/lib/lib.d.ts"}} c:/projects/myproject/c.ts: - {"id":9,"path":"c:/projects/myproject/c.ts"} + {"event":{"id":9,"path":"c:/projects/myproject/c.ts"}} c:/projects/myproject/m.ts: - {"id":4,"path":"c:/projects/myproject/m.ts"} + {"event":{"id":4,"path":"c:/projects/myproject/m.ts"}} c:/projects/myproject/tsconfig.json: - {"id":1,"path":"c:/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"c:/projects/myproject/tsconfig.json"}} -Custom WatchedFiles *deleted*:: +PolledWatches *deleted*:: c:/projects/myproject/b.ts: - {"id":3,"path":"c:/projects/myproject/b.ts"} + {"event":{"id":3,"path":"c:/projects/myproject/b.ts"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: c:/projects/myproject: - {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}} c:/projects/myproject/node_modules: - {"id":5,"path":"c:/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"c:/projects/myproject/node_modules","recursive":true}} c:/projects/myproject/node_modules/@types: - {"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} c:/projects/node_modules/@types: - {"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} ScriptInfos:: c:/a/lib/lib.d.ts @@ -740,13 +744,13 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 10, "path": "c:/projects/myproject/b.ts" } } -Custom watchFile: 10: c:/projects/myproject/b.ts +Custom watchFile:: Added:: {"id":10,"path":"c:/projects/myproject/b.ts"} Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -764,27 +768,27 @@ Info seq [hh:mm:ss:mss] response: } After request -Custom WatchedFiles:: +PolledWatches:: c:/a/lib/lib.d.ts: - {"id":6,"path":"c:/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"c:/a/lib/lib.d.ts"}} c:/projects/myproject/b.ts: *new* - {"id":10,"path":"c:/projects/myproject/b.ts"} + {"event":{"id":10,"path":"c:/projects/myproject/b.ts"}} c:/projects/myproject/c.ts: - {"id":9,"path":"c:/projects/myproject/c.ts"} + {"event":{"id":9,"path":"c:/projects/myproject/c.ts"}} c:/projects/myproject/m.ts: - {"id":4,"path":"c:/projects/myproject/m.ts"} + {"event":{"id":4,"path":"c:/projects/myproject/m.ts"}} c:/projects/myproject/tsconfig.json: - {"id":1,"path":"c:/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"c:/projects/myproject/tsconfig.json"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: c:/projects/myproject: - {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}} c:/projects/myproject/node_modules: - {"id":5,"path":"c:/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"c:/projects/myproject/node_modules","recursive":true}} c:/projects/myproject/node_modules/@types: - {"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} c:/projects/node_modules/@types: - {"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} ScriptInfos:: c:/a/lib/lib.d.ts @@ -813,16 +817,15 @@ c:/projects/myproject/node_modules/something/index.d.ts containingProjects: 1 c:/projects/myproject/tsconfig.json -Change File: c:/projects/myproject/c.ts +Custom watchFile:: Triggered:: {"id":9,"path":"c:/projects/myproject/c.ts"}:: c:\projects\myproject\c.ts updated +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\c.ts updated Before running Timeout callback:: count: 0 //// [c:/projects/myproject/c.ts] -export xyx = 10;export const ss = 20; +export class a { prop = "hello"; foo() { return this.prop; } }export const y = 20; After running Timeout callback:: count: 0 -Custom watch:: c:/projects/myproject/c.ts c:\projects\myproject\b.ts updated -Custom watch:: c:/projects/myproject c:\projects\myproject\b.ts updated Before request Info seq [hh:mm:ss:mss] request: @@ -831,16 +834,16 @@ Info seq [hh:mm:ss:mss] request: "arguments": { "id": 9, "updated": [ - "c:\\projects\\myproject\\b.ts" + "c:\\projects\\myproject\\c.ts" ] }, "seq": 6, "type": "request" } -Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with c:/projects/myproject/b.ts 1:: WatchInfo: c:/projects/myproject/c.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with c:/projects/myproject/c.ts 1:: WatchInfo: c:/projects/myproject/c.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] Scheduled: c:/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* -Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with c:/projects/myproject/b.ts 1:: WatchInfo: c:/projects/myproject/c.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with c:/projects/myproject/c.ts 1:: WatchInfo: c:/projects/myproject/c.ts 500 undefined WatchType: Closed Script info After request Timeout callback:: count: 2 @@ -891,10 +894,10 @@ Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configur Info seq [hh:mm:ss:mss] Files (6) c:/a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" c:/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" - c:/projects/myproject/b.ts Text-2 "export class b { prop = \"hello\"; foo() { return this.prop; } }export const ss = 20;" + c:/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" c:/projects/myproject/node_modules/something/index.d.ts Text-1 "export const x = 10;" c:/projects/myproject/m.ts Text-1 "import { x } from \"something\"" - c:/projects/myproject/c.ts Text-2 "export xyx = 10;export const ss = 20;" + c:/projects/myproject/c.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;" Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* @@ -914,11 +917,12 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: c:/projects/myproject/a.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: c:/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background c:/projects/myproject/a.ts Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", + "event": "projectsUpdatedInBackground", "body": { "openFiles": [ "c:/projects/myproject/a.ts" @@ -960,196 +964,33 @@ c:/projects/myproject/node_modules/something/index.d.ts containingProjects: 1 c:/projects/myproject/tsconfig.json -update with npm install -Before running Timeout callback:: count: 0 -//// [c:/projects/myproject/node_modules/something/index.d.ts] -export const x = 10;export const y = 20; - - -After running Timeout callback:: count: 0 - -Custom watch:: c:/projects/myproject/node_modules c:\projects\myproject\node_modules\something\index.d.ts updated -Before request - -Info seq [hh:mm:ss:mss] request: - { - "command": "watchChange", - "arguments": { - "id": 5, - "updated": [ - "c:\\projects\\myproject\\node_modules\\something\\index.d.ts" - ] - }, - "seq": 7, - "type": "request" - } -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with c:/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: c:/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache -Info seq [hh:mm:ss:mss] Scheduled: c:/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with c:/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: c:/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with c:/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: c:/projects/myproject/node_modules 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Scheduled: c:/projects/myproject/tsconfig.jsonFailedLookupInvalidation -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with c:/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: c:/projects/myproject/node_modules 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations -After request - -Timeout callback:: count: 3 -7: c:/projects/myproject/tsconfig.json *new* -8: *ensureProjectForOpenFiles* *new* -9: c:/projects/myproject/tsconfig.jsonFailedLookupInvalidation *new* - -Projects:: -c:/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 5 *changed* - projectProgramVersion: 2 - dirty: true *changed* - -ScriptInfos:: -c:/a/lib/lib.d.ts - version: Text-1 - containingProjects: 1 - c:/projects/myproject/tsconfig.json -c:/projects/myproject/a.ts (Open) - version: SVC-1-0 - containingProjects: 1 - c:/projects/myproject/tsconfig.json *default* -c:/projects/myproject/b.ts - version: Text-2 - containingProjects: 1 - c:/projects/myproject/tsconfig.json -c:/projects/myproject/c.ts - version: Text-2 - containingProjects: 1 - c:/projects/myproject/tsconfig.json -c:/projects/myproject/m.ts - version: Text-1 - containingProjects: 1 - c:/projects/myproject/tsconfig.json -c:/projects/myproject/node_modules/something/index.d.ts *changed* - version: Text-1 - pendingReloadFromDisk: true *changed* - containingProjects: 1 - c:/projects/myproject/tsconfig.json - -Before running Timeout callback:: count: 3 -7: c:/projects/myproject/tsconfig.json -8: *ensureProjectForOpenFiles* -9: c:/projects/myproject/tsconfig.jsonFailedLookupInvalidation - -Info seq [hh:mm:ss:mss] Running: c:/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one -Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: c:/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: c:/projects/myproject/tsconfig.json projectStateVersion: 5 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) - c:/a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" - c:/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" - c:/projects/myproject/b.ts Text-2 "export class b { prop = \"hello\"; foo() { return this.prop; } }export const ss = 20;" - c:/projects/myproject/node_modules/something/index.d.ts Text-2 "export const x = 10;export const y = 20;" - c:/projects/myproject/m.ts Text-1 "import { x } from \"something\"" - c:/projects/myproject/c.ts Text-2 "export xyx = 10;export const ss = 20;" - -Info seq [hh:mm:ss:mss] ----------------------------------------------- -After running Timeout callback:: count: 1 - -Timeout callback:: count: 1 -8: *ensureProjectForOpenFiles* *deleted* -9: c:/projects/myproject/tsconfig.jsonFailedLookupInvalidation *deleted* -10: *ensureProjectForOpenFiles* *new* - -Projects:: -c:/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 5 - projectProgramVersion: 3 *changed* - dirty: false *changed* - -ScriptInfos:: -c:/a/lib/lib.d.ts - version: Text-1 - containingProjects: 1 - c:/projects/myproject/tsconfig.json -c:/projects/myproject/a.ts (Open) - version: SVC-1-0 - containingProjects: 1 - c:/projects/myproject/tsconfig.json *default* -c:/projects/myproject/b.ts - version: Text-2 - containingProjects: 1 - c:/projects/myproject/tsconfig.json -c:/projects/myproject/c.ts - version: Text-2 - containingProjects: 1 - c:/projects/myproject/tsconfig.json -c:/projects/myproject/m.ts - version: Text-1 - containingProjects: 1 - c:/projects/myproject/tsconfig.json -c:/projects/myproject/node_modules/something/index.d.ts *changed* - version: Text-2 *changed* - pendingReloadFromDisk: false *changed* - containingProjects: 1 - c:/projects/myproject/tsconfig.json - -Before running Timeout callback:: count: 1 -10: *ensureProjectForOpenFiles* - -Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* -Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: -Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) - -Info seq [hh:mm:ss:mss] ----------------------------------------------- -Info seq [hh:mm:ss:mss] Open files: -Info seq [hh:mm:ss:mss] FileName: c:/projects/myproject/a.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: c:/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: -Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) - -Info seq [hh:mm:ss:mss] ----------------------------------------------- -Info seq [hh:mm:ss:mss] Open files: -Info seq [hh:mm:ss:mss] FileName: c:/projects/myproject/a.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: c:/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] event: - { - "seq": 0, - "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", - "body": { - "openFiles": [ - "c:/projects/myproject/a.ts" - ] - } - } -After running Timeout callback:: count: 0 - -Add file: c:/projects/myproject/d.ts +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\d.ts created +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\d.ts updated Before running Timeout callback:: count: 0 //// [c:/projects/myproject/d.ts] -export const yy = 10; +export class a { prop = "hello"; foo() { return this.prop; } } After running Timeout callback:: count: 0 -Change File: c:/projects/myproject/c.ts +Custom watchFile:: Triggered:: {"id":9,"path":"c:/projects/myproject/c.ts"}:: c:\projects\myproject\c.ts updated +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\c.ts updated Before running Timeout callback:: count: 0 //// [c:/projects/myproject/c.ts] -export xyx = 10;export const ss = 20;export const z = 30; +export class a { prop = "hello"; foo() { return this.prop; } }export const y = 20;export const z = 30; After running Timeout callback:: count: 0 -Add File: c:/projects/myproject/e.ts +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\e.ts created +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\e.ts updated Before running Timeout callback:: count: 0 //// [c:/projects/myproject/e.ts] -export const zz = 40; +export class a { prop = "hello"; foo() { return this.prop; } } After running Timeout callback:: count: 0 -Custom watch:: c:/projects/myproject c:\projects\myproject\d.ts created -Custom watch:: c:/projects/myproject/c.ts c:\projects\myproject\c.ts updated -Custom watch:: c:/projects/myproject c:\projects\myproject\c.ts updated -Custom watch:: c:/projects/myproject c:\projects\myproject\e.ts created Before request Info seq [hh:mm:ss:mss] request: @@ -1170,7 +1011,7 @@ Info seq [hh:mm:ss:mss] request: ] } ], - "seq": 8, + "seq": 7, "type": "request" } Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with c:/projects/myproject/d.ts :: WatchInfo: c:/projects/myproject 1 undefined Config: c:/projects/myproject/tsconfig.json WatchType: Wild card directory @@ -1188,13 +1029,13 @@ Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with c:/projects/ After request Timeout callback:: count: 2 -15: c:/projects/myproject/tsconfig.json *new* -16: *ensureProjectForOpenFiles* *new* +11: c:/projects/myproject/tsconfig.json *new* +12: *ensureProjectForOpenFiles* *new* Projects:: c:/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 6 *changed* - projectProgramVersion: 3 + projectStateVersion: 5 *changed* + projectProgramVersion: 2 dirty: true *changed* ScriptInfos:: @@ -1220,13 +1061,13 @@ c:/projects/myproject/m.ts containingProjects: 1 c:/projects/myproject/tsconfig.json c:/projects/myproject/node_modules/something/index.d.ts - version: Text-2 + version: Text-1 containingProjects: 1 c:/projects/myproject/tsconfig.json Before running Timeout callback:: count: 2 -15: c:/projects/myproject/tsconfig.json -16: *ensureProjectForOpenFiles* +11: c:/projects/myproject/tsconfig.json +12: *ensureProjectForOpenFiles* Info seq [hh:mm:ss:mss] Running: c:/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: c:/projects/myproject/d.ts 500 undefined WatchType: Closed Script info @@ -1234,37 +1075,37 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 11, "path": "c:/projects/myproject/d.ts" } } -Custom watchFile: 11: c:/projects/myproject/d.ts +Custom watchFile:: Added:: {"id":11,"path":"c:/projects/myproject/d.ts"} Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: c:/projects/myproject/e.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 12, "path": "c:/projects/myproject/e.ts" } } -Custom watchFile: 12: c:/projects/myproject/e.ts +Custom watchFile:: Added:: {"id":12,"path":"c:/projects/myproject/e.ts"} Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: c:/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: c:/projects/myproject/tsconfig.json projectStateVersion: 6 projectProgramVersion: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: c:/projects/myproject/tsconfig.json projectStateVersion: 5 projectProgramVersion: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (8) c:/a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" c:/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" - c:/projects/myproject/b.ts Text-2 "export class b { prop = \"hello\"; foo() { return this.prop; } }export const ss = 20;" - c:/projects/myproject/node_modules/something/index.d.ts Text-2 "export const x = 10;export const y = 20;" + c:/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + c:/projects/myproject/node_modules/something/index.d.ts Text-1 "export const x = 10;" c:/projects/myproject/m.ts Text-1 "import { x } from \"something\"" - c:/projects/myproject/c.ts Text-3 "export xyx = 10;export const ss = 20;export const z = 30;" - c:/projects/myproject/d.ts Text-1 "export const yy = 10;" - c:/projects/myproject/e.ts Text-1 "export const zz = 40;" + c:/projects/myproject/c.ts Text-3 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;export const z = 30;" + c:/projects/myproject/d.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + c:/projects/myproject/e.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" ../../a/lib/lib.d.ts @@ -1302,11 +1143,12 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: c:/projects/myproject/a.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: c:/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background c:/projects/myproject/a.ts Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", + "event": "projectsUpdatedInBackground", "body": { "openFiles": [ "c:/projects/myproject/a.ts" @@ -1315,36 +1157,36 @@ Info seq [hh:mm:ss:mss] event: } After running Timeout callback:: count: 0 -Custom WatchedFiles:: +PolledWatches:: c:/a/lib/lib.d.ts: - {"id":6,"path":"c:/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"c:/a/lib/lib.d.ts"}} c:/projects/myproject/b.ts: - {"id":10,"path":"c:/projects/myproject/b.ts"} + {"event":{"id":10,"path":"c:/projects/myproject/b.ts"}} c:/projects/myproject/c.ts: - {"id":9,"path":"c:/projects/myproject/c.ts"} + {"event":{"id":9,"path":"c:/projects/myproject/c.ts"}} c:/projects/myproject/d.ts: *new* - {"id":11,"path":"c:/projects/myproject/d.ts"} + {"event":{"id":11,"path":"c:/projects/myproject/d.ts"}} c:/projects/myproject/e.ts: *new* - {"id":12,"path":"c:/projects/myproject/e.ts"} + {"event":{"id":12,"path":"c:/projects/myproject/e.ts"}} c:/projects/myproject/m.ts: - {"id":4,"path":"c:/projects/myproject/m.ts"} + {"event":{"id":4,"path":"c:/projects/myproject/m.ts"}} c:/projects/myproject/tsconfig.json: - {"id":1,"path":"c:/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"c:/projects/myproject/tsconfig.json"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: c:/projects/myproject: - {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}} c:/projects/myproject/node_modules: - {"id":5,"path":"c:/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"c:/projects/myproject/node_modules","recursive":true}} c:/projects/myproject/node_modules/@types: - {"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"c:/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} c:/projects/node_modules/@types: - {"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"c:/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} Projects:: c:/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 6 - projectProgramVersion: 4 *changed* + projectStateVersion: 5 + projectProgramVersion: 3 *changed* dirty: false *changed* ScriptInfos:: @@ -1378,6 +1220,187 @@ c:/projects/myproject/m.ts containingProjects: 1 c:/projects/myproject/tsconfig.json c:/projects/myproject/node_modules/something/index.d.ts + version: Text-1 + containingProjects: 1 + c:/projects/myproject/tsconfig.json + +Custom watchDirectory:: Triggered:: {"id":5,"path":"c:/projects/myproject/node_modules","recursive":true}:: c:\projects\myproject\node_modules\something\index.d.ts updated +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"c:/projects/myproject","recursive":true,"ignoreUpdate":true}:: c:\projects\myproject\node_modules\something\index.d.ts updated +Before running Timeout callback:: count: 0 +//// [c:/projects/myproject/node_modules/something/index.d.ts] +export const x = 10;export const y = 20; + + +After running Timeout callback:: count: 0 + +Before request + +Info seq [hh:mm:ss:mss] request: + { + "command": "watchChange", + "arguments": { + "id": 5, + "updated": [ + "c:\\projects\\myproject\\node_modules\\something\\index.d.ts" + ] + }, + "seq": 8, + "type": "request" + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with c:/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: c:/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache +Info seq [hh:mm:ss:mss] Scheduled: c:/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with c:/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: c:/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with c:/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: c:/projects/myproject/node_modules 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Scheduled: c:/projects/myproject/tsconfig.jsonFailedLookupInvalidation +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with c:/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: c:/projects/myproject/node_modules 1 undefined Project: c:/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +After request + +Timeout callback:: count: 3 +13: c:/projects/myproject/tsconfig.json *new* +14: *ensureProjectForOpenFiles* *new* +15: c:/projects/myproject/tsconfig.jsonFailedLookupInvalidation *new* + +Projects:: +c:/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 6 *changed* + projectProgramVersion: 3 + dirty: true *changed* + +ScriptInfos:: +c:/a/lib/lib.d.ts + version: Text-1 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/a.ts (Open) + version: SVC-1-0 + containingProjects: 1 + c:/projects/myproject/tsconfig.json *default* +c:/projects/myproject/b.ts version: Text-2 containingProjects: 1 c:/projects/myproject/tsconfig.json +c:/projects/myproject/c.ts + version: Text-3 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/d.ts + version: Text-1 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/e.ts + version: Text-1 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/m.ts + version: Text-1 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/node_modules/something/index.d.ts *changed* + version: Text-1 + pendingReloadFromDisk: true *changed* + containingProjects: 1 + c:/projects/myproject/tsconfig.json + +Before running Timeout callback:: count: 3 +13: c:/projects/myproject/tsconfig.json +14: *ensureProjectForOpenFiles* +15: c:/projects/myproject/tsconfig.jsonFailedLookupInvalidation + +Info seq [hh:mm:ss:mss] Running: c:/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: c:/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: c:/projects/myproject/tsconfig.json projectStateVersion: 6 projectProgramVersion: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (8) + c:/a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + c:/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + c:/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + c:/projects/myproject/node_modules/something/index.d.ts Text-2 "export const x = 10;export const y = 20;" + c:/projects/myproject/m.ts Text-1 "import { x } from \"something\"" + c:/projects/myproject/c.ts Text-3 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;export const z = 30;" + c:/projects/myproject/d.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + c:/projects/myproject/e.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +After running Timeout callback:: count: 1 + +Timeout callback:: count: 1 +14: *ensureProjectForOpenFiles* *deleted* +15: c:/projects/myproject/tsconfig.jsonFailedLookupInvalidation *deleted* +16: *ensureProjectForOpenFiles* *new* + +Projects:: +c:/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 6 + projectProgramVersion: 4 *changed* + dirty: false *changed* + +ScriptInfos:: +c:/a/lib/lib.d.ts + version: Text-1 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/a.ts (Open) + version: SVC-1-0 + containingProjects: 1 + c:/projects/myproject/tsconfig.json *default* +c:/projects/myproject/b.ts + version: Text-2 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/c.ts + version: Text-3 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/d.ts + version: Text-1 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/e.ts + version: Text-1 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/m.ts + version: Text-1 + containingProjects: 1 + c:/projects/myproject/tsconfig.json +c:/projects/myproject/node_modules/something/index.d.ts *changed* + version: Text-2 *changed* + pendingReloadFromDisk: false *changed* + containingProjects: 1 + c:/projects/myproject/tsconfig.json + +Before running Timeout callback:: count: 1 +16: *ensureProjectForOpenFiles* + +Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (8) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: c:/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: c:/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project 'c:/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (8) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: c:/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: c:/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background c:/projects/myproject/a.ts +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectsUpdatedInBackground", + "body": { + "openFiles": [ + "c:/projects/myproject/a.ts" + ] + } + } +After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents-without-canUseEvents.js b/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents-without-canUseEvents.js index 2b27ed060405e..1dc5c284f1953 100644 --- a/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents-without-canUseEvents.js +++ b/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents-without-canUseEvents.js @@ -157,7 +157,6 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json -Add file: /user/username/projects/myproject/c.ts Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /user/username/projects/myproject/c.ts :: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* @@ -282,12 +281,37 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json -Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/c.ts created +Before request + +Info seq [hh:mm:ss:mss] request: + { + "command": "watchChange", + "arguments": [], + "seq": 2, + "type": "request" + } +Info seq [hh:mm:ss:mss] Err:: Unrecognized JSON command: + { + "command": "watchChange", + "arguments": [], + "seq": 2, + "type": "request" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "unknown", + "request_seq": 2, + "success": false, + "message": "Unrecognized JSON command: watchChange" + } +After request + Before running Timeout callback:: count: 0 After running Timeout callback:: count: 0 -Change File: /user/username/projects/myproject/b.ts Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /user/username/projects/myproject/b.ts 1:: WatchInfo: /user/username/projects/myproject/b.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* @@ -401,8 +425,33 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json -Custom watch:: /user/username/projects/myproject/b.ts /user/username/projects/myproject/b.ts updated -Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/b.ts updated +Before request + +Info seq [hh:mm:ss:mss] request: + { + "command": "watchChange", + "arguments": [], + "seq": 3, + "type": "request" + } +Info seq [hh:mm:ss:mss] Err:: Unrecognized JSON command: + { + "command": "watchChange", + "arguments": [], + "seq": 3, + "type": "request" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "unknown", + "request_seq": 3, + "success": false, + "message": "Unrecognized JSON command: watchChange" + } +After request + Before running Timeout callback:: count: 0 After running Timeout callback:: count: 0 @@ -415,7 +464,7 @@ Info seq [hh:mm:ss:mss] request: "arguments": { "file": "/user/username/projects/myproject/b.ts" }, - "seq": 2, + "seq": 4, "type": "request" } Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/b.ts 500 undefined WatchType: Closed Script info @@ -434,7 +483,7 @@ Info seq [hh:mm:ss:mss] response: "seq": 0, "type": "response", "command": "open", - "request_seq": 2, + "request_seq": 4, "success": true } After request @@ -500,7 +549,7 @@ Info seq [hh:mm:ss:mss] request: "arguments": { "file": "/user/username/projects/myproject/b.ts" }, - "seq": 3, + "seq": 5, "type": "request" } Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 500 undefined WatchType: Closed Script info @@ -516,7 +565,7 @@ Info seq [hh:mm:ss:mss] response: "seq": 0, "type": "response", "command": "close", - "request_seq": 3, + "request_seq": 5, "success": true } After request @@ -572,30 +621,133 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /user/username/projects/myproject/c.ts 1:: WatchInfo: /user/username/projects/myproject/c.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/c.ts 1:: WatchInfo: /user/username/projects/myproject/c.ts 500 undefined WatchType: Closed Script info +Before running Timeout callback:: count: 2 +5: /user/username/projects/myproject/tsconfig.json +6: *ensureProjectForOpenFiles* +//// [/user/username/projects/myproject/c.ts] +export class a { prop = "hello"; foo() { return this.prop; } }export const y = 20; + + +Timeout callback:: count: 2 +5: /user/username/projects/myproject/tsconfig.json *new* +6: *ensureProjectForOpenFiles* *new* + +Projects:: +/user/username/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 4 *changed* + projectProgramVersion: 2 + dirty: true *changed* + +ScriptInfos:: +/a/lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/a.ts (Open) + version: SVC-1-0 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json *default* +/user/username/projects/myproject/b.ts + version: Text-2 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/c.ts *changed* + version: Text-1 + pendingReloadFromDisk: true *changed* + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/m.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/node_modules/something/index.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json + +Info seq [hh:mm:ss:mss] Running: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 4 projectProgramVersion: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/node_modules/something/index.d.ts Text-1 "export const x = 10;" + /user/username/projects/myproject/m.ts Text-1 "import { x } from \"something\"" + /user/username/projects/myproject/c.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +After running Timeout callback:: count: 0 + +Projects:: +/user/username/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 4 + projectProgramVersion: 2 + dirty: false *changed* + +ScriptInfos:: +/a/lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/a.ts (Open) + version: SVC-1-0 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json *default* +/user/username/projects/myproject/b.ts + version: Text-2 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/c.ts *changed* + version: Text-2 *changed* + pendingReloadFromDisk: false *changed* + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/m.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/node_modules/something/index.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json + Before request Info seq [hh:mm:ss:mss] request: { "command": "watchChange", - "arguments": { - "id": 1, - "updated": [ - "/user/username/projects/myproject/b.ts" - ] - }, - "seq": 4, + "arguments": [], + "seq": 6, "type": "request" } Info seq [hh:mm:ss:mss] Err:: Unrecognized JSON command: { "command": "watchChange", - "arguments": { - "id": 1, - "updated": [ - "/user/username/projects/myproject/b.ts" - ] - }, - "seq": 4, + "arguments": [], + "seq": 6, "type": "request" } Info seq [hh:mm:ss:mss] response: @@ -603,32 +755,168 @@ Info seq [hh:mm:ss:mss] response: "seq": 0, "type": "response", "command": "unknown", - "request_seq": 4, + "request_seq": 6, "success": false, "message": "Unrecognized JSON command: watchChange" } After request -Change File: /user/username/projects/myproject/c.ts +Before running Timeout callback:: count: 0 + +After running Timeout callback:: count: 0 + +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /user/username/projects/myproject/d.ts :: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/d.ts :: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory +Before running Timeout callback:: count: 2 +7: /user/username/projects/myproject/tsconfig.json +8: *ensureProjectForOpenFiles* +//// [/user/username/projects/myproject/d.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + + +Timeout callback:: count: 2 +7: /user/username/projects/myproject/tsconfig.json *new* +8: *ensureProjectForOpenFiles* *new* + +Projects:: +/user/username/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 5 *changed* + projectProgramVersion: 2 + dirty: true *changed* + +Info seq [hh:mm:ss:mss] Running: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 5 projectProgramVersion: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/node_modules/something/index.d.ts Text-1 "export const x = 10;" + /user/username/projects/myproject/m.ts Text-1 "import { x } from \"something\"" + /user/username/projects/myproject/c.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;" + /user/username/projects/myproject/d.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + node_modules/something/index.d.ts + Imported via "something" from file 'm.ts' + m.ts + Matched by default include pattern '**/*' + c.ts + Matched by default include pattern '**/*' + d.ts + Matched by default include pattern '**/*' + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (7) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (7) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +After running Timeout callback:: count: 0 + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/b.ts: + {} +/user/username/projects/myproject/c.ts: + {} +/user/username/projects/myproject/d.ts: *new* + {} +/user/username/projects/myproject/m.ts: + {} +/user/username/projects/myproject/tsconfig.json: + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: + {} +/user/username/projects/myproject/node_modules: + {} + +Projects:: +/user/username/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 5 + projectProgramVersion: 3 *changed* + dirty: false *changed* + +ScriptInfos:: +/a/lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/a.ts (Open) + version: SVC-1-0 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json *default* +/user/username/projects/myproject/b.ts + version: Text-2 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/c.ts + version: Text-2 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/d.ts *new* + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/m.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/node_modules/something/index.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json + Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /user/username/projects/myproject/c.ts 1:: WatchInfo: /user/username/projects/myproject/c.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/c.ts 1:: WatchInfo: /user/username/projects/myproject/c.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 2 -5: /user/username/projects/myproject/tsconfig.json -6: *ensureProjectForOpenFiles* +9: /user/username/projects/myproject/tsconfig.json +10: *ensureProjectForOpenFiles* //// [/user/username/projects/myproject/c.ts] -export class a { prop = "hello"; foo() { return this.prop; } }export const y = 20; +export class a { prop = "hello"; foo() { return this.prop; } }export const y = 20;export const z = 30; Timeout callback:: count: 2 -5: /user/username/projects/myproject/tsconfig.json *new* -6: *ensureProjectForOpenFiles* *new* +9: /user/username/projects/myproject/tsconfig.json *new* +10: *ensureProjectForOpenFiles* *new* Projects:: /user/username/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 4 *changed* - projectProgramVersion: 2 + projectStateVersion: 6 *changed* + projectProgramVersion: 3 dirty: true *changed* ScriptInfos:: @@ -645,10 +933,14 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json /user/username/projects/myproject/c.ts *changed* - version: Text-1 + version: Text-2 pendingReloadFromDisk: true *changed* containingProjects: 1 /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json /user/username/projects/myproject/m.ts version: Text-1 containingProjects: 1 @@ -660,21 +952,22 @@ ScriptInfos:: Info seq [hh:mm:ss:mss] Running: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 4 projectProgramVersion: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 6 projectProgramVersion: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (7) /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" /user/username/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" /user/username/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" /user/username/projects/myproject/node_modules/something/index.d.ts Text-1 "export const x = 10;" /user/username/projects/myproject/m.ts Text-1 "import { x } from \"something\"" - /user/username/projects/myproject/c.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;" + /user/username/projects/myproject/c.ts Text-3 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;export const z = 30;" + /user/username/projects/myproject/d.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (7) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -682,7 +975,7 @@ Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts Proje Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (7) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -692,8 +985,8 @@ After running Timeout callback:: count: 0 Projects:: /user/username/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 4 - projectProgramVersion: 2 + projectStateVersion: 6 + projectProgramVersion: 3 dirty: false *changed* ScriptInfos:: @@ -710,10 +1003,156 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json /user/username/projects/myproject/c.ts *changed* - version: Text-2 *changed* + version: Text-3 *changed* pendingReloadFromDisk: false *changed* containingProjects: 1 /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/m.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/node_modules/something/index.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json + +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /user/username/projects/myproject/e.ts :: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/e.ts :: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory +Before running Timeout callback:: count: 2 +11: /user/username/projects/myproject/tsconfig.json +12: *ensureProjectForOpenFiles* +//// [/user/username/projects/myproject/e.ts] +export class a { prop = "hello"; foo() { return this.prop; } } + + +Timeout callback:: count: 2 +11: /user/username/projects/myproject/tsconfig.json *new* +12: *ensureProjectForOpenFiles* *new* + +Projects:: +/user/username/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 7 *changed* + projectProgramVersion: 3 + dirty: true *changed* + +Info seq [hh:mm:ss:mss] Running: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/e.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 7 projectProgramVersion: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (8) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/node_modules/something/index.d.ts Text-1 "export const x = 10;" + /user/username/projects/myproject/m.ts Text-1 "import { x } from \"something\"" + /user/username/projects/myproject/c.ts Text-3 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;export const z = 30;" + /user/username/projects/myproject/d.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/e.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + node_modules/something/index.d.ts + Imported via "something" from file 'm.ts' + m.ts + Matched by default include pattern '**/*' + c.ts + Matched by default include pattern '**/*' + d.ts + Matched by default include pattern '**/*' + e.ts + Matched by default include pattern '**/*' + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (8) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (8) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +After running Timeout callback:: count: 0 + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/b.ts: + {} +/user/username/projects/myproject/c.ts: + {} +/user/username/projects/myproject/d.ts: + {} +/user/username/projects/myproject/e.ts: *new* + {} +/user/username/projects/myproject/m.ts: + {} +/user/username/projects/myproject/tsconfig.json: + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: + {} +/user/username/projects/myproject/node_modules: + {} + +Projects:: +/user/username/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 7 + projectProgramVersion: 4 *changed* + dirty: false *changed* + +ScriptInfos:: +/a/lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/a.ts (Open) + version: SVC-1-0 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json *default* +/user/username/projects/myproject/b.ts + version: Text-2 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/c.ts + version: Text-3 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/e.ts *new* + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json /user/username/projects/myproject/m.ts version: Text-1 containingProjects: 1 @@ -723,13 +1162,37 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json -Custom watch:: /user/username/projects/myproject/c.ts /user/username/projects/myproject/c.ts updated -Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/c.ts updated +Before request + +Info seq [hh:mm:ss:mss] request: + { + "command": "watchChange", + "arguments": [], + "seq": 7, + "type": "request" + } +Info seq [hh:mm:ss:mss] Err:: Unrecognized JSON command: + { + "command": "watchChange", + "arguments": [], + "seq": 7, + "type": "request" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "unknown", + "request_seq": 7, + "success": false, + "message": "Unrecognized JSON command: watchChange" + } +After request + Before running Timeout callback:: count: 0 After running Timeout callback:: count: 0 -update with npm install Before running Timeout callback:: count: 0 //// [/user/username/projects/myproject/node_modules/something/index.d.ts] export const x = 10;export const y = 20; @@ -737,7 +1200,37 @@ export const x = 10;export const y = 20; After running Timeout callback:: count: 0 -Custom watch:: /user/username/projects/myproject/node_modules /user/username/projects/myproject/node_modules/something/index.d.ts updated +Before request + +Info seq [hh:mm:ss:mss] request: + { + "command": "watchChange", + "arguments": [], + "seq": 8, + "type": "request" + } +Info seq [hh:mm:ss:mss] Err:: Unrecognized JSON command: + { + "command": "watchChange", + "arguments": [], + "seq": 8, + "type": "request" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "unknown", + "request_seq": 8, + "success": false, + "message": "Unrecognized JSON command: watchChange" + } +After request + +Before running Timeout callback:: count: 0 + +After running Timeout callback:: count: 0 + Before running Timeout callback:: count: 0 After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents.js b/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents.js index a5638bc44c694..b56faa94d1959 100644 --- a/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/events/watchEvents/canUseWatchEvents.js @@ -46,20 +46,20 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 1, "path": "/user/username/projects/myproject/tsconfig.json" } } -Custom watchFile: 1: /user/username/projects/myproject/tsconfig.json +Custom watchFile:: Added:: {"id":1,"path":"/user/username/projects/myproject/tsconfig.json"} Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectLoadingStart", + "event": "projectLoadingStart", "body": { - "project": "/user/username/projects/myproject/tsconfig.json", + "projectName": "/user/username/projects/myproject/tsconfig.json", "reason": "Creating possible configured project for /user/username/projects/myproject/a.ts to open" } } @@ -78,7 +78,7 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createDirectoryWatcher", + "event": "createDirectoryWatcher", "body": { "id": 2, "path": "/user/username/projects/myproject", @@ -86,59 +86,59 @@ Info seq [hh:mm:ss:mss] event: "ignoreUpdate": true } } -Custom watchDirectory: 2: /user/username/projects/myproject true true +Custom watchDirectory:: Added:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true} Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/b.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 3, "path": "/user/username/projects/myproject/b.ts" } } -Custom watchFile: 3: /user/username/projects/myproject/b.ts +Custom watchFile:: Added:: {"id":3,"path":"/user/username/projects/myproject/b.ts"} Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/m.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 4, "path": "/user/username/projects/myproject/m.ts" } } -Custom watchFile: 4: /user/username/projects/myproject/m.ts +Custom watchFile:: Added:: {"id":4,"path":"/user/username/projects/myproject/m.ts"} Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createDirectoryWatcher", + "event": "createDirectoryWatcher", "body": { "id": 5, "path": "/user/username/projects/myproject/node_modules", "recursive": true } } -Custom watchDirectory: 5: /user/username/projects/myproject/node_modules true undefined +Custom watchDirectory:: Added:: {"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true} Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 6, "path": "/a/lib/lib.d.ts" } } -Custom watchFile: 6: /a/lib/lib.d.ts +Custom watchFile:: Added:: {"id":6,"path":"/a/lib/lib.d.ts"} Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots @@ -146,7 +146,7 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createDirectoryWatcher", + "event": "createDirectoryWatcher", "body": { "id": 7, "path": "/user/username/projects/myproject/node_modules/@types", @@ -154,14 +154,14 @@ Info seq [hh:mm:ss:mss] event: "ignoreUpdate": true } } -Custom watchDirectory: 7: /user/username/projects/myproject/node_modules/@types true true +Custom watchDirectory:: Added:: {"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createDirectoryWatcher", + "event": "createDirectoryWatcher", "body": { "id": 8, "path": "/user/username/projects/node_modules/@types", @@ -169,7 +169,7 @@ Info seq [hh:mm:ss:mss] event: "ignoreUpdate": true } } -Custom watchDirectory: 8: /user/username/projects/node_modules/@types true true +Custom watchDirectory:: Added:: {"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) @@ -197,58 +197,61 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectLoadingFinish", + "event": "projectLoadingFinish", "body": { - "project": "/user/username/projects/myproject/tsconfig.json" + "projectName": "/user/username/projects/myproject/tsconfig.json" } } Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectInfo", + "event": "telemetry", "body": { - "projectId": "4a33d78ee40d836c4f4e64c59aed976628aea0013be9585c5ff171dfc41baf98", - "fileStats": { - "js": 0, - "jsSize": 0, - "jsx": 0, - "jsxSize": 0, - "ts": 3, - "tsSize": 153, - "tsx": 0, - "tsxSize": 0, - "dts": 2, - "dtsSize": 354, - "deferred": 0, - "deferredSize": 0 - }, - "compilerOptions": {}, - "typeAcquisition": { - "enable": false, + "telemetryEventName": "projectInfo", + "payload": { + "projectId": "4a33d78ee40d836c4f4e64c59aed976628aea0013be9585c5ff171dfc41baf98", + "fileStats": { + "js": 0, + "jsSize": 0, + "jsx": 0, + "jsxSize": 0, + "ts": 3, + "tsSize": 153, + "tsx": 0, + "tsxSize": 0, + "dts": 2, + "dtsSize": 354, + "deferred": 0, + "deferredSize": 0 + }, + "compilerOptions": {}, + "typeAcquisition": { + "enable": false, + "include": false, + "exclude": false + }, + "extends": false, + "files": false, "include": false, - "exclude": false - }, - "extends": false, - "files": false, - "include": false, - "exclude": false, - "compileOnSave": false, - "configFileName": "tsconfig.json", - "projectType": "configured", - "languageServiceEnabled": true, - "version": "FakeVersion" + "exclude": false, + "compileOnSave": false, + "configFileName": "tsconfig.json", + "projectType": "configured", + "languageServiceEnabled": true, + "version": "FakeVersion" + } } } Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::configFileDiag", + "event": "configFileDiag", "body": { - "configFileName": "/user/username/projects/myproject/tsconfig.json", - "diagnostics": [], - "triggerFile": "/user/username/projects/myproject/a.ts" + "triggerFile": "/user/username/projects/myproject/a.ts", + "configFile": "/user/username/projects/myproject/tsconfig.json", + "diagnostics": [] } } Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) @@ -271,25 +274,25 @@ Info seq [hh:mm:ss:mss] response: } After request -Custom WatchedFiles:: +PolledWatches:: /a/lib/lib.d.ts: *new* - {"id":6,"path":"/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"/a/lib/lib.d.ts"}} /user/username/projects/myproject/b.ts: *new* - {"id":3,"path":"/user/username/projects/myproject/b.ts"} + {"event":{"id":3,"path":"/user/username/projects/myproject/b.ts"}} /user/username/projects/myproject/m.ts: *new* - {"id":4,"path":"/user/username/projects/myproject/m.ts"} + {"event":{"id":4,"path":"/user/username/projects/myproject/m.ts"}} /user/username/projects/myproject/tsconfig.json: *new* - {"id":1,"path":"/user/username/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"/user/username/projects/myproject/tsconfig.json"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: /user/username/projects/myproject: *new* - {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}} /user/username/projects/myproject/node_modules: *new* - {"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true}} /user/username/projects/myproject/node_modules/@types: *new* - {"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} /user/username/projects/node_modules/@types: *new* - {"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} Projects:: /user/username/projects/myproject/tsconfig.json (Configured) *new* @@ -318,7 +321,8 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json -Add file: /user/username/projects/myproject/c.ts +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/c.ts created +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/c.ts updated Before running Timeout callback:: count: 0 //// [/user/username/projects/myproject/c.ts] export class a { prop = "hello"; foo() { return this.prop; } } @@ -326,7 +330,6 @@ export class a { prop = "hello"; foo() { return this.prop; } } After running Timeout callback:: count: 0 -Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/c.ts created Before request Info seq [hh:mm:ss:mss] request: @@ -367,13 +370,13 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 9, "path": "/user/username/projects/myproject/c.ts" } } -Custom watchFile: 9: /user/username/projects/myproject/c.ts +Custom watchFile:: Added:: {"id":9,"path":"/user/username/projects/myproject/c.ts"} Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) @@ -417,11 +420,12 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background /user/username/projects/myproject/a.ts Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", + "event": "projectsUpdatedInBackground", "body": { "openFiles": [ "/user/username/projects/myproject/a.ts" @@ -430,27 +434,27 @@ Info seq [hh:mm:ss:mss] event: } After running Timeout callback:: count: 0 -Custom WatchedFiles:: +PolledWatches:: /a/lib/lib.d.ts: - {"id":6,"path":"/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"/a/lib/lib.d.ts"}} /user/username/projects/myproject/b.ts: - {"id":3,"path":"/user/username/projects/myproject/b.ts"} + {"event":{"id":3,"path":"/user/username/projects/myproject/b.ts"}} /user/username/projects/myproject/c.ts: *new* - {"id":9,"path":"/user/username/projects/myproject/c.ts"} + {"event":{"id":9,"path":"/user/username/projects/myproject/c.ts"}} /user/username/projects/myproject/m.ts: - {"id":4,"path":"/user/username/projects/myproject/m.ts"} + {"event":{"id":4,"path":"/user/username/projects/myproject/m.ts"}} /user/username/projects/myproject/tsconfig.json: - {"id":1,"path":"/user/username/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"/user/username/projects/myproject/tsconfig.json"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: /user/username/projects/myproject: - {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}} /user/username/projects/myproject/node_modules: - {"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true}} /user/username/projects/myproject/node_modules/@types: - {"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} /user/username/projects/node_modules/@types: - {"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} Projects:: /user/username/projects/myproject/tsconfig.json (Configured) *changed* @@ -484,7 +488,8 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json -Change File: /user/username/projects/myproject/b.ts +Custom watchFile:: Triggered:: {"id":3,"path":"/user/username/projects/myproject/b.ts"}:: /user/username/projects/myproject/b.ts updated +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/b.ts updated Before running Timeout callback:: count: 0 //// [/user/username/projects/myproject/b.ts] export class a { prop = "hello"; foo() { return this.prop; } } @@ -492,8 +497,6 @@ export class a { prop = "hello"; foo() { return this.prop; } } After running Timeout callback:: count: 0 -Custom watch:: /user/username/projects/myproject/b.ts /user/username/projects/myproject/b.ts updated -Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/b.ts updated Before request Info seq [hh:mm:ss:mss] request: @@ -585,11 +588,12 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background /user/username/projects/myproject/a.ts Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", + "event": "projectsUpdatedInBackground", "body": { "openFiles": [ "/user/username/projects/myproject/a.ts" @@ -647,12 +651,12 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::closeFileWatcher", + "event": "closeFileWatcher", "body": { "id": 3 } } -Custom watchFile:: Close:: 3: /user/username/projects/myproject/b.ts +Custom watchFile:: Close:: {"id":3,"path":"/user/username/projects/myproject/b.ts"} Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /user/username/projects/myproject/b.ts ProjectRootPath: undefined:: Result: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -673,29 +677,29 @@ Info seq [hh:mm:ss:mss] response: } After request -Custom WatchedFiles:: +PolledWatches:: /a/lib/lib.d.ts: - {"id":6,"path":"/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"/a/lib/lib.d.ts"}} /user/username/projects/myproject/c.ts: - {"id":9,"path":"/user/username/projects/myproject/c.ts"} + {"event":{"id":9,"path":"/user/username/projects/myproject/c.ts"}} /user/username/projects/myproject/m.ts: - {"id":4,"path":"/user/username/projects/myproject/m.ts"} + {"event":{"id":4,"path":"/user/username/projects/myproject/m.ts"}} /user/username/projects/myproject/tsconfig.json: - {"id":1,"path":"/user/username/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"/user/username/projects/myproject/tsconfig.json"}} -Custom WatchedFiles *deleted*:: +PolledWatches *deleted*:: /user/username/projects/myproject/b.ts: - {"id":3,"path":"/user/username/projects/myproject/b.ts"} + {"event":{"id":3,"path":"/user/username/projects/myproject/b.ts"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: /user/username/projects/myproject: - {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}} /user/username/projects/myproject/node_modules: - {"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true}} /user/username/projects/myproject/node_modules/@types: - {"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} /user/username/projects/node_modules/@types: - {"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} ScriptInfos:: /a/lib/lib.d.ts @@ -740,13 +744,13 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 10, "path": "/user/username/projects/myproject/b.ts" } } -Custom watchFile: 10: /user/username/projects/myproject/b.ts +Custom watchFile:: Added:: {"id":10,"path":"/user/username/projects/myproject/b.ts"} Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -764,27 +768,27 @@ Info seq [hh:mm:ss:mss] response: } After request -Custom WatchedFiles:: +PolledWatches:: /a/lib/lib.d.ts: - {"id":6,"path":"/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"/a/lib/lib.d.ts"}} /user/username/projects/myproject/b.ts: *new* - {"id":10,"path":"/user/username/projects/myproject/b.ts"} + {"event":{"id":10,"path":"/user/username/projects/myproject/b.ts"}} /user/username/projects/myproject/c.ts: - {"id":9,"path":"/user/username/projects/myproject/c.ts"} + {"event":{"id":9,"path":"/user/username/projects/myproject/c.ts"}} /user/username/projects/myproject/m.ts: - {"id":4,"path":"/user/username/projects/myproject/m.ts"} + {"event":{"id":4,"path":"/user/username/projects/myproject/m.ts"}} /user/username/projects/myproject/tsconfig.json: - {"id":1,"path":"/user/username/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"/user/username/projects/myproject/tsconfig.json"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: /user/username/projects/myproject: - {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}} /user/username/projects/myproject/node_modules: - {"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true}} /user/username/projects/myproject/node_modules/@types: - {"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} /user/username/projects/node_modules/@types: - {"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} ScriptInfos:: /a/lib/lib.d.ts @@ -813,7 +817,8 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json -Change File: /user/username/projects/myproject/c.ts +Custom watchFile:: Triggered:: {"id":9,"path":"/user/username/projects/myproject/c.ts"}:: /user/username/projects/myproject/c.ts updated +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/c.ts updated Before running Timeout callback:: count: 0 //// [/user/username/projects/myproject/c.ts] export class a { prop = "hello"; foo() { return this.prop; } }export const y = 20; @@ -821,8 +826,6 @@ export class a { prop = "hello"; foo() { return this.prop; } }export const y = 2 After running Timeout callback:: count: 0 -Custom watch:: /user/username/projects/myproject/c.ts /user/username/projects/myproject/c.ts updated -Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/c.ts updated Before request Info seq [hh:mm:ss:mss] request: @@ -914,11 +917,12 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background /user/username/projects/myproject/a.ts Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", + "event": "projectsUpdatedInBackground", "body": { "openFiles": [ "/user/username/projects/myproject/a.ts" @@ -960,169 +964,8 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json -update with npm install -Before running Timeout callback:: count: 0 -//// [/user/username/projects/myproject/node_modules/something/index.d.ts] -export const x = 10;export const y = 20; - - -After running Timeout callback:: count: 0 - -Custom watch:: /user/username/projects/myproject/node_modules /user/username/projects/myproject/node_modules/something/index.d.ts updated -Before request - -Info seq [hh:mm:ss:mss] request: - { - "command": "watchChange", - "arguments": { - "id": 5, - "updated": [ - "/user/username/projects/myproject/node_modules/something/index.d.ts" - ] - }, - "seq": 7, - "type": "request" - } -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache -Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations -After request - -Timeout callback:: count: 3 -7: /user/username/projects/myproject/tsconfig.json *new* -8: *ensureProjectForOpenFiles* *new* -9: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation *new* - -Projects:: -/user/username/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 5 *changed* - projectProgramVersion: 2 - dirty: true *changed* - -ScriptInfos:: -/a/lib/lib.d.ts - version: Text-1 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json -/user/username/projects/myproject/a.ts (Open) - version: SVC-1-0 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json *default* -/user/username/projects/myproject/b.ts - version: Text-2 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json -/user/username/projects/myproject/c.ts - version: Text-2 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json -/user/username/projects/myproject/m.ts - version: Text-1 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json -/user/username/projects/myproject/node_modules/something/index.d.ts *changed* - version: Text-1 - pendingReloadFromDisk: true *changed* - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json - -Before running Timeout callback:: count: 3 -7: /user/username/projects/myproject/tsconfig.json -8: *ensureProjectForOpenFiles* -9: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation - -Info seq [hh:mm:ss:mss] Running: /user/username/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one -Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 5 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) - /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" - /user/username/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" - /user/username/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" - /user/username/projects/myproject/node_modules/something/index.d.ts Text-2 "export const x = 10;export const y = 20;" - /user/username/projects/myproject/m.ts Text-1 "import { x } from \"something\"" - /user/username/projects/myproject/c.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;" - -Info seq [hh:mm:ss:mss] ----------------------------------------------- -After running Timeout callback:: count: 1 - -Timeout callback:: count: 1 -8: *ensureProjectForOpenFiles* *deleted* -9: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation *deleted* -10: *ensureProjectForOpenFiles* *new* - -Projects:: -/user/username/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 5 - projectProgramVersion: 3 *changed* - dirty: false *changed* - -ScriptInfos:: -/a/lib/lib.d.ts - version: Text-1 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json -/user/username/projects/myproject/a.ts (Open) - version: SVC-1-0 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json *default* -/user/username/projects/myproject/b.ts - version: Text-2 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json -/user/username/projects/myproject/c.ts - version: Text-2 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json -/user/username/projects/myproject/m.ts - version: Text-1 - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json -/user/username/projects/myproject/node_modules/something/index.d.ts *changed* - version: Text-2 *changed* - pendingReloadFromDisk: false *changed* - containingProjects: 1 - /user/username/projects/myproject/tsconfig.json - -Before running Timeout callback:: count: 1 -10: *ensureProjectForOpenFiles* - -Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* -Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: -Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) - -Info seq [hh:mm:ss:mss] ----------------------------------------------- -Info seq [hh:mm:ss:mss] Open files: -Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: -Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) - -Info seq [hh:mm:ss:mss] ----------------------------------------------- -Info seq [hh:mm:ss:mss] Open files: -Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] event: - { - "seq": 0, - "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", - "body": { - "openFiles": [ - "/user/username/projects/myproject/a.ts" - ] - } - } -After running Timeout callback:: count: 0 - -Add file: /user/username/projects/myproject/d.ts +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/d.ts created +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/d.ts updated Before running Timeout callback:: count: 0 //// [/user/username/projects/myproject/d.ts] export class a { prop = "hello"; foo() { return this.prop; } } @@ -1130,7 +973,8 @@ export class a { prop = "hello"; foo() { return this.prop; } } After running Timeout callback:: count: 0 -Change File: /user/username/projects/myproject/c.ts +Custom watchFile:: Triggered:: {"id":9,"path":"/user/username/projects/myproject/c.ts"}:: /user/username/projects/myproject/c.ts updated +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/c.ts updated Before running Timeout callback:: count: 0 //// [/user/username/projects/myproject/c.ts] export class a { prop = "hello"; foo() { return this.prop; } }export const y = 20;export const z = 30; @@ -1138,7 +982,8 @@ export class a { prop = "hello"; foo() { return this.prop; } }export const y = 2 After running Timeout callback:: count: 0 -Add File: /user/username/projects/myproject/e.ts +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/e.ts created +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/e.ts updated Before running Timeout callback:: count: 0 //// [/user/username/projects/myproject/e.ts] export class a { prop = "hello"; foo() { return this.prop; } } @@ -1146,10 +991,6 @@ export class a { prop = "hello"; foo() { return this.prop; } } After running Timeout callback:: count: 0 -Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/d.ts created -Custom watch:: /user/username/projects/myproject/c.ts /user/username/projects/myproject/c.ts updated -Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/c.ts updated -Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/e.ts created Before request Info seq [hh:mm:ss:mss] request: @@ -1170,7 +1011,7 @@ Info seq [hh:mm:ss:mss] request: ] } ], - "seq": 8, + "seq": 7, "type": "request" } Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /user/username/projects/myproject/d.ts :: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory @@ -1188,13 +1029,13 @@ Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /user/userna After request Timeout callback:: count: 2 -15: /user/username/projects/myproject/tsconfig.json *new* -16: *ensureProjectForOpenFiles* *new* +11: /user/username/projects/myproject/tsconfig.json *new* +12: *ensureProjectForOpenFiles* *new* Projects:: /user/username/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 6 *changed* - projectProgramVersion: 3 + projectStateVersion: 5 *changed* + projectProgramVersion: 2 dirty: true *changed* ScriptInfos:: @@ -1220,13 +1061,13 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json /user/username/projects/myproject/node_modules/something/index.d.ts - version: Text-2 + version: Text-1 containingProjects: 1 /user/username/projects/myproject/tsconfig.json Before running Timeout callback:: count: 2 -15: /user/username/projects/myproject/tsconfig.json -16: *ensureProjectForOpenFiles* +11: /user/username/projects/myproject/tsconfig.json +12: *ensureProjectForOpenFiles* Info seq [hh:mm:ss:mss] Running: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/d.ts 500 undefined WatchType: Closed Script info @@ -1234,33 +1075,33 @@ Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 11, "path": "/user/username/projects/myproject/d.ts" } } -Custom watchFile: 11: /user/username/projects/myproject/d.ts +Custom watchFile:: Added:: {"id":11,"path":"/user/username/projects/myproject/d.ts"} Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/e.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::createFileWatcher", + "event": "createFileWatcher", "body": { "id": 12, "path": "/user/username/projects/myproject/e.ts" } } -Custom watchFile: 12: /user/username/projects/myproject/e.ts +Custom watchFile:: Added:: {"id":12,"path":"/user/username/projects/myproject/e.ts"} Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json -Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 6 projectProgramVersion: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 5 projectProgramVersion: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (8) /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" /user/username/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" /user/username/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" - /user/username/projects/myproject/node_modules/something/index.d.ts Text-2 "export const x = 10;export const y = 20;" + /user/username/projects/myproject/node_modules/something/index.d.ts Text-1 "export const x = 10;" /user/username/projects/myproject/m.ts Text-1 "import { x } from \"something\"" /user/username/projects/myproject/c.ts Text-3 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;export const z = 30;" /user/username/projects/myproject/d.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" @@ -1302,11 +1143,12 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background /user/username/projects/myproject/a.ts Info seq [hh:mm:ss:mss] event: { "seq": 0, "type": "event", - "event": "CustomHandler::projectsUpdatedInBackground", + "event": "projectsUpdatedInBackground", "body": { "openFiles": [ "/user/username/projects/myproject/a.ts" @@ -1315,36 +1157,36 @@ Info seq [hh:mm:ss:mss] event: } After running Timeout callback:: count: 0 -Custom WatchedFiles:: +PolledWatches:: /a/lib/lib.d.ts: - {"id":6,"path":"/a/lib/lib.d.ts"} + {"event":{"id":6,"path":"/a/lib/lib.d.ts"}} /user/username/projects/myproject/b.ts: - {"id":10,"path":"/user/username/projects/myproject/b.ts"} + {"event":{"id":10,"path":"/user/username/projects/myproject/b.ts"}} /user/username/projects/myproject/c.ts: - {"id":9,"path":"/user/username/projects/myproject/c.ts"} + {"event":{"id":9,"path":"/user/username/projects/myproject/c.ts"}} /user/username/projects/myproject/d.ts: *new* - {"id":11,"path":"/user/username/projects/myproject/d.ts"} + {"event":{"id":11,"path":"/user/username/projects/myproject/d.ts"}} /user/username/projects/myproject/e.ts: *new* - {"id":12,"path":"/user/username/projects/myproject/e.ts"} + {"event":{"id":12,"path":"/user/username/projects/myproject/e.ts"}} /user/username/projects/myproject/m.ts: - {"id":4,"path":"/user/username/projects/myproject/m.ts"} + {"event":{"id":4,"path":"/user/username/projects/myproject/m.ts"}} /user/username/projects/myproject/tsconfig.json: - {"id":1,"path":"/user/username/projects/myproject/tsconfig.json"} + {"event":{"id":1,"path":"/user/username/projects/myproject/tsconfig.json"}} -Custom WatchedDirectoriesRecursive:: +FsWatchesRecursive:: /user/username/projects/myproject: - {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true} + {"event":{"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}} /user/username/projects/myproject/node_modules: - {"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true} + {"event":{"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true}} /user/username/projects/myproject/node_modules/@types: - {"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":7,"path":"/user/username/projects/myproject/node_modules/@types","recursive":true,"ignoreUpdate":true}} /user/username/projects/node_modules/@types: - {"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true} + {"event":{"id":8,"path":"/user/username/projects/node_modules/@types","recursive":true,"ignoreUpdate":true}} Projects:: /user/username/projects/myproject/tsconfig.json (Configured) *changed* - projectStateVersion: 6 - projectProgramVersion: 4 *changed* + projectStateVersion: 5 + projectProgramVersion: 3 *changed* dirty: false *changed* ScriptInfos:: @@ -1378,6 +1220,187 @@ ScriptInfos:: containingProjects: 1 /user/username/projects/myproject/tsconfig.json /user/username/projects/myproject/node_modules/something/index.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json + +Custom watchDirectory:: Triggered:: {"id":5,"path":"/user/username/projects/myproject/node_modules","recursive":true}:: /user/username/projects/myproject/node_modules/something/index.d.ts updated +Custom watchDirectory:: Triggered Ignored:: {"id":2,"path":"/user/username/projects/myproject","recursive":true,"ignoreUpdate":true}:: /user/username/projects/myproject/node_modules/something/index.d.ts updated +Before running Timeout callback:: count: 0 +//// [/user/username/projects/myproject/node_modules/something/index.d.ts] +export const x = 10;export const y = 20; + + +After running Timeout callback:: count: 0 + +Before request + +Info seq [hh:mm:ss:mss] request: + { + "command": "watchChange", + "arguments": { + "id": 5, + "updated": [ + "/user/username/projects/myproject/node_modules/something/index.d.ts" + ] + }, + "seq": 8, + "type": "request" + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache +Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Scheduled: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/something/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +After request + +Timeout callback:: count: 3 +13: /user/username/projects/myproject/tsconfig.json *new* +14: *ensureProjectForOpenFiles* *new* +15: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation *new* + +Projects:: +/user/username/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 6 *changed* + projectProgramVersion: 3 + dirty: true *changed* + +ScriptInfos:: +/a/lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/a.ts (Open) + version: SVC-1-0 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json *default* +/user/username/projects/myproject/b.ts + version: Text-2 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/c.ts + version: Text-3 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/e.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/m.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/node_modules/something/index.d.ts *changed* + version: Text-1 + pendingReloadFromDisk: true *changed* + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json + +Before running Timeout callback:: count: 3 +13: /user/username/projects/myproject/tsconfig.json +14: *ensureProjectForOpenFiles* +15: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation + +Info seq [hh:mm:ss:mss] Running: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 6 projectProgramVersion: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (8) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/myproject/a.ts SVC-1-0 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/b.ts Text-2 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/node_modules/something/index.d.ts Text-2 "export const x = 10;export const y = 20;" + /user/username/projects/myproject/m.ts Text-1 "import { x } from \"something\"" + /user/username/projects/myproject/c.ts Text-3 "export class a { prop = \"hello\"; foo() { return this.prop; } }export const y = 20;export const z = 30;" + /user/username/projects/myproject/d.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + /user/username/projects/myproject/e.ts Text-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +After running Timeout callback:: count: 1 + +Timeout callback:: count: 1 +14: *ensureProjectForOpenFiles* *deleted* +15: /user/username/projects/myproject/tsconfig.jsonFailedLookupInvalidation *deleted* +16: *ensureProjectForOpenFiles* *new* + +Projects:: +/user/username/projects/myproject/tsconfig.json (Configured) *changed* + projectStateVersion: 6 + projectProgramVersion: 4 *changed* + dirty: false *changed* + +ScriptInfos:: +/a/lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/a.ts (Open) + version: SVC-1-0 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json *default* +/user/username/projects/myproject/b.ts version: Text-2 containingProjects: 1 /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/c.ts + version: Text-3 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/d.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/e.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/m.ts + version: Text-1 + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json +/user/username/projects/myproject/node_modules/something/index.d.ts *changed* + version: Text-2 *changed* + pendingReloadFromDisk: false *changed* + containingProjects: 1 + /user/username/projects/myproject/tsconfig.json + +Before running Timeout callback:: count: 1 +16: *ensureProjectForOpenFiles* + +Info seq [hh:mm:ss:mss] Running: *ensureProjectForOpenFiles* +Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (8) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: +Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (8) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] got projects updated in background /user/username/projects/myproject/a.ts +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectsUpdatedInBackground", + "body": { + "openFiles": [ + "/user/username/projects/myproject/a.ts" + ] + } + } +After running Timeout callback:: count: 0