From 5e3fa9b87b20f512c50676bf0f4b9acd01e45b2f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 3 Nov 2022 15:30:32 -0700 Subject: [PATCH] There is no use of creating reference map with --out since its not used anyways (#51379) * Convert some of the tests to baselines * There is no use of creating reference map with --out since its not used anyways. The changes to affectedFileList returned should be intended since --out needs saving just one file for correct output and not both --- src/compiler/builderState.ts | 4 +- .../unittests/tsserver/compileOnSave.ts | 200 +++---- ...quest-when-projectFile-is-not-specified.js | 513 ++++++++++++++++++ ...stRequest-when-projectFile-is-specified.js | 472 ++++++++++++++++ ...sesOutFile-should-be-true-if-out-is-set.js | 164 ++++++ ...utFile-should-be-true-if-outFile-is-set.js | 164 ++++++ ...tFile-should-not-be-returned-if-not-set.js | 164 ++++++ 7 files changed, 1562 insertions(+), 119 deletions(-) create mode 100644 tests/baselines/reference/tsserver/compileOnSave/CompileOnSaveAffectedFileListRequest-when-projectFile-is-not-specified.js create mode 100644 tests/baselines/reference/tsserver/compileOnSave/CompileOnSaveAffectedFileListRequest-when-projectFile-is-specified.js create mode 100644 tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-be-true-if-out-is-set.js create mode 100644 tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-be-true-if-outFile-is-set.js create mode 100644 tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-not-be-returned-if-not-set.js diff --git a/src/compiler/builderState.ts b/src/compiler/builderState.ts index de300efd3cf..511daca7b03 100644 --- a/src/compiler/builderState.ts +++ b/src/compiler/builderState.ts @@ -264,7 +264,9 @@ namespace ts { */ export function create(newProgram: Program, getCanonicalFileName: GetCanonicalFileName, oldState?: Readonly, disableUseFileVersionAsSignature?: boolean): BuilderState { const fileInfos = new Map(); - const referencedMap = newProgram.getCompilerOptions().module !== ModuleKind.None ? createManyToManyPathMap() : undefined; + const options = newProgram.getCompilerOptions(); + const referencedMap = options.module !== ModuleKind.None && !outFile(options) ? + createManyToManyPathMap() : undefined; const exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined; const useOldState = canReuseOldState(referencedMap, oldState); diff --git a/src/testRunner/unittests/tsserver/compileOnSave.ts b/src/testRunner/unittests/tsserver/compileOnSave.ts index d8ea2df4008..ffa2b4b1b93 100644 --- a/src/testRunner/unittests/tsserver/compileOnSave.ts +++ b/src/testRunner/unittests/tsserver/compileOnSave.ts @@ -592,51 +592,36 @@ namespace ts.projectSystem { }); describe("tsserverProjectSystem emit with outFile or out setting", () => { - function test(opts: CompilerOptions, expectedUsesOutFile: boolean) { - const f1 = { - path: "/a/a.ts", - content: "let x = 1" - }; - const f2 = { - path: "/a/b.ts", - content: "let y = 1" - }; - const config = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: opts, - compileOnSave: true - }) - }; - const host = createServerHost([f1, f2, config]); - const session = createSession(host); - session.executeCommand({ - seq: 1, - type: "request", - command: "open", - arguments: { file: f1.path } - } as protocol.OpenRequest); - checkNumberOfProjects(session.getProjectService(), { configuredProjects: 1 }); - const { response } = session.executeCommand({ - seq: 2, - type: "request", - command: "compileOnSaveAffectedFileList", - arguments: { file: f1.path } - } as protocol.CompileOnSaveAffectedFileListRequest); - assert.equal((response as protocol.CompileOnSaveAffectedFileListSingleProject[]).length, 1, "expected output for 1 project"); - assert.equal((response as protocol.CompileOnSaveAffectedFileListSingleProject[])[0].fileNames.length, 2, "expected output for 1 project"); - assert.equal((response as protocol.CompileOnSaveAffectedFileListSingleProject[])[0].projectUsesOutFile, expectedUsesOutFile, "usesOutFile"); + function test(subScenario: string, opts: CompilerOptions) { + it(subScenario, () => { + const f1 = { + path: "/a/a.ts", + content: "let x = 1" + }; + const f2 = { + path: "/a/b.ts", + content: "let y = 1" + }; + const config = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions: opts, + compileOnSave: true + }) + }; + const host = createServerHost([f1, f2, config]); + const session = createSession(host, { logger: createLoggerWithInMemoryLogs(host) }); + openFilesForSession([f1], session); + session.executeCommandSeq({ + command: protocol.CommandTypes.CompileOnSaveAffectedFileList, + arguments: { file: f1.path } + }); + baselineTsserverLogs("compileOnSave", subScenario, session); + }); } - - it("projectUsesOutFile should not be returned if not set", () => { - test({}, /*expectedUsesOutFile*/ false); - }); - it("projectUsesOutFile should be true if outFile is set", () => { - test({ outFile: "/a/out.js" }, /*expectedUsesOutFile*/ true); - }); - it("projectUsesOutFile should be true if out is set", () => { - test({ out: "/a/out.js" }, /*expectedUsesOutFile*/ true); - }); + test("compileOnSaveAffectedFileList projectUsesOutFile should not be returned if not set", {}); + test("compileOnSaveAffectedFileList projectUsesOutFile should be true if outFile is set", { outFile: "/a/out.js" }); + test("compileOnSaveAffectedFileList projectUsesOutFile should be true if out is set", { out: "/a/out.js" }); }); }); @@ -991,36 +976,6 @@ function bar() { }); describe("unittests:: tsserver:: compileOnSave:: CompileOnSaveAffectedFileListRequest with and without projectFileName in request", () => { - const core: File = { - path: `${tscWatch.projectRoot}/core/core.ts`, - content: "let z = 10;" - }; - const app1: File = { - path: `${tscWatch.projectRoot}/app1/app.ts`, - content: "let x = 10;" - }; - const app2: File = { - path: `${tscWatch.projectRoot}/app2/app.ts`, - content: "let y = 10;" - }; - const app1Config: File = { - path: `${tscWatch.projectRoot}/app1/tsconfig.json`, - content: JSON.stringify({ - files: ["app.ts", "../core/core.ts"], - compilerOptions: { outFile: "build/output.js" }, - compileOnSave: true - }) - }; - const app2Config: File = { - path: `${tscWatch.projectRoot}/app2/tsconfig.json`, - content: JSON.stringify({ - files: ["app.ts", "../core/core.ts"], - compilerOptions: { outFile: "build/output.js" }, - compileOnSave: true - }) - }; - const files = [libFile, core, app1, app2, app1Config, app2Config]; - function insertString(session: TestSession, file: File) { session.executeCommandSeq({ command: protocol.CommandTypes.Change, @@ -1035,53 +990,62 @@ function bar() { }); } - function getSession() { - const host = createServerHost(files); - const session = createSession(host); - openFilesForSession([app1, app2, core], session); - const service = session.getProjectService(); - checkNumberOfProjects(session.getProjectService(), { configuredProjects: 2 }); - const project1 = service.configuredProjects.get(app1Config.path)!; - const project2 = service.configuredProjects.get(app2Config.path)!; - checkProjectActualFiles(project1, [libFile.path, app1.path, core.path, app1Config.path]); - checkProjectActualFiles(project2, [libFile.path, app2.path, core.path, app2Config.path]); - insertString(session, app1); - insertString(session, app2); - assert.equal(project1.dirty, true); - assert.equal(project2.dirty, true); - return session; + function logDirtyOfProjects(session: TestSession) { + session.logger.logs.push(`Project1 is dirty: ${session.getProjectService().configuredProjects.get(`${tscWatch.projectRoot}/app1/tsconfig.json`)!.dirty}`); + session.logger.logs.push(`Project2 is dirty: ${session.getProjectService().configuredProjects.get(`${tscWatch.projectRoot}/app2/tsconfig.json`)!.dirty}`); } - it("when projectFile is specified", () => { - const session = getSession(); - const response = session.executeCommandSeq({ - command: protocol.CommandTypes.CompileOnSaveAffectedFileList, - arguments: { - file: core.path, - projectFileName: app1Config.path - } - }).response; - assert.deepEqual(response, [ - { projectFileName: app1Config.path, fileNames: [core.path, app1.path], projectUsesOutFile: true } - ]); - assert.equal(session.getProjectService().configuredProjects.get(app1Config.path)!.dirty, false); - assert.equal(session.getProjectService().configuredProjects.get(app2Config.path)!.dirty, true); + function verify(subScenario: string, commandArgs: protocol.FileRequestArgs) { + it(subScenario, () => { + const core: File = { + path: `${tscWatch.projectRoot}/core/core.ts`, + content: "let z = 10;" + }; + const app1: File = { + path: `${tscWatch.projectRoot}/app1/app.ts`, + content: "let x = 10;" + }; + const app2: File = { + path: `${tscWatch.projectRoot}/app2/app.ts`, + content: "let y = 10;" + }; + const app1Config: File = { + path: `${tscWatch.projectRoot}/app1/tsconfig.json`, + content: JSON.stringify({ + files: ["app.ts", "../core/core.ts"], + compilerOptions: { outFile: "build/output.js" }, + compileOnSave: true + }) + }; + const app2Config: File = { + path: `${tscWatch.projectRoot}/app2/tsconfig.json`, + content: JSON.stringify({ + files: ["app.ts", "../core/core.ts"], + compilerOptions: { outFile: "build/output.js" }, + compileOnSave: true + }) + }; + const files = [libFile, core, app1, app2, app1Config, app2Config]; + const host = createServerHost(files); + const session = createSession(host, { logger: createLoggerWithInMemoryLogs(host) }); + openFilesForSession([app1, app2, core], session); + insertString(session, app1); + insertString(session, app2); + logDirtyOfProjects(session); + session.executeCommandSeq({ + command: protocol.CommandTypes.CompileOnSaveAffectedFileList, + arguments: commandArgs + }); + logDirtyOfProjects(session); + baselineTsserverLogs("compileOnSave", subScenario, session); + }); + } + verify("CompileOnSaveAffectedFileListRequest when projectFile is specified", { + file: `${tscWatch.projectRoot}/core/core.ts`, + projectFileName: `${tscWatch.projectRoot}/app1/tsconfig.json` }); - - it("when projectFile is not specified", () => { - const session = getSession(); - const response = session.executeCommandSeq({ - command: protocol.CommandTypes.CompileOnSaveAffectedFileList, - arguments: { - file: core.path - } - }).response; - assert.deepEqual(response, [ - { projectFileName: app1Config.path, fileNames: [core.path, app1.path], projectUsesOutFile: true }, - { projectFileName: app2Config.path, fileNames: [core.path, app2.path], projectUsesOutFile: true } - ]); - assert.equal(session.getProjectService().configuredProjects.get(app1Config.path)!.dirty, false); - assert.equal(session.getProjectService().configuredProjects.get(app2Config.path)!.dirty, false); + verify("CompileOnSaveAffectedFileListRequest when projectFile is not specified", { + file: `${tscWatch.projectRoot}/core/core.ts`, }); }); } diff --git a/tests/baselines/reference/tsserver/compileOnSave/CompileOnSaveAffectedFileListRequest-when-projectFile-is-not-specified.js b/tests/baselines/reference/tsserver/compileOnSave/CompileOnSaveAffectedFileListRequest-when-projectFile-is-not-specified.js new file mode 100644 index 00000000000..fa1f2f0c356 --- /dev/null +++ b/tests/baselines/reference/tsserver/compileOnSave/CompileOnSaveAffectedFileListRequest-when-projectFile-is-not-specified.js @@ -0,0 +1,513 @@ +Info 0 [00:00:33.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Info 1 [00:00:34.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/app1/app.ts" + } + } +Before request +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/user/username/projects/myproject/core/core.ts] +let z = 10; + +//// [/user/username/projects/myproject/app1/app.ts] +let x = 10; + +//// [/user/username/projects/myproject/app2/app.ts] +let y = 10; + +//// [/user/username/projects/myproject/app1/tsconfig.json] +{"files":["app.ts","../core/core.ts"],"compilerOptions":{"outFile":"build/output.js"},"compileOnSave":true} + +//// [/user/username/projects/myproject/app2/tsconfig.json] +{"files":["app.ts","../core/core.ts"],"compilerOptions":{"outFile":"build/output.js"},"compileOnSave":true} + + +PolledWatches:: + +FsWatches:: + +FsWatchesRecursive:: + +Info 2 [00:00:35.000] Search path: /user/username/projects/myproject/app1 +Info 3 [00:00:36.000] For info: /user/username/projects/myproject/app1/app.ts :: Config file name: /user/username/projects/myproject/app1/tsconfig.json +Info 4 [00:00:37.000] Creating configuration project /user/username/projects/myproject/app1/tsconfig.json +Info 5 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app1/tsconfig.json 2000 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Config file +Info 6 [00:00:39.000] Config: /user/username/projects/myproject/app1/tsconfig.json : { + "rootNames": [ + "/user/username/projects/myproject/app1/app.ts", + "/user/username/projects/myproject/core/core.ts" + ], + "options": { + "outFile": "/user/username/projects/myproject/app1/build/output.js", + "configFilePath": "/user/username/projects/myproject/app1/tsconfig.json" + } +} +Info 7 [00:00:40.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/core/core.ts 500 undefined WatchType: Closed Script info +Info 8 [00:00:41.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/app1/tsconfig.json +Info 9 [00:00:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 10 [00:00:43.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app1/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Type roots +Info 11 [00:00:44.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app1/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Type roots +Info 12 [00:00:45.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Type roots +Info 13 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Type roots +Info 14 [00:00:47.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/app1/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:48.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 16 [00:00:49.000] Files (3) + /a/lib/lib.d.ts + /user/username/projects/myproject/app1/app.ts + /user/username/projects/myproject/core/core.ts + + + ../../../../../a/lib/lib.d.ts + Default library for target 'es3' + app.ts + Part of 'files' list in tsconfig.json + ../core/core.ts + Part of 'files' list in tsconfig.json + +Info 17 [00:00:50.000] ----------------------------------------------- +Info 18 [00:00:51.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 18 [00:00:52.000] Files (3) + +Info 18 [00:00:53.000] ----------------------------------------------- +Info 18 [00:00:54.000] Open files: +Info 18 [00:00:55.000] FileName: /user/username/projects/myproject/app1/app.ts ProjectRootPath: undefined +Info 18 [00:00:56.000] Projects: /user/username/projects/myproject/app1/tsconfig.json +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/user/username/projects/myproject/core/core.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: + +Info 18 [00:00:57.000] response: + { + "responseRequired": false + } +Info 19 [00:00:58.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/app2/app.ts" + } + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/user/username/projects/myproject/core/core.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: + +Info 20 [00:00:59.000] Search path: /user/username/projects/myproject/app2 +Info 21 [00:01:00.000] For info: /user/username/projects/myproject/app2/app.ts :: Config file name: /user/username/projects/myproject/app2/tsconfig.json +Info 22 [00:01:01.000] Creating configuration project /user/username/projects/myproject/app2/tsconfig.json +Info 23 [00:01:02.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app2/tsconfig.json 2000 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Config file +Info 24 [00:01:03.000] Config: /user/username/projects/myproject/app2/tsconfig.json : { + "rootNames": [ + "/user/username/projects/myproject/app2/app.ts", + "/user/username/projects/myproject/core/core.ts" + ], + "options": { + "outFile": "/user/username/projects/myproject/app2/build/output.js", + "configFilePath": "/user/username/projects/myproject/app2/tsconfig.json" + } +} +Info 25 [00:01:04.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/app2/tsconfig.json +Info 26 [00:01:05.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app2/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Type roots +Info 27 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app2/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Type roots +Info 28 [00:01:07.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Type roots +Info 29 [00:01:08.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Type roots +Info 30 [00:01:09.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/app2/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 31 [00:01:10.000] Project '/user/username/projects/myproject/app2/tsconfig.json' (Configured) +Info 32 [00:01:11.000] Files (3) + /a/lib/lib.d.ts + /user/username/projects/myproject/app2/app.ts + /user/username/projects/myproject/core/core.ts + + + ../../../../../a/lib/lib.d.ts + Default library for target 'es3' + app.ts + Part of 'files' list in tsconfig.json + ../core/core.ts + Part of 'files' list in tsconfig.json + +Info 33 [00:01:12.000] ----------------------------------------------- +Info 34 [00:01:13.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 34 [00:01:14.000] Files (3) + +Info 34 [00:01:15.000] ----------------------------------------------- +Info 34 [00:01:16.000] Project '/user/username/projects/myproject/app2/tsconfig.json' (Configured) +Info 34 [00:01:17.000] Files (3) + +Info 34 [00:01:18.000] ----------------------------------------------- +Info 34 [00:01:19.000] Open files: +Info 34 [00:01:20.000] FileName: /user/username/projects/myproject/app1/app.ts ProjectRootPath: undefined +Info 34 [00:01:21.000] Projects: /user/username/projects/myproject/app1/tsconfig.json +Info 34 [00:01:22.000] FileName: /user/username/projects/myproject/app2/app.ts ProjectRootPath: undefined +Info 34 [00:01:23.000] Projects: /user/username/projects/myproject/app2/tsconfig.json +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/user/username/projects/myproject/core/core.ts: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 34 [00:01:24.000] response: + { + "responseRequired": false + } +Info 35 [00:01:25.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/core/core.ts" + } + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/user/username/projects/myproject/core/core.ts: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 36 [00:01:26.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/core/core.ts 500 undefined WatchType: Closed Script info +Info 37 [00:01:27.000] Search path: /user/username/projects/myproject/core +Info 38 [00:01:28.000] For info: /user/username/projects/myproject/core/core.ts :: No config files found. +Info 39 [00:01:29.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 39 [00:01:30.000] Files (3) + +Info 39 [00:01:31.000] ----------------------------------------------- +Info 39 [00:01:32.000] Project '/user/username/projects/myproject/app2/tsconfig.json' (Configured) +Info 39 [00:01:33.000] Files (3) + +Info 39 [00:01:34.000] ----------------------------------------------- +Info 39 [00:01:35.000] Open files: +Info 39 [00:01:36.000] FileName: /user/username/projects/myproject/app1/app.ts ProjectRootPath: undefined +Info 39 [00:01:37.000] Projects: /user/username/projects/myproject/app1/tsconfig.json +Info 39 [00:01:38.000] FileName: /user/username/projects/myproject/app2/app.ts ProjectRootPath: undefined +Info 39 [00:01:39.000] Projects: /user/username/projects/myproject/app2/tsconfig.json +Info 39 [00:01:40.000] FileName: /user/username/projects/myproject/core/core.ts ProjectRootPath: undefined +Info 39 [00:01:41.000] Projects: /user/username/projects/myproject/app1/tsconfig.json,/user/username/projects/myproject/app2/tsconfig.json +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 39 [00:01:42.000] response: + { + "responseRequired": false + } +Info 40 [00:01:43.000] request: + { + "command": "change", + "arguments": { + "file": "/user/username/projects/myproject/app1/app.ts", + "line": 1, + "offset": 1, + "endLine": 1, + "endOffset": 1, + "insertString": "let k = 1" + }, + "seq": 1, + "type": "request" + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 41 [00:01:44.000] response: + { + "responseRequired": false + } +Info 42 [00:01:45.000] request: + { + "command": "change", + "arguments": { + "file": "/user/username/projects/myproject/app2/app.ts", + "line": 1, + "offset": 1, + "endLine": 1, + "endOffset": 1, + "insertString": "let k = 1" + }, + "seq": 2, + "type": "request" + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 43 [00:01:46.000] response: + { + "responseRequired": false + } +Project1 is dirty: true +Project2 is dirty: true +Info 44 [00:01:47.000] request: + { + "command": "compileOnSaveAffectedFileList", + "arguments": { + "file": "/user/username/projects/myproject/core/core.ts" + }, + "seq": 3, + "type": "request" + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 45 [00:01:48.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/app1/tsconfig.json +Info 46 [00:01:49.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/app1/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 47 [00:01:50.000] Different program with same set of files +Info 48 [00:01:51.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/app2/tsconfig.json +Info 49 [00:01:52.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/app2/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 50 [00:01:53.000] Different program with same set of files +Info 51 [00:01:54.000] Before ensureProjectForOpenFiles: +Info 52 [00:01:55.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 52 [00:01:56.000] Files (3) + +Info 52 [00:01:57.000] ----------------------------------------------- +Info 52 [00:01:58.000] Project '/user/username/projects/myproject/app2/tsconfig.json' (Configured) +Info 52 [00:01:59.000] Files (3) + +Info 52 [00:02:00.000] ----------------------------------------------- +Info 52 [00:02:01.000] Open files: +Info 52 [00:02:02.000] FileName: /user/username/projects/myproject/app1/app.ts ProjectRootPath: undefined +Info 52 [00:02:03.000] Projects: /user/username/projects/myproject/app1/tsconfig.json +Info 52 [00:02:04.000] FileName: /user/username/projects/myproject/app2/app.ts ProjectRootPath: undefined +Info 52 [00:02:05.000] Projects: /user/username/projects/myproject/app2/tsconfig.json +Info 52 [00:02:06.000] FileName: /user/username/projects/myproject/core/core.ts ProjectRootPath: undefined +Info 52 [00:02:07.000] Projects: /user/username/projects/myproject/app1/tsconfig.json,/user/username/projects/myproject/app2/tsconfig.json +Info 52 [00:02:08.000] After ensureProjectForOpenFiles: +Info 53 [00:02:09.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 53 [00:02:10.000] Files (3) + +Info 53 [00:02:11.000] ----------------------------------------------- +Info 53 [00:02:12.000] Project '/user/username/projects/myproject/app2/tsconfig.json' (Configured) +Info 53 [00:02:13.000] Files (3) + +Info 53 [00:02:14.000] ----------------------------------------------- +Info 53 [00:02:15.000] Open files: +Info 53 [00:02:16.000] FileName: /user/username/projects/myproject/app1/app.ts ProjectRootPath: undefined +Info 53 [00:02:17.000] Projects: /user/username/projects/myproject/app1/tsconfig.json +Info 53 [00:02:18.000] FileName: /user/username/projects/myproject/app2/app.ts ProjectRootPath: undefined +Info 53 [00:02:19.000] Projects: /user/username/projects/myproject/app2/tsconfig.json +Info 53 [00:02:20.000] FileName: /user/username/projects/myproject/core/core.ts ProjectRootPath: undefined +Info 53 [00:02:21.000] Projects: /user/username/projects/myproject/app1/tsconfig.json,/user/username/projects/myproject/app2/tsconfig.json +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 53 [00:02:22.000] response: + { + "response": [ + { + "projectFileName": "/user/username/projects/myproject/app1/tsconfig.json", + "fileNames": [ + "/user/username/projects/myproject/core/core.ts" + ], + "projectUsesOutFile": true + }, + { + "projectFileName": "/user/username/projects/myproject/app2/tsconfig.json", + "fileNames": [ + "/user/username/projects/myproject/core/core.ts" + ], + "projectUsesOutFile": true + } + ], + "responseRequired": true + } +Project1 is dirty: false +Project2 is dirty: false \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/compileOnSave/CompileOnSaveAffectedFileListRequest-when-projectFile-is-specified.js b/tests/baselines/reference/tsserver/compileOnSave/CompileOnSaveAffectedFileListRequest-when-projectFile-is-specified.js new file mode 100644 index 00000000000..2eae20ff433 --- /dev/null +++ b/tests/baselines/reference/tsserver/compileOnSave/CompileOnSaveAffectedFileListRequest-when-projectFile-is-specified.js @@ -0,0 +1,472 @@ +Info 0 [00:00:33.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Info 1 [00:00:34.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/app1/app.ts" + } + } +Before request +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/user/username/projects/myproject/core/core.ts] +let z = 10; + +//// [/user/username/projects/myproject/app1/app.ts] +let x = 10; + +//// [/user/username/projects/myproject/app2/app.ts] +let y = 10; + +//// [/user/username/projects/myproject/app1/tsconfig.json] +{"files":["app.ts","../core/core.ts"],"compilerOptions":{"outFile":"build/output.js"},"compileOnSave":true} + +//// [/user/username/projects/myproject/app2/tsconfig.json] +{"files":["app.ts","../core/core.ts"],"compilerOptions":{"outFile":"build/output.js"},"compileOnSave":true} + + +PolledWatches:: + +FsWatches:: + +FsWatchesRecursive:: + +Info 2 [00:00:35.000] Search path: /user/username/projects/myproject/app1 +Info 3 [00:00:36.000] For info: /user/username/projects/myproject/app1/app.ts :: Config file name: /user/username/projects/myproject/app1/tsconfig.json +Info 4 [00:00:37.000] Creating configuration project /user/username/projects/myproject/app1/tsconfig.json +Info 5 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app1/tsconfig.json 2000 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Config file +Info 6 [00:00:39.000] Config: /user/username/projects/myproject/app1/tsconfig.json : { + "rootNames": [ + "/user/username/projects/myproject/app1/app.ts", + "/user/username/projects/myproject/core/core.ts" + ], + "options": { + "outFile": "/user/username/projects/myproject/app1/build/output.js", + "configFilePath": "/user/username/projects/myproject/app1/tsconfig.json" + } +} +Info 7 [00:00:40.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/core/core.ts 500 undefined WatchType: Closed Script info +Info 8 [00:00:41.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/app1/tsconfig.json +Info 9 [00:00:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 10 [00:00:43.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app1/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Type roots +Info 11 [00:00:44.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app1/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Type roots +Info 12 [00:00:45.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Type roots +Info 13 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app1/tsconfig.json WatchType: Type roots +Info 14 [00:00:47.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/app1/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:48.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 16 [00:00:49.000] Files (3) + /a/lib/lib.d.ts + /user/username/projects/myproject/app1/app.ts + /user/username/projects/myproject/core/core.ts + + + ../../../../../a/lib/lib.d.ts + Default library for target 'es3' + app.ts + Part of 'files' list in tsconfig.json + ../core/core.ts + Part of 'files' list in tsconfig.json + +Info 17 [00:00:50.000] ----------------------------------------------- +Info 18 [00:00:51.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 18 [00:00:52.000] Files (3) + +Info 18 [00:00:53.000] ----------------------------------------------- +Info 18 [00:00:54.000] Open files: +Info 18 [00:00:55.000] FileName: /user/username/projects/myproject/app1/app.ts ProjectRootPath: undefined +Info 18 [00:00:56.000] Projects: /user/username/projects/myproject/app1/tsconfig.json +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/user/username/projects/myproject/core/core.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: + +Info 18 [00:00:57.000] response: + { + "responseRequired": false + } +Info 19 [00:00:58.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/app2/app.ts" + } + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/user/username/projects/myproject/core/core.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: + +Info 20 [00:00:59.000] Search path: /user/username/projects/myproject/app2 +Info 21 [00:01:00.000] For info: /user/username/projects/myproject/app2/app.ts :: Config file name: /user/username/projects/myproject/app2/tsconfig.json +Info 22 [00:01:01.000] Creating configuration project /user/username/projects/myproject/app2/tsconfig.json +Info 23 [00:01:02.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app2/tsconfig.json 2000 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Config file +Info 24 [00:01:03.000] Config: /user/username/projects/myproject/app2/tsconfig.json : { + "rootNames": [ + "/user/username/projects/myproject/app2/app.ts", + "/user/username/projects/myproject/core/core.ts" + ], + "options": { + "outFile": "/user/username/projects/myproject/app2/build/output.js", + "configFilePath": "/user/username/projects/myproject/app2/tsconfig.json" + } +} +Info 25 [00:01:04.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/app2/tsconfig.json +Info 26 [00:01:05.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app2/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Type roots +Info 27 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/app2/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Type roots +Info 28 [00:01:07.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Type roots +Info 29 [00:01:08.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/app2/tsconfig.json WatchType: Type roots +Info 30 [00:01:09.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/app2/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 31 [00:01:10.000] Project '/user/username/projects/myproject/app2/tsconfig.json' (Configured) +Info 32 [00:01:11.000] Files (3) + /a/lib/lib.d.ts + /user/username/projects/myproject/app2/app.ts + /user/username/projects/myproject/core/core.ts + + + ../../../../../a/lib/lib.d.ts + Default library for target 'es3' + app.ts + Part of 'files' list in tsconfig.json + ../core/core.ts + Part of 'files' list in tsconfig.json + +Info 33 [00:01:12.000] ----------------------------------------------- +Info 34 [00:01:13.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 34 [00:01:14.000] Files (3) + +Info 34 [00:01:15.000] ----------------------------------------------- +Info 34 [00:01:16.000] Project '/user/username/projects/myproject/app2/tsconfig.json' (Configured) +Info 34 [00:01:17.000] Files (3) + +Info 34 [00:01:18.000] ----------------------------------------------- +Info 34 [00:01:19.000] Open files: +Info 34 [00:01:20.000] FileName: /user/username/projects/myproject/app1/app.ts ProjectRootPath: undefined +Info 34 [00:01:21.000] Projects: /user/username/projects/myproject/app1/tsconfig.json +Info 34 [00:01:22.000] FileName: /user/username/projects/myproject/app2/app.ts ProjectRootPath: undefined +Info 34 [00:01:23.000] Projects: /user/username/projects/myproject/app2/tsconfig.json +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/user/username/projects/myproject/core/core.ts: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 34 [00:01:24.000] response: + { + "responseRequired": false + } +Info 35 [00:01:25.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/core/core.ts" + } + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/user/username/projects/myproject/core/core.ts: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 36 [00:01:26.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/core/core.ts 500 undefined WatchType: Closed Script info +Info 37 [00:01:27.000] Search path: /user/username/projects/myproject/core +Info 38 [00:01:28.000] For info: /user/username/projects/myproject/core/core.ts :: No config files found. +Info 39 [00:01:29.000] Project '/user/username/projects/myproject/app1/tsconfig.json' (Configured) +Info 39 [00:01:30.000] Files (3) + +Info 39 [00:01:31.000] ----------------------------------------------- +Info 39 [00:01:32.000] Project '/user/username/projects/myproject/app2/tsconfig.json' (Configured) +Info 39 [00:01:33.000] Files (3) + +Info 39 [00:01:34.000] ----------------------------------------------- +Info 39 [00:01:35.000] Open files: +Info 39 [00:01:36.000] FileName: /user/username/projects/myproject/app1/app.ts ProjectRootPath: undefined +Info 39 [00:01:37.000] Projects: /user/username/projects/myproject/app1/tsconfig.json +Info 39 [00:01:38.000] FileName: /user/username/projects/myproject/app2/app.ts ProjectRootPath: undefined +Info 39 [00:01:39.000] Projects: /user/username/projects/myproject/app2/tsconfig.json +Info 39 [00:01:40.000] FileName: /user/username/projects/myproject/core/core.ts ProjectRootPath: undefined +Info 39 [00:01:41.000] Projects: /user/username/projects/myproject/app1/tsconfig.json,/user/username/projects/myproject/app2/tsconfig.json +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 39 [00:01:42.000] response: + { + "responseRequired": false + } +Info 40 [00:01:43.000] request: + { + "command": "change", + "arguments": { + "file": "/user/username/projects/myproject/app1/app.ts", + "line": 1, + "offset": 1, + "endLine": 1, + "endOffset": 1, + "insertString": "let k = 1" + }, + "seq": 1, + "type": "request" + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 41 [00:01:44.000] response: + { + "responseRequired": false + } +Info 42 [00:01:45.000] request: + { + "command": "change", + "arguments": { + "file": "/user/username/projects/myproject/app2/app.ts", + "line": 1, + "offset": 1, + "endLine": 1, + "endOffset": 1, + "insertString": "let k = 1" + }, + "seq": 2, + "type": "request" + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 43 [00:01:46.000] response: + { + "responseRequired": false + } +Project1 is dirty: true +Project2 is dirty: true +Info 44 [00:01:47.000] request: + { + "command": "compileOnSaveAffectedFileList", + "arguments": { + "file": "/user/username/projects/myproject/core/core.ts", + "projectFileName": "/user/username/projects/myproject/app1/tsconfig.json" + }, + "seq": 3, + "type": "request" + } +Before request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 45 [00:01:48.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/app1/tsconfig.json +Info 46 [00:01:49.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/app1/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 47 [00:01:50.000] Different program with same set of files +After request + +PolledWatches:: +/user/username/projects/myproject/app1/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/myproject/app2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/app1/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/myproject/app2/tsconfig.json: + {} + +FsWatchesRecursive:: + +Info 48 [00:01:51.000] response: + { + "response": [ + { + "projectFileName": "/user/username/projects/myproject/app1/tsconfig.json", + "fileNames": [ + "/user/username/projects/myproject/core/core.ts" + ], + "projectUsesOutFile": true + } + ], + "responseRequired": true + } +Project1 is dirty: false +Project2 is dirty: true \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-be-true-if-out-is-set.js b/tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-be-true-if-out-is-set.js new file mode 100644 index 00000000000..2bf9e8d9306 --- /dev/null +++ b/tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-be-true-if-out-is-set.js @@ -0,0 +1,164 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Info 1 [00:00:12.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/a/a.ts" + } + } +Before request +//// [/a/a.ts] +let x = 1 + +//// [/a/b.ts] +let y = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{"out":"/a/out.js"},"compileOnSave":true} + + +PolledWatches:: + +FsWatches:: + +FsWatchesRecursive:: + +Info 2 [00:00:13.000] Search path: /a +Info 3 [00:00:14.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/b.ts" + ], + "options": { + "out": "/a/out.js", + "configFilePath": "/a/tsconfig.json" + } +} +Info 7 [00:00:18.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 8 [00:00:19.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:24.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:26.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:27.000] Files (2) + /a/a.ts + /a/b.ts + + + a.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:28.000] ----------------------------------------------- +Info 18 [00:00:29.000] Project '/a/tsconfig.json' (Configured) +Info 18 [00:00:30.000] Files (2) + +Info 18 [00:00:31.000] ----------------------------------------------- +Info 18 [00:00:32.000] Open files: +Info 18 [00:00:33.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 18 [00:00:34.000] Projects: /a/tsconfig.json +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/b.ts: + {} + +FsWatchesRecursive:: +/a: + {} + +Info 18 [00:00:35.000] response: + { + "responseRequired": false + } +Info 19 [00:00:36.000] request: + { + "command": "compileOnSaveAffectedFileList", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Before request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/b.ts: + {} + +FsWatchesRecursive:: +/a: + {} + +Info 20 [00:00:37.000] Before ensureProjectForOpenFiles: +Info 21 [00:00:38.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:39.000] Files (2) + +Info 21 [00:00:40.000] ----------------------------------------------- +Info 21 [00:00:41.000] Open files: +Info 21 [00:00:42.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:43.000] Projects: /a/tsconfig.json +Info 21 [00:00:44.000] After ensureProjectForOpenFiles: +Info 22 [00:00:45.000] Project '/a/tsconfig.json' (Configured) +Info 22 [00:00:46.000] Files (2) + +Info 22 [00:00:47.000] ----------------------------------------------- +Info 22 [00:00:48.000] Open files: +Info 22 [00:00:49.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 22 [00:00:50.000] Projects: /a/tsconfig.json +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/b.ts: + {} + +FsWatchesRecursive:: +/a: + {} + +Info 22 [00:00:51.000] response: + { + "response": [ + { + "projectFileName": "/a/tsconfig.json", + "fileNames": [ + "/a/a.ts" + ], + "projectUsesOutFile": true + } + ], + "responseRequired": true + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-be-true-if-outFile-is-set.js b/tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-be-true-if-outFile-is-set.js new file mode 100644 index 00000000000..8344a019342 --- /dev/null +++ b/tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-be-true-if-outFile-is-set.js @@ -0,0 +1,164 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Info 1 [00:00:12.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/a/a.ts" + } + } +Before request +//// [/a/a.ts] +let x = 1 + +//// [/a/b.ts] +let y = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{"outFile":"/a/out.js"},"compileOnSave":true} + + +PolledWatches:: + +FsWatches:: + +FsWatchesRecursive:: + +Info 2 [00:00:13.000] Search path: /a +Info 3 [00:00:14.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/b.ts" + ], + "options": { + "outFile": "/a/out.js", + "configFilePath": "/a/tsconfig.json" + } +} +Info 7 [00:00:18.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 8 [00:00:19.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:24.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:26.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:27.000] Files (2) + /a/a.ts + /a/b.ts + + + a.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:28.000] ----------------------------------------------- +Info 18 [00:00:29.000] Project '/a/tsconfig.json' (Configured) +Info 18 [00:00:30.000] Files (2) + +Info 18 [00:00:31.000] ----------------------------------------------- +Info 18 [00:00:32.000] Open files: +Info 18 [00:00:33.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 18 [00:00:34.000] Projects: /a/tsconfig.json +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/b.ts: + {} + +FsWatchesRecursive:: +/a: + {} + +Info 18 [00:00:35.000] response: + { + "responseRequired": false + } +Info 19 [00:00:36.000] request: + { + "command": "compileOnSaveAffectedFileList", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Before request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/b.ts: + {} + +FsWatchesRecursive:: +/a: + {} + +Info 20 [00:00:37.000] Before ensureProjectForOpenFiles: +Info 21 [00:00:38.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:39.000] Files (2) + +Info 21 [00:00:40.000] ----------------------------------------------- +Info 21 [00:00:41.000] Open files: +Info 21 [00:00:42.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:43.000] Projects: /a/tsconfig.json +Info 21 [00:00:44.000] After ensureProjectForOpenFiles: +Info 22 [00:00:45.000] Project '/a/tsconfig.json' (Configured) +Info 22 [00:00:46.000] Files (2) + +Info 22 [00:00:47.000] ----------------------------------------------- +Info 22 [00:00:48.000] Open files: +Info 22 [00:00:49.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 22 [00:00:50.000] Projects: /a/tsconfig.json +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/b.ts: + {} + +FsWatchesRecursive:: +/a: + {} + +Info 22 [00:00:51.000] response: + { + "response": [ + { + "projectFileName": "/a/tsconfig.json", + "fileNames": [ + "/a/a.ts" + ], + "projectUsesOutFile": true + } + ], + "responseRequired": true + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-not-be-returned-if-not-set.js b/tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-not-be-returned-if-not-set.js new file mode 100644 index 00000000000..f2b14d2c8ff --- /dev/null +++ b/tests/baselines/reference/tsserver/compileOnSave/compileOnSaveAffectedFileList-projectUsesOutFile-should-not-be-returned-if-not-set.js @@ -0,0 +1,164 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Info 1 [00:00:12.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/a/a.ts" + } + } +Before request +//// [/a/a.ts] +let x = 1 + +//// [/a/b.ts] +let y = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{},"compileOnSave":true} + + +PolledWatches:: + +FsWatches:: + +FsWatchesRecursive:: + +Info 2 [00:00:13.000] Search path: /a +Info 3 [00:00:14.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/b.ts" + ], + "options": { + "configFilePath": "/a/tsconfig.json" + } +} +Info 7 [00:00:18.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 8 [00:00:19.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:24.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:26.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:27.000] Files (2) + /a/a.ts + /a/b.ts + + + a.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:28.000] ----------------------------------------------- +Info 18 [00:00:29.000] Project '/a/tsconfig.json' (Configured) +Info 18 [00:00:30.000] Files (2) + +Info 18 [00:00:31.000] ----------------------------------------------- +Info 18 [00:00:32.000] Open files: +Info 18 [00:00:33.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 18 [00:00:34.000] Projects: /a/tsconfig.json +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/b.ts: + {} + +FsWatchesRecursive:: +/a: + {} + +Info 18 [00:00:35.000] response: + { + "responseRequired": false + } +Info 19 [00:00:36.000] request: + { + "command": "compileOnSaveAffectedFileList", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Before request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/b.ts: + {} + +FsWatchesRecursive:: +/a: + {} + +Info 20 [00:00:37.000] Before ensureProjectForOpenFiles: +Info 21 [00:00:38.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:39.000] Files (2) + +Info 21 [00:00:40.000] ----------------------------------------------- +Info 21 [00:00:41.000] Open files: +Info 21 [00:00:42.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:43.000] Projects: /a/tsconfig.json +Info 21 [00:00:44.000] After ensureProjectForOpenFiles: +Info 22 [00:00:45.000] Project '/a/tsconfig.json' (Configured) +Info 22 [00:00:46.000] Files (2) + +Info 22 [00:00:47.000] ----------------------------------------------- +Info 22 [00:00:48.000] Open files: +Info 22 [00:00:49.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 22 [00:00:50.000] Projects: /a/tsconfig.json +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/b.ts: + {} + +FsWatchesRecursive:: +/a: + {} + +Info 22 [00:00:51.000] response: + { + "response": [ + { + "projectFileName": "/a/tsconfig.json", + "fileNames": [ + "/a/a.ts", + "/a/b.ts" + ], + "projectUsesOutFile": false + } + ], + "responseRequired": true + } \ No newline at end of file