Watch events enhancements (#57950)

This commit is contained in:
Sheetal Nandi 2024-03-27 13:36:45 -07:00 committed by GitHub
parent 6b4eec4aca
commit c87b5bcab9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 1192 additions and 135 deletions

View File

@ -933,7 +933,16 @@ function createWatchFactoryHostUsingWatchEvents(service: ProjectService, canUseW
recursive ? watchedDirectoriesRecursive : watchedDirectories,
path,
callback,
id => ({ eventName: CreateDirectoryWatcherEvent, data: { id, path, recursive: !!recursive } }),
id => ({
eventName: CreateDirectoryWatcherEvent,
data: {
id,
path,
recursive: !!recursive,
// Special case node_modules as we watch it for changes to closed script infos as well
ignoreUpdate: !path.endsWith("/node_modules") ? true : undefined,
},
}),
);
}
function getOrCreateFileWatcher<T>(
@ -963,37 +972,32 @@ function createWatchFactoryHostUsingWatchEvents(service: ProjectService, canUseW
},
};
}
function onWatchChange({ id, path, eventType }: protocol.WatchChangeRequestArgs) {
// console.log(`typescript-vscode-watcher:: Invoke:: ${id}:: ${path}:: ${eventType}`);
onFileWatcherCallback(id, path, eventType);
onDirectoryWatcherCallback(watchedDirectories, id, path, eventType);
onDirectoryWatcherCallback(watchedDirectoriesRecursive, id, path, eventType);
function onWatchChange(args: protocol.WatchChangeRequestArgs | readonly protocol.WatchChangeRequestArgs[]) {
if (isArray(args)) args.forEach(onWatchChangeRequestArgs);
else onWatchChangeRequestArgs(args);
}
function onFileWatcherCallback(
id: number,
eventPath: string,
eventType: "create" | "delete" | "update",
) {
watchedFiles.idToCallbacks.get(id)?.forEach(callback => {
const eventKind = eventType === "create" ?
FileWatcherEventKind.Created :
eventType === "delete" ?
FileWatcherEventKind.Deleted :
FileWatcherEventKind.Changed;
callback(eventPath, eventKind);
});
function onWatchChangeRequestArgs({ id, created, deleted, updated }: protocol.WatchChangeRequestArgs) {
onWatchEventType(id, created, FileWatcherEventKind.Created);
onWatchEventType(id, deleted, FileWatcherEventKind.Deleted);
onWatchEventType(id, updated, FileWatcherEventKind.Changed);
}
function onDirectoryWatcherCallback(
{ idToCallbacks }: HostWatcherMap<DirectoryWatcherCallback>,
function onWatchEventType(id: number, paths: readonly string[] | undefined, eventKind: FileWatcherEventKind) {
if (!paths?.length) return;
forEachCallback(watchedFiles, id, paths, (callback, eventPath) => callback(eventPath, eventKind));
forEachCallback(watchedDirectories, id, paths, (callback, eventPath) => callback(eventPath));
forEachCallback(watchedDirectoriesRecursive, id, paths, (callback, eventPath) => callback(eventPath));
}
function forEachCallback<T>(
hostWatcherMap: HostWatcherMap<T>,
id: number,
eventPath: string,
eventType: "create" | "delete" | "update",
eventPaths: readonly string[],
cb: (callback: T, eventPath: string) => void,
) {
if (eventType === "update") return;
idToCallbacks.get(id)?.forEach(callback => {
callback(eventPath);
hostWatcherMap.idToCallbacks.get(id)?.forEach(callback => {
eventPaths.forEach(eventPath => cb(callback, eventPath));
});
}
}

View File

@ -1849,13 +1849,13 @@ export interface CloseRequest extends FileRequest {
export interface WatchChangeRequest extends Request {
command: CommandTypes.WatchChange;
arguments: WatchChangeRequestArgs;
arguments: WatchChangeRequestArgs | readonly WatchChangeRequestArgs[];
}
export interface WatchChangeRequestArgs {
id: number;
path: string;
eventType: "create" | "delete" | "update";
created?: string[];
deleted?: string[];
updated?: string[];
}
/**
@ -2656,6 +2656,7 @@ export interface CreateDirectoryWatcherEventBody {
readonly id: number;
readonly path: string;
readonly recursive: boolean;
readonly ignoreUpdate?: boolean;
}
export type CloseFileWatcherEventName = "closeFileWatcher";

View File

@ -4,6 +4,7 @@ import {
} from "../../../../harness/tsserverLogger";
import {
createWatchUtils,
Watches,
WatchUtils,
} from "../../../../harness/watchUtils";
import * as ts from "../../../_namespaces/ts";
@ -60,11 +61,11 @@ describe("unittests:: tsserver:: events:: watchEvents", () => {
}
function watchDirectory(data: ts.server.protocol.CreateDirectoryWatcherEventBody) {
logger.log(`Custom watchDirectory: ${data.id}: ${data.path} ${data.recursive}`);
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}`);
logger.log(`Custom watchDirectory:: Close:: ${data.id}: ${data.path} ${data.recursive} ${data.ignoreUpdate}`);
result.close();
});
}
@ -89,37 +90,132 @@ describe("unittests:: tsserver:: events:: watchEvents", () => {
}
}
function updateFileOnHost(session: TestSession, file: string, log: string) {
function updateFileOnHost(session: TestSession, file: string, log: string, content?: string) {
// Change b.ts
session.logger.log(log);
session.host.writeFile(file, session.host.readFile("/user/username/projects/myproject/a.ts")!);
session.logger.log(`${log}: ${file}`);
if (content) session.host.appendFile(file, content);
else session.host.writeFile(file, session.host.readFile("/user/username/projects/myproject/a.ts")!);
session.host.runQueuedTimeoutCallbacks();
}
function collectWatchChanges<T extends ts.server.protocol.CreateFileWatcherEventBody | ts.server.protocol.CreateDirectoryWatcherEventBody>(
session: TestSession,
watches: Watches<T>,
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",
) {
return collectWatchChanges(
session,
(session.logger.host as TestServerHostWithCustomWatch).factoryData.watchUtils.pollingWatches,
file,
file,
eventType,
);
}
function invokeWatchChange(
session: TestSession,
...args: (ts.server.protocol.WatchChangeRequestArgs[] | undefined)[]
) {
let result: Map<number, ts.server.protocol.WatchChangeRequestArgs> | 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<ts.server.protocol.WatchChangeRequest>({
command: ts.server.protocol.CommandTypes.WatchChange,
arguments: ts.singleOrMany(ts.arrayFrom(result.values())),
});
}
}
function addFile(session: TestSession, path: string) {
updateFileOnHost(session, path, "Add file");
session.logger.log("Custom watch");
(session.logger.host as TestServerHostWithCustomWatch).factoryData.watchUtils.fsWatchesRecursive.forEach(
"/user/username/projects/myproject",
data =>
session.executeCommandSeq<ts.server.protocol.WatchChangeRequest>({
command: ts.server.protocol.CommandTypes.WatchChange,
arguments: { id: data.id, path, eventType: "create" },
}),
invokeWatchChange(
session,
collectDirectoryWatcherChanges(session, "/user/username/projects/myproject", path, "created"),
);
session.host.runQueuedTimeoutCallbacks();
}
function changeFile(session: TestSession, path: string) {
updateFileOnHost(session, path, "Change File");
session.logger.log("Custom watch");
(session.logger.host as TestServerHostWithCustomWatch).factoryData.watchUtils.pollingWatches.forEach(
path,
data =>
session.executeCommandSeq<ts.server.protocol.WatchChangeRequest>({
command: ts.server.protocol.CommandTypes.WatchChange,
arguments: { id: data.id, path, eventType: "update" },
}),
function changeFile(session: TestSession, path: string, content?: string) {
updateFileOnHost(session, path, "Change File", content);
invokeWatchChange(
session,
collectFileWatcherChanges(session, path, "updated"),
collectDirectoryWatcherChanges(session, ts.getDirectoryPath(path), 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();
}
@ -129,6 +225,8 @@ describe("unittests:: tsserver:: events:: watchEvents", () => {
"/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,
});
const logger = createLoggerWithInMemoryLogs(inputHost);
@ -153,6 +251,26 @@ describe("unittests:: tsserver:: events:: watchEvents", () => {
// 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) {
@ -192,9 +310,15 @@ describe("unittests:: tsserver:: events:: watchEvents", () => {
logger.msg = (s, type) => logger.info(`${type}:: ${s}`);
session.executeCommandSeq<ts.server.protocol.WatchChangeRequest>({
command: ts.server.protocol.CommandTypes.WatchChange,
arguments: { id: 1, path: "/user/username/projects/myproject/b.ts", eventType: "update" },
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);
});
});

View File

@ -1342,12 +1342,13 @@ declare namespace ts {
}
export interface WatchChangeRequest extends Request {
command: CommandTypes.WatchChange;
arguments: WatchChangeRequestArgs;
arguments: WatchChangeRequestArgs | readonly WatchChangeRequestArgs[];
}
export interface WatchChangeRequestArgs {
id: number;
path: string;
eventType: "create" | "delete" | "update";
created?: string[];
deleted?: string[];
updated?: string[];
}
/**
* Request to obtain the list of files that should be regenerated if target file is recompiled.
@ -2032,6 +2033,7 @@ declare namespace ts {
readonly id: number;
readonly path: string;
readonly recursive: boolean;
readonly ignoreUpdate?: boolean;
}
export type CloseFileWatcherEventName = "closeFileWatcher";
export interface CloseFileWatcherEvent extends Event {

View File

@ -10,6 +10,12 @@ 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;
//// [/a/lib/lib.d.ts]
/// <reference no-default-lib="true"/>
interface Boolean {}
@ -40,7 +46,8 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/project
Info seq [hh:mm:ss:mss] Config: /user/username/projects/myproject/tsconfig.json : {
"rootNames": [
"/user/username/projects/myproject/a.ts",
"/user/username/projects/myproject/b.ts"
"/user/username/projects/myproject/b.ts",
"/user/username/projects/myproject/m.ts"
],
"options": {
"configFilePath": "/user/username/projects/myproject/tsconfig.json"
@ -49,18 +56,25 @@ Info seq [hh:mm:ss:mss] Config: /user/username/projects/myproject/tsconfig.json
Info seq [hh:mm:ss:mss] 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] 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] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/m.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] 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] 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] 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
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] 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)
Info seq [hh:mm:ss:mss] Files (3)
Info seq [hh:mm:ss:mss] Files (5)
/a/lib/lib.d.ts Text-1 "/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { 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-1 "export class b { 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\""
../../../../a/lib/lib.d.ts
@ -69,10 +83,14 @@ Info seq [hh:mm:ss:mss] Files (3)
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 '**/*'
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
Info seq [hh:mm:ss:mss] Files (5)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
@ -95,12 +113,16 @@ FsWatches::
{}
/user/username/projects/myproject/b.ts: *new*
{}
/user/username/projects/myproject/m.ts: *new*
{}
/user/username/projects/myproject/tsconfig.json: *new*
{}
FsWatchesRecursive::
/user/username/projects/myproject: *new*
{}
/user/username/projects/myproject/node_modules: *new*
{}
Projects::
/user/username/projects/myproject/tsconfig.json (Configured) *new*
@ -120,8 +142,16 @@ ScriptInfos::
version: Text-1
containingProjects: 1
/user/username/projects/myproject/tsconfig.json
/user/username/projects/myproject/m.ts *new*
version: Text-1
containingProjects: 1
/user/username/projects/myproject/tsconfig.json
/user/username/projects/myproject/node_modules/something/index.d.ts *new*
version: Text-1
containingProjects: 1
/user/username/projects/myproject/tsconfig.json
Add file
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*
@ -148,10 +178,12 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/project
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)
Info seq [hh:mm:ss:mss] Files (4)
Info seq [hh:mm:ss:mss] Files (6)
/a/lib/lib.d.ts Text-1 "/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { 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-1 "export class b { 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-1 "export class a { prop = \"hello\"; foo() { return this.prop; } }"
@ -161,6 +193,10 @@ Info seq [hh:mm:ss:mss] Files (4)
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 '**/*'
@ -168,7 +204,7 @@ 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 (4)
Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
@ -176,7 +212,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 (4)
Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
@ -197,12 +233,16 @@ FsWatches::
{}
/user/username/projects/myproject/c.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*
@ -227,13 +267,21 @@ ScriptInfos::
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
Custom watch
Custom watch:: /user/username/projects/myproject /user/username/projects/myproject/c.ts created
Before running Timeout callback:: count: 0
After running Timeout callback:: count: 0
Change File
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*
@ -273,22 +321,32 @@ ScriptInfos::
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] 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: 3 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 (4)
Info seq [hh:mm:ss:mss] Files (6)
/a/lib/lib.d.ts Text-1 "/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { 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-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 (4)
Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
@ -296,7 +354,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 (4)
Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
@ -328,8 +386,17 @@ ScriptInfos::
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
Custom watch
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 running Timeout callback:: count: 0
After running Timeout callback:: count: 0
@ -349,7 +416,7 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /user/username/project
Info seq [hh:mm:ss:mss] Search path: /user/username/projects/myproject
Info seq [hh:mm:ss:mss] For info: /user/username/projects/myproject/b.ts :: Config file name: /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 (4)
Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
@ -374,6 +441,8 @@ FsWatches::
{}
/user/username/projects/myproject/c.ts:
{}
/user/username/projects/myproject/m.ts:
{}
/user/username/projects/myproject/tsconfig.json:
{}
@ -384,6 +453,8 @@ FsWatches *deleted*::
FsWatchesRecursive::
/user/username/projects/myproject:
{}
/user/username/projects/myproject/node_modules:
{}
ScriptInfos::
/a/lib/lib.d.ts
@ -403,6 +474,14 @@ ScriptInfos::
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
Before request
@ -417,7 +496,7 @@ Info seq [hh:mm:ss:mss] request:
}
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] Project '/user/username/projects/myproject/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (4)
Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
@ -442,12 +521,16 @@ FsWatches::
{}
/user/username/projects/myproject/c.ts:
{}
/user/username/projects/myproject/m.ts:
{}
/user/username/projects/myproject/tsconfig.json:
{}
FsWatchesRecursive::
/user/username/projects/myproject:
{}
/user/username/projects/myproject/node_modules:
{}
ScriptInfos::
/a/lib/lib.d.ts
@ -467,6 +550,14 @@ ScriptInfos::
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
Before request
@ -475,8 +566,9 @@ Info seq [hh:mm:ss:mss] request:
"command": "watchChange",
"arguments": {
"id": 1,
"path": "/user/username/projects/myproject/b.ts",
"eventType": "update"
"updated": [
"/user/username/projects/myproject/b.ts"
]
},
"seq": 4,
"type": "request"
@ -486,8 +578,9 @@ Info seq [hh:mm:ss:mss] Err:: Unrecognized JSON command:
"command": "watchChange",
"arguments": {
"id": 1,
"path": "/user/username/projects/myproject/b.ts",
"eventType": "update"
"updated": [
"/user/username/projects/myproject/b.ts"
]
},
"seq": 4,
"type": "request"
@ -509,3 +602,136 @@ Info seq [hh:mm:ss:mss] response:
"responseRequired": false
}
After request
Change File: /user/username/projects/myproject/c.ts
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 "/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { 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
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 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;
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 running Timeout callback:: count: 0
After running Timeout callback:: count: 0