From 905a0b4e693e8cc13a726ad650b908fee4f75408 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 17 Mar 2023 16:56:01 -0700 Subject: [PATCH] Create baselines for tsserver event tests (#53330) --- src/server/session.ts | 9 +- .../unittests/tsserver/configuredProjects.ts | 35 +- .../tsserver/events/largeFileReferenced.ts | 42 +- .../events/projectLanguageServiceState.ts | 25 +- .../tsserver/events/projectLoading.ts | 326 +++++------- .../events/projectUpdatedInBackground.ts | 351 ++++--------- src/testRunner/unittests/tsserver/helpers.ts | 140 +---- .../unittests/tsserver/telemetry.ts | 250 ++++----- ...e-tolerated-without-crashing-the-server.js | 96 ++++ ...rk-even-if-language-service-is-disabled.js | 115 ++++ ...s-file-is-included-by-module-resolution.js | 103 ++++ ...n-large-js-file-is-included-by-tsconfig.js | 104 ++++ ...s-file-is-included-by-module-resolution.js | 92 ++++ ...n-large-ts-file-is-included-by-tsconfig.js | 101 ++++ ...e-service-disabled-events-are-triggered.js | 249 +++++++++ ...large-file-size-is-determined-correctly.js | 0 ...g-file-when-using-default-event-handler.js | 153 ++++++ ...ed-config-file-when-using-event-handler.js | 152 ++++++ ...g-file-when-using-default-event-handler.js | 144 +++++ ...he-config-file-when-using-event-handler.js | 143 +++++ ...sabled-when-using-default-event-handler.js | 147 ++++++ ...ct-is-disabled-when-using-event-handler.js | 147 ++++++ ...-false-when-using-default-event-handler.js | 119 +++++ ...oject-is-false-when-using-event-handler.js | 119 +++++ ...opened-when-using-default-event-handler.js | 149 ++++++ ...file-is-opened-when-using-event-handler.js | 149 ++++++ ...direct-when-using-default-event-handler.js | 278 ++++++++++ ...erenceRedirect-when-using-event-handler.js | 278 ++++++++++ ...roject-when-using-default-event-handler.js | 270 ++++++++++ ...cation-project-when-using-event-handler.js | 270 ++++++++++ ...n-file-when-using-default-event-handler.js | 190 +++++++ ...d-by-open-file-when-using-event-handler.js | 190 +++++++ ...he-session-and-project-is-at-root-level.js | 98 ++-- ...ession-and-project-is-not-at-root-level.js | 190 +++---- ...tself-if---isolatedModules-is-specified.js | 268 ++++++++++ ...self-if---out-or---outFile-is-specified.js | 257 +++++++++ ...should-be-up-to-date-with-deleted-files.js | 269 ++++++++++ ...-be-up-to-date-with-newly-created-files.js | 285 ++++++++++ ...-to-date-with-the-reference-map-changes.js | 488 +++++++++++++++++ ...session-and-should-contains-only-itself.js | 310 +++++++++++ ...should-detect-changes-in-non-root-files.js | 257 +++++++++ ...nd-should-detect-non-existing-code-file.js | 287 ++++++++++ ...ion-and-should-detect-removed-code-file.js | 190 +++++++ ...ll-files-if-a-global-file-changed-shape.js | 267 ++++++++++ ...ould-return-cascaded-affected-file-list.js | 413 +++++++++++++++ ...fine-for-files-with-circular-references.js | 196 +++++++ ...et-in-the-session-and-when---out-is-set.js | 203 +++++++ ...n-the-session-and-when---outFile-is-set.js | 203 +++++++ ...in-the-session-and-when-adding-new-file.js | 231 ++++++++ ...ssion-and-when-both-options-are-not-set.js | 202 +++++++ ...oundUpdate-and-project-is-at-root-level.js | 2 - ...Update-and-project-is-not-at-root-level.js | 4 - ...tself-if---isolatedModules-is-specified.js | 269 ++++++++++ ...self-if---out-or---outFile-is-specified.js | 258 +++++++++ ...should-be-up-to-date-with-deleted-files.js | 270 ++++++++++ ...-be-up-to-date-with-newly-created-files.js | 286 ++++++++++ ...-to-date-with-the-reference-map-changes.js | 492 +++++++++++++++++ ...dUpdate-and-should-contains-only-itself.js | 312 +++++++++++ ...should-detect-changes-in-non-root-files.js | 259 +++++++++ ...nd-should-detect-non-existing-code-file.js | 289 ++++++++++ ...ate-and-should-detect-removed-code-file.js | 191 +++++++ ...ll-files-if-a-global-file-changed-shape.js | 268 ++++++++++ ...ould-return-cascaded-affected-file-list.js | 416 +++++++++++++++ ...fine-for-files-with-circular-references.js | 197 +++++++ ...nBackgroundUpdate-and-when---out-is-set.js | 205 ++++++++ ...kgroundUpdate-and-when---outFile-is-set.js | 205 ++++++++ ...ckgroundUpdate-and-when-adding-new-file.js | 233 +++++++++ ...pdate-and-when-both-options-are-not-set.js | 204 ++++++++ ...oundUpdate-and-project-is-at-root-level.js | 2 - ...Update-and-project-is-not-at-root-level.js | 4 - ...tself-if---isolatedModules-is-specified.js | 269 ++++++++++ ...self-if---out-or---outFile-is-specified.js | 258 +++++++++ ...should-be-up-to-date-with-deleted-files.js | 270 ++++++++++ ...-be-up-to-date-with-newly-created-files.js | 286 ++++++++++ ...-to-date-with-the-reference-map-changes.js | 494 ++++++++++++++++++ ...dUpdate-and-should-contains-only-itself.js | 314 +++++++++++ ...should-detect-changes-in-non-root-files.js | 261 +++++++++ ...nd-should-detect-non-existing-code-file.js | 291 +++++++++++ ...ate-and-should-detect-removed-code-file.js | 191 +++++++ ...ll-files-if-a-global-file-changed-shape.js | 268 ++++++++++ ...ould-return-cascaded-affected-file-list.js | 418 +++++++++++++++ ...fine-for-files-with-circular-references.js | 197 +++++++ ...nBackgroundUpdate-and-when---out-is-set.js | 207 ++++++++ ...kgroundUpdate-and-when---outFile-is-set.js | 207 ++++++++ ...ckgroundUpdate-and-when-adding-new-file.js | 235 +++++++++ ...pdate-and-when-both-options-are-not-set.js | 206 ++++++++ .../telemetry/counts-files-by-extension.js | 133 +++++ ...s-whether-language-service-was-disabled.js | 81 +++ .../telemetry/does-not-expose-paths.js | 110 ++++ .../does-nothing-for-inferred-project.js | 92 ++++ ...ven-for-project-with-ts-check-in-config.js | 180 +++++++ .../tsserver/telemetry/not-for-ts-file.js | 45 ++ .../telemetry/only-sends-an-event-once.js | 273 ++++++++++ .../sends-event-for-inferred-project.js | 187 +++++++ ...es,-include,-exclude,-and-compileOnSave.js | 76 +++ .../sends-telemetry-for-file-sizes.js | 193 +++++++ ...-telemetry-for-typeAcquisition-settings.js | 182 +++++++ .../telemetry/works-with-external-project.js | 252 +++++++++ 98 files changed, 19165 insertions(+), 927 deletions(-) create mode 100644 tests/baselines/reference/tsserver/configuredProjects/should-be-tolerated-without-crashing-the-server.js create mode 100644 tests/baselines/reference/tsserver/configuredProjects/syntactic-features-work-even-if-language-service-is-disabled.js create mode 100644 tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-js-file-is-included-by-module-resolution.js create mode 100644 tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-js-file-is-included-by-tsconfig.js create mode 100644 tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-ts-file-is-included-by-module-resolution.js create mode 100644 tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-ts-file-is-included-by-tsconfig.js create mode 100644 tests/baselines/reference/tsserver/events/projectLanguageServiceState/language-service-disabled-events-are-triggered.js rename tests/baselines/reference/tsserver/{projectLanguageServiceStateEvent => events/projectLanguageServiceState}/large-file-size-is-determined-correctly.js (100%) create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-an-extended-config-file-when-using-default-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-an-extended-config-file-when-using-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-the-config-file-when-using-default-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-the-config-file-when-using-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-disabled-when-using-default-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-disabled-when-using-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-false-when-using-default-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-false-when-using-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-true-and-file-is-opened-when-using-default-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-true-and-file-is-opened-when-using-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-disableSourceOfProjectReferenceRedirect-when-using-default-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-disableSourceOfProjectReferenceRedirect-when-using-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-when-using-default-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-when-using-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/project-is-created-by-open-file-when-using-default-event-handler.js create mode 100644 tests/baselines/reference/tsserver/events/projectLoading/project-is-created-by-open-file-when-using-event-handler.js rename tests/baselines/reference/tsserver/{ => events}/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-at-root-level.js (51%) rename tests/baselines/reference/tsserver/{ => events}/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-not-at-root-level.js (64%) create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-deleted-files.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-newly-created-files.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-the-reference-map-changes.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-contains-only-itself.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-changes-in-non-root-files.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-non-existing-code-file.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-removed-code-file.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-return-all-files-if-a-global-file-changed-shape.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-return-cascaded-affected-file-list.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-work-fine-for-files-with-circular-references.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when---out-is-set.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when---outFile-is-set.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when-adding-new-file.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when-both-options-are-not-set.js rename tests/baselines/reference/tsserver/{ => events}/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js (98%) rename tests/baselines/reference/tsserver/{ => events}/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js (98%) create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-deleted-files.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-newly-created-files.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-contains-only-itself.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-changes-in-non-root-files.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-non-existing-code-file.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-removed-code-file.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-return-all-files-if-a-global-file-changed-shape.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-return-cascaded-affected-file-list.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-work-fine-for-files-with-circular-references.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when---out-is-set.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when---outFile-is-set.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when-adding-new-file.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when-both-options-are-not-set.js rename tests/baselines/reference/tsserver/{ => events}/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js (98%) rename tests/baselines/reference/tsserver/{ => events}/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js (98%) create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-deleted-files.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-newly-created-files.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-contains-only-itself.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-changes-in-non-root-files.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-non-existing-code-file.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-removed-code-file.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-return-all-files-if-a-global-file-changed-shape.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-return-cascaded-affected-file-list.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-work-fine-for-files-with-circular-references.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when---out-is-set.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when---outFile-is-set.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when-adding-new-file.js create mode 100644 tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when-both-options-are-not-set.js create mode 100644 tests/baselines/reference/tsserver/telemetry/counts-files-by-extension.js create mode 100644 tests/baselines/reference/tsserver/telemetry/detects-whether-language-service-was-disabled.js create mode 100644 tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js create mode 100644 tests/baselines/reference/tsserver/telemetry/does-nothing-for-inferred-project.js create mode 100644 tests/baselines/reference/tsserver/telemetry/even-for-project-with-ts-check-in-config.js create mode 100644 tests/baselines/reference/tsserver/telemetry/not-for-ts-file.js create mode 100644 tests/baselines/reference/tsserver/telemetry/only-sends-an-event-once.js create mode 100644 tests/baselines/reference/tsserver/telemetry/sends-event-for-inferred-project.js create mode 100644 tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-extends,-files,-include,-exclude,-and-compileOnSave.js create mode 100644 tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-file-sizes.js create mode 100644 tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-typeAcquisition-settings.js create mode 100644 tests/baselines/reference/tsserver/telemetry/works-with-external-project.js diff --git a/src/server/session.ts b/src/server/session.ts index de278e2dd23..58107df5ef3 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -267,9 +267,12 @@ function convertToLocation(lineAndCharacter: LineAndCharacter): protocol.Locatio return { line: lineAndCharacter.line + 1, offset: lineAndCharacter.character + 1 }; } -function formatDiagnosticToProtocol(diag: Diagnostic, includeFileName: true): protocol.DiagnosticWithFileName; -function formatDiagnosticToProtocol(diag: Diagnostic, includeFileName: false): protocol.Diagnostic; -function formatDiagnosticToProtocol(diag: Diagnostic, includeFileName: boolean): protocol.Diagnostic | protocol.DiagnosticWithFileName { +/** @internal */ +export function formatDiagnosticToProtocol(diag: Diagnostic, includeFileName: true): protocol.DiagnosticWithFileName; +/** @internal */ +export function formatDiagnosticToProtocol(diag: Diagnostic, includeFileName: false): protocol.Diagnostic; +/** @internal */ +export function formatDiagnosticToProtocol(diag: Diagnostic, includeFileName: boolean): protocol.Diagnostic | protocol.DiagnosticWithFileName { const start = (diag.file && convertToLocation(getLineAndCharacterOfPosition(diag.file, diag.start!)))!; // TODO: GH#18217 const end = (diag.file && convertToLocation(getLineAndCharacterOfPosition(diag.file, diag.start! + diag.length!)))!; // TODO: GH#18217 const text = flattenDiagnosticMessageText(diag.messageText, "\n"); diff --git a/src/testRunner/unittests/tsserver/configuredProjects.ts b/src/testRunner/unittests/tsserver/configuredProjects.ts index f205fedce7f..0ff757e6caa 100644 --- a/src/testRunner/unittests/tsserver/configuredProjects.ts +++ b/src/testRunner/unittests/tsserver/configuredProjects.ts @@ -21,7 +21,6 @@ import { createLoggerWithInMemoryLogs, createProjectService, createSession, - createSessionWithEventTracking, openFilesForSession, verifyGetErrRequest, } from "./helpers"; @@ -751,25 +750,22 @@ describe("unittests:: tsserver:: ConfiguredProjects", () => { const originalGetFileSize = host.getFileSize; host.getFileSize = (filePath: string) => filePath === f2.path ? ts.server.maxProgramSizeForNonTsFiles + 1 : originalGetFileSize.call(host, filePath); - const { session, events } = createSessionWithEventTracking(host, ts.server.ProjectLanguageServiceStateEvent); + const session = createSession(host, { canUseEvents: true, logger: createLoggerWithInMemoryLogs(host) }); session.executeCommand({ seq: 0, type: "request", command: "open", arguments: { file: f1.path } } as ts.server.protocol.OpenRequest); + session.logger.log(`Language languageServiceEnabled:: ${session.getProjectService().configuredProjects.get(config.path)!.languageServiceEnabled}`); - const projectService = session.getProjectService(); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - const project = configuredProjectAt(projectService, 0); - assert.isFalse(project.languageServiceEnabled, "Language service enabled"); - assert.equal(events.length, 1, "should receive event"); - assert.equal(events[0].data.project, project, "project name"); - assert.isFalse(events[0].data.languageServiceEnabled, "Language service state"); - - const options = projectService.getFormatCodeOptions(f1.path as ts.server.NormalizedPath); - const edits = project.getLanguageService().getFormattingEditsForDocument(f1.path, options); - assert.deepEqual(edits, [{ span: ts.createTextSpan(/*start*/ 7, /*length*/ 3), newText: " " }]); + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.FormatFull, + arguments: { + file: f1.path, + } + }); + baselineTsserverLogs("configuredProjects", "syntactic features work even if language service is disabled", session); }); it("when multiple projects are open, detects correct default project", () => { @@ -1263,7 +1259,7 @@ describe("unittests:: tsserver:: ConfiguredProjects:: when reading tsconfig file }; const host = createServerHost([file1, libFile, configFile]); - const { session, events } = createSessionWithEventTracking(host, ts.server.ConfigFileDiagEvent); + const session = createSession(host, { canUseEvents: true, logger: createLoggerWithInMemoryLogs(host) }); const originalReadFile = host.readFile; host.readFile = f => { return f === configFile.path ? @@ -1272,15 +1268,6 @@ describe("unittests:: tsserver:: ConfiguredProjects:: when reading tsconfig file }; openFilesForSession([file1], session); - assert.deepEqual(events, [{ - eventName: ts.server.ConfigFileDiagEvent, - data: { - triggerFile: file1.path, - configFileName: configFile.path, - diagnostics: [ - ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0, configFile.path) - ] - } - }]); + baselineTsserverLogs("configuredProjects", "should be tolerated without crashing the server", session); }); }); diff --git a/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts b/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts index b2584532979..ca17216af17 100644 --- a/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts +++ b/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts @@ -5,16 +5,18 @@ import { libFile, } from "../../virtualFileSystemWithWatch"; import { - checkNumberOfProjects, - checkProjectActualFiles, - createSessionWithEventTracking, + baselineTsserverLogs, + createLoggerWithInMemoryLogs, + createSession, openFilesForSession, } from "../helpers"; describe("unittests:: tsserver:: events:: LargeFileReferencedEvent with large file", () => { - + function getFileType(useLargeTsFile: boolean) { + return useLargeTsFile ? "ts" : "js"; + } function getLargeFile(useLargeTsFile: boolean) { - return `src/large.${useLargeTsFile ? "ts" : "js"}`; + return `src/large.${getFileType(useLargeTsFile)}`; } function createSessionWithEventHandler(files: File[], useLargeTsFile: boolean) { @@ -25,23 +27,9 @@ describe("unittests:: tsserver:: events:: LargeFileReferencedEvent with large fi }; files.push(largeFile); const host = createServerHost(files); - const { session, events: largeFileReferencedEvents } = createSessionWithEventTracking(host, ts.server.LargeFileReferencedEvent); + const session = createSession(host, { canUseEvents: true, logger: createLoggerWithInMemoryLogs(host) }); - return { session, verifyLargeFile }; - - function verifyLargeFile(project: ts.server.Project) { - checkProjectActualFiles(project, files.map(f => f.path)); - - // large file for non ts file should be empty and for ts file should have content - const service = session.getProjectService(); - const info = service.getScriptInfo(largeFile.path)!; - assert.equal(info.cacheSourceFile!.sourceFile.text, useLargeTsFile ? largeFile.content : ""); - - assert.deepEqual(largeFileReferencedEvents, useLargeTsFile ? ts.emptyArray : [{ - eventName: ts.server.LargeFileReferencedEvent, - data: { file: largeFile.path, fileSize: largeFile.fileSize, maxFileSize: ts.server.maxFileSize } - }]); - } + return session; } function verifyLargeFile(useLargeTsFile: boolean) { @@ -55,11 +43,9 @@ describe("unittests:: tsserver:: events:: LargeFileReferencedEvent with large fi content: JSON.stringify({ files: ["src/file.ts", getLargeFile(useLargeTsFile)], compilerOptions: { target: 1, allowJs: true } }) }; const files = [file, libFile, tsconfig]; - const { session, verifyLargeFile } = createSessionWithEventHandler(files, useLargeTsFile); - const service = session.getProjectService(); + const session = createSessionWithEventHandler(files, useLargeTsFile); openFilesForSession([file], session); - checkNumberOfProjects(service, { configuredProjects: 1 }); - verifyLargeFile(service.configuredProjects.get(tsconfig.path)!); + baselineTsserverLogs("events/largeFileReferenced", `when large ${getFileType(useLargeTsFile)} file is included by tsconfig`, session); }); it("when large file is included by module resolution", () => { @@ -68,11 +54,9 @@ describe("unittests:: tsserver:: events:: LargeFileReferencedEvent with large fi content: `export var y = 10;import {x} from "./large"` }; const files = [file, libFile]; - const { session, verifyLargeFile } = createSessionWithEventHandler(files, useLargeTsFile); - const service = session.getProjectService(); + const session = createSessionWithEventHandler(files, useLargeTsFile); openFilesForSession([file], session); - checkNumberOfProjects(service, { inferredProjects: 1 }); - verifyLargeFile(service.inferredProjects[0]); + baselineTsserverLogs("events/largeFileReferenced", `when large ${getFileType(useLargeTsFile)} file is included by module resolution`, session); }); } diff --git a/src/testRunner/unittests/tsserver/events/projectLanguageServiceState.ts b/src/testRunner/unittests/tsserver/events/projectLanguageServiceState.ts index 9c6bd0d664e..281aa38bbb8 100644 --- a/src/testRunner/unittests/tsserver/events/projectLanguageServiceState.ts +++ b/src/testRunner/unittests/tsserver/events/projectLanguageServiceState.ts @@ -6,11 +6,9 @@ import { } from "../../virtualFileSystemWithWatch"; import { baselineTsserverLogs, - checkNumberOfProjects, - configuredProjectAt, createLoggerWithInMemoryLogs, createProjectService, - createSessionWithEventTracking, + createSession, } from "../helpers"; describe("unittests:: tsserver:: events:: ProjectLanguageServiceStateEvent", () => { @@ -36,30 +34,19 @@ describe("unittests:: tsserver:: events:: ProjectLanguageServiceStateEvent", () host.getFileSize = (filePath: string) => filePath === f2.path ? ts.server.maxProgramSizeForNonTsFiles + 1 : originalGetFileSize.call(host, filePath); - const { session, events } = createSessionWithEventTracking(host, ts.server.ProjectLanguageServiceStateEvent); + const session = createSession(host, { canUseEvents: true, logger: createLoggerWithInMemoryLogs(host) }); session.executeCommand({ seq: 0, type: "request", command: "open", arguments: { file: f1.path } } as ts.server.protocol.OpenRequest); - const projectService = session.getProjectService(); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - const project = configuredProjectAt(projectService, 0); - assert.isFalse(project.languageServiceEnabled, "Language service enabled"); - assert.equal(events.length, 1, "should receive event"); - assert.equal(events[0].data.project, project, "project name"); - assert.equal(events[0].data.project.getProjectName(), config.path, "config path"); - assert.isFalse(events[0].data.languageServiceEnabled, "Language service state"); + session.logger.log(`Language service enabled: ${session.getProjectService().configuredProjects.get(config.path)!.languageServiceEnabled}`); host.writeFile(configWithExclude.path, configWithExclude.content); host.checkTimeoutQueueLengthAndRun(2); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - assert.isTrue(project.languageServiceEnabled, "Language service enabled"); - assert.equal(events.length, 2, "should receive event"); - assert.equal(events[1].data.project, project, "project"); - assert.equal(events[1].data.project.getProjectName(), config.path, "config path"); - assert.isTrue(events[1].data.languageServiceEnabled, "Language service state"); + session.logger.log(`Language service enabled: ${session.getProjectService().configuredProjects.get(config.path)!.languageServiceEnabled}`); + baselineTsserverLogs("events/projectLanguageServiceState", "language service disabled events are triggered", session); }); it("Large file size is determined correctly", () => { @@ -87,6 +74,6 @@ describe("unittests:: tsserver:: events:: ProjectLanguageServiceStateEvent", () const project = service.configuredProjects.get(config.path)!; service.logger.info(`languageServiceEnabled: ${project.languageServiceEnabled}`); service.logger.info(`lastFileExceededProgramSize: ${project.lastFileExceededProgramSize}`); - baselineTsserverLogs("projectLanguageServiceStateEvent", "large file size is determined correctly", service); + baselineTsserverLogs("events/projectLanguageServiceState", "large file size is determined correctly", service); }); }); diff --git a/src/testRunner/unittests/tsserver/events/projectLoading.ts b/src/testRunner/unittests/tsserver/events/projectLoading.ts index 739a29a503e..ee4b011ab50 100644 --- a/src/testRunner/unittests/tsserver/events/projectLoading.ts +++ b/src/testRunner/unittests/tsserver/events/projectLoading.ts @@ -6,9 +6,10 @@ import { TestServerHost, } from "../../virtualFileSystemWithWatch"; import { - checkNumberOfProjects, - createSessionWithDefaultEventHandler, - createSessionWithEventTracking, + baselineTsserverLogs, + createLoggerWithInMemoryLogs, + createSession, + createSessionWithCustomEventHandler, openFilesForSession, protocolLocationFromSubstring, TestSession, @@ -28,220 +29,157 @@ describe("unittests:: tsserver:: events:: ProjectLoadingStart and ProjectLoading const configBPath = `/user/username/projects/b/tsconfig.json`; const files = [libFile, aTs, configA]; - function verifyProjectLoadingStartAndFinish(createSession: (host: TestServerHost) => { - session: TestSession; - getNumberOfEvents: () => number; - clearEvents: () => void; - verifyProjectLoadEvents: (expected: [ts.server.ProjectLoadingStartEvent, ts.server.ProjectLoadingFinishEvent]) => void; - }) { - function createSessionToVerifyEvent(files: readonly File[]) { - const host = createServerHost(files); - const originalReadFile = host.readFile; - const { session, getNumberOfEvents, clearEvents, verifyProjectLoadEvents } = createSession(host); - host.readFile = file => { - if (file === configA.path || file === configBPath) { - assert.equal(getNumberOfEvents(), 1, "Event for loading is sent before reading config file"); - } - return originalReadFile.call(host, file); - }; - const service = session.getProjectService(); - return { host, session, verifyEvent, verifyEventWithOpenTs, service, getNumberOfEvents }; - - function verifyEvent(project: ts.server.Project, reason: string) { - verifyProjectLoadEvents([ - { eventName: ts.server.ProjectLoadingStartEvent, data: { project, reason } }, - { eventName: ts.server.ProjectLoadingFinishEvent, data: { project } } - ]); - clearEvents(); - } - - function verifyEventWithOpenTs(file: File, configPath: string, configuredProjects: number) { - openFilesForSession([file], session); - checkNumberOfProjects(service, { configuredProjects }); - const project = service.configuredProjects.get(configPath)!; - assert.isDefined(project); - verifyEvent(project, `Creating possible configured project for ${file.path} to open`); - } - } - - it("when project is created by open file", () => { - const bTs: File = { - path: bTsPath, - content: "export class B {}" - }; - const configB: File = { - path: configBPath, - content: "{}" - }; - const { verifyEventWithOpenTs } = createSessionToVerifyEvent(files.concat(bTs, configB)); - verifyEventWithOpenTs(aTs, configA.path, 1); - verifyEventWithOpenTs(bTs, configB.path, 2); - }); - - it("when change is detected in the config file", () => { - const { host, verifyEvent, verifyEventWithOpenTs, service } = createSessionToVerifyEvent(files); - verifyEventWithOpenTs(aTs, configA.path, 1); - - host.writeFile(configA.path, configA.content); - host.checkTimeoutQueueLengthAndRun(2); - const project = service.configuredProjects.get(configA.path)!; - verifyEvent(project, `Change in config file detected`); - }); - - it("when change is detected in an extended config file", () => { - const bTs: File = { - path: bTsPath, - content: "export class B {}" - }; - const configB: File = { - path: configBPath, - content: JSON.stringify({ - extends: "../a/tsconfig.json", - }) - }; - const { host, verifyEvent, verifyEventWithOpenTs, service } = createSessionToVerifyEvent(files.concat(bTs, configB)); - verifyEventWithOpenTs(bTs, configB.path, 1); - - host.writeFile(configA.path, configA.content); - host.checkTimeoutQueueLengthAndRun(2); - const project = service.configuredProjects.get(configB.path)!; - verifyEvent(project, `Change in extended config file ${configA.path} detected`); - }); - - describe("when opening original location project", () => { - it("with project references", () => { - verify(); - }); - - it("when disableSourceOfProjectReferenceRedirect is true", () => { - verify(/*disableSourceOfProjectReferenceRedirect*/ true); - }); - - function verify(disableSourceOfProjectReferenceRedirect?: true) { - const aDTs: File = { - path: `/user/username/projects/a/a.d.ts`, - content: `export declare class A { -} -//# sourceMappingURL=a.d.ts.map -` - }; - const aDTsMap: File = { - path: `/user/username/projects/a/a.d.ts.map`, - content: `{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["./a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;CAAI"}` - }; + function verifyProjectLoadingStartAndFinish(sessionType: string, createSession: (host: TestServerHost) => TestSession) { + describe(sessionType, () => { + it("when project is created by open file", () => { const bTs: File = { path: bTsPath, - content: `import {A} from "../a/a"; new A();` + content: "export class B {}" + }; + const configB: File = { + path: configBPath, + content: "{}" + }; + const host = createServerHost(files.concat(bTs, configB)); + const session = createSession(host); + openFilesForSession([aTs], session); + openFilesForSession([bTs], session); + baselineTsserverLogs("events/projectLoading", `project is created by open file ${sessionType}`, session); + }); + + it("when change is detected in the config file", () => { + const host = createServerHost(files); + const session = createSession(host); + openFilesForSession([aTs], session); + + host.writeFile(configA.path, configA.content); + host.checkTimeoutQueueLengthAndRun(2); + baselineTsserverLogs("events/projectLoading", `change is detected in the config file ${sessionType}`, session); + }); + + it("when change is detected in an extended config file", () => { + const bTs: File = { + path: bTsPath, + content: "export class B {}" }; const configB: File = { path: configBPath, content: JSON.stringify({ - ...(disableSourceOfProjectReferenceRedirect && { - compilerOptions: { - disableSourceOfProjectReferenceRedirect - } - }), - references: [{ path: "../a" }] + extends: "../a/tsconfig.json", }) }; + const host = createServerHost(files.concat(bTs, configB)); + const session = createSession(host); + openFilesForSession([bTs], session); - const { service, session, verifyEventWithOpenTs, verifyEvent } = createSessionToVerifyEvent(files.concat(aDTs, aDTsMap, bTs, configB)); - verifyEventWithOpenTs(bTs, configB.path, 1); + host.writeFile(configA.path, configA.content); + host.checkTimeoutQueueLengthAndRun(2); + baselineTsserverLogs("events/projectLoading", `change is detected in an extended config file ${sessionType}`, session); + }); - session.executeCommandSeq({ - command: ts.server.protocol.CommandTypes.References, - arguments: { - file: bTs.path, - ...protocolLocationFromSubstring(bTs.content, "A()") - } + describe("when opening original location project", () => { + it("with project references", () => { + verify(); }); - checkNumberOfProjects(service, { configuredProjects: 2 }); - const project = service.configuredProjects.get(configA.path)!; - assert.isDefined(project); - verifyEvent( - project, - disableSourceOfProjectReferenceRedirect ? - `Creating project for original file: ${aTs.path} for location: ${aDTs.path}` : - `Creating project for original file: ${aTs.path}` - ); - } - }); + it("when disableSourceOfProjectReferenceRedirect is true", () => { + verify(/*disableSourceOfProjectReferenceRedirect*/ true); + }); - describe("with external projects and config files ", () => { - const projectFileName = `/user/username/projects/a/project.csproj`; + function verify(disableSourceOfProjectReferenceRedirect?: true) { + const aDTs: File = { + path: `/user/username/projects/a/a.d.ts`, + content: `export declare class A { +} +//# sourceMappingURL=a.d.ts.map +` + }; + const aDTsMap: File = { + path: `/user/username/projects/a/a.d.ts.map`, + content: `{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["./a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;CAAI"}` + }; + const bTs: File = { + path: bTsPath, + content: `import {A} from "../a/a"; new A();` + }; + const configB: File = { + path: configBPath, + content: JSON.stringify({ + ...(disableSourceOfProjectReferenceRedirect && { + compilerOptions: { + disableSourceOfProjectReferenceRedirect + } + }), + references: [{ path: "../a" }] + }) + }; - function createSession(lazyConfiguredProjectsFromExternalProject: boolean) { - const { session, service, verifyEvent: verifyEventWorker, getNumberOfEvents } = createSessionToVerifyEvent(files); - service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject } }); - service.openExternalProject({ - projectFileName, - rootFiles: toExternalFiles([aTs.path, configA.path]), - options: {} - } as ts.server.protocol.ExternalProject); - checkNumberOfProjects(service, { configuredProjects: 1 }); - return { session, service, verifyEvent, getNumberOfEvents }; + const host = createServerHost(files.concat(aDTs, aDTsMap, bTs, configB)); + const session = createSession(host); + openFilesForSession([bTs], session); - function verifyEvent() { - const projectA = service.configuredProjects.get(configA.path)!; - assert.isDefined(projectA); - verifyEventWorker(projectA, `Creating configured project in external project: ${projectFileName}`); + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.References, + arguments: { + file: bTs.path, + ...protocolLocationFromSubstring(bTs.content, "A()") + } + }); + baselineTsserverLogs("events/projectLoading", `opening original location project${disableSourceOfProjectReferenceRedirect ? " disableSourceOfProjectReferenceRedirect" : ""} ${sessionType}`, session); } - } - - it("when lazyConfiguredProjectsFromExternalProject is false", () => { - const { verifyEvent } = createSession(/*lazyConfiguredProjectsFromExternalProject*/ false); - verifyEvent(); }); - it("when lazyConfiguredProjectsFromExternalProject is true and file is opened", () => { - const { verifyEvent, getNumberOfEvents, session } = createSession(/*lazyConfiguredProjectsFromExternalProject*/ true); - assert.equal(getNumberOfEvents(), 0); + describe("with external projects and config files ", () => { + const projectFileName = `/user/username/projects/a/project.csproj`; - openFilesForSession([aTs], session); - verifyEvent(); - }); + function createSessionAndOpenProject(lazyConfiguredProjectsFromExternalProject: boolean) { + const host = createServerHost(files); + const session = createSession(host); + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.Configure, + arguments: { + preferences: { lazyConfiguredProjectsFromExternalProject } + } + }); + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.OpenExternalProject, + arguments: { + projectFileName, + rootFiles: toExternalFiles([aTs.path, configA.path]), + options: {} + } + }); + return session; + } - it("when lazyConfiguredProjectsFromExternalProject is disabled", () => { - const { verifyEvent, getNumberOfEvents, service } = createSession(/*lazyConfiguredProjectsFromExternalProject*/ true); - assert.equal(getNumberOfEvents(), 0); + it("when lazyConfiguredProjectsFromExternalProject is false", () => { + const session = createSessionAndOpenProject(/*lazyConfiguredProjectsFromExternalProject*/ false); + baselineTsserverLogs("events/projectLoading", `lazyConfiguredProjectsFromExternalProject is false ${sessionType}`, session); + }); - service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject: false } }); - verifyEvent(); + it("when lazyConfiguredProjectsFromExternalProject is true and file is opened", () => { + const session = createSessionAndOpenProject(/*lazyConfiguredProjectsFromExternalProject*/ true); + openFilesForSession([aTs], session); + baselineTsserverLogs("events/projectLoading", `lazyConfiguredProjectsFromExternalProject is true and file is opened ${sessionType}`, session); + }); + + it("when lazyConfiguredProjectsFromExternalProject is disabled", () => { + const session = createSessionAndOpenProject(/*lazyConfiguredProjectsFromExternalProject*/ true); + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.Configure, + arguments: { + preferences: { lazyConfiguredProjectsFromExternalProject: false } + } + }); + baselineTsserverLogs("events/projectLoading", `lazyConfiguredProjectsFromExternalProject is disabled ${sessionType}`, session); + }); }); }); } - describe("when using event handler", () => { - verifyProjectLoadingStartAndFinish(host => { - const { session, events } = createSessionWithEventTracking(host, [ts.server.ProjectLoadingStartEvent, ts.server.ProjectLoadingFinishEvent]); - return { - session, - getNumberOfEvents: () => events.length, - clearEvents: () => events.length = 0, - verifyProjectLoadEvents: expected => assert.deepEqual(events, expected) - }; - }); - }); - - describe("when using default event handler", () => { - verifyProjectLoadingStartAndFinish(host => { - const { session, getEvents, clearEvents } = createSessionWithDefaultEventHandler(host, [ts.server.ProjectLoadingStartEvent, ts.server.ProjectLoadingFinishEvent]); - return { - session, - getNumberOfEvents: () => getEvents().length, - clearEvents, - verifyProjectLoadEvents - }; - - function verifyProjectLoadEvents(expected: [ts.server.ProjectLoadingStartEvent, ts.server.ProjectLoadingFinishEvent]) { - const actual = getEvents().map(e => ({ eventName: e.event, data: e.body })); - const mappedExpected = expected.map(e => { - const { project, ...rest } = e.data; - return { eventName: e.eventName, data: { projectName: project.getProjectName(), ...rest } }; - }); - assert.deepEqual(actual, mappedExpected); - } - }); - }); + verifyProjectLoadingStartAndFinish("when using event handler", host => createSessionWithCustomEventHandler(host)); + verifyProjectLoadingStartAndFinish("when using default event handler", host => createSession( + host, + { canUseEvents: true, logger: createLoggerWithInMemoryLogs(host) } + )); }); diff --git a/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts b/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts index 9ef212685d5..581b0b577b3 100644 --- a/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts +++ b/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts @@ -7,44 +7,15 @@ import { } from "../../virtualFileSystemWithWatch"; import { baselineTsserverLogs, - createHasErrorMessageLogger, createLoggerWithInMemoryLogs, - createSessionWithDefaultEventHandler, - createSessionWithEventTracking, - Logger, + createSession, + createSessionWithCustomEventHandler, + openFilesForSession, TestSession, } from "../helpers"; describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { - function verifyFiles(caption: string, actual: readonly string[], expected: readonly string[]) { - assert.equal(actual.length, expected.length, `Incorrect number of ${caption}. Actual: ${actual} Expected: ${expected}`); - const seen = new Map(); - ts.forEach(actual, f => { - assert.isFalse(seen.has(f), `${caption}: Found duplicate ${f}. Actual: ${actual} Expected: ${expected}`); - seen.set(f, true); - assert.isTrue(ts.contains(expected, f), `${caption}: Expected not to contain ${f}. Actual: ${actual} Expected: ${expected}`); - }); - } - - function createVerifyInitialOpen(session: TestSession, verifyProjectsUpdatedInBackgroundEventHandler: (events: ts.server.ProjectsUpdatedInBackgroundEvent[]) => void) { - return (file: File) => { - session.executeCommandSeq({ - command: ts.server.protocol.CommandTypes.Open, - arguments: { - file: file.path - } - } as ts.server.protocol.OpenRequest); - verifyProjectsUpdatedInBackgroundEventHandler([]); - }; - } - - interface ProjectsUpdatedInBackgroundEventVerifier { - session: TestSession; - verifyProjectsUpdatedInBackgroundEventHandler(events: ts.server.ProjectsUpdatedInBackgroundEvent[]): void; - verifyInitialOpen(file: File): void; - } - - function verifyProjectsUpdatedInBackgroundEvent(scenario: string, createSession: (host: TestServerHost, logger?: Logger) => ProjectsUpdatedInBackgroundEventVerifier) { + function verifyProjectsUpdatedInBackgroundEvent(scenario: string, createSession: (host: TestServerHost) => TestSession) { it("when adding new file", () => { const commonFile1: File = { path: "/a/b/file1.ts", @@ -62,87 +33,53 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { path: "/a/b/tsconfig.json", content: `{}` }; - const openFiles = [commonFile1.path]; const host = createServerHost([commonFile1, libFile, configFile]); - const { verifyProjectsUpdatedInBackgroundEventHandler, verifyInitialOpen } = createSession(host); - verifyInitialOpen(commonFile1); + const session = createSession(host); + openFilesForSession([commonFile1], session); host.writeFile(commonFile2.path, commonFile2.content); host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: ts.server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); host.writeFile(commonFile3.path, commonFile3.content); host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: ts.server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and when adding new file`, session); }); describe("with --out or --outFile setting", () => { - function verifyEventWithOutSettings(compilerOptions: ts.CompilerOptions = {}) { - const config: File = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions - }) - }; + function verifyEventWithOutSettings(subScenario: string, compilerOptions: ts.CompilerOptions = {}) { + it(subScenario, () => { + const config: File = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions + }) + }; - const f1: File = { - path: "/a/a.ts", - content: "export let x = 1" - }; - const f2: File = { - path: "/a/b.ts", - content: "export let y = 1" - }; + const f1: File = { + path: "/a/a.ts", + content: "export let x = 1" + }; + const f2: File = { + path: "/a/b.ts", + content: "export let y = 1" + }; - const openFiles = [f1.path]; - const files = [f1, config, libFile]; - const host = createServerHost(files); - const { verifyInitialOpen, verifyProjectsUpdatedInBackgroundEventHandler } = createSession(host); - verifyInitialOpen(f1); + const files = [f1, config, libFile]; + const host = createServerHost(files); + const session = createSession(host); + openFilesForSession([f1], session); - host.writeFile(f2.path, f2.content); - host.runQueuedTimeoutCallbacks(); + host.writeFile(f2.path, f2.content); + host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: ts.server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); - - host.writeFile(f2.path, "export let x = 11"); - host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: ts.server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); + host.writeFile(f2.path, "export let x = 11"); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and ${subScenario}`, session); + }); } - - it("when both options are not set", () => { - verifyEventWithOutSettings(); - }); - - it("when --out is set", () => { - const outJs = "/a/out.js"; - verifyEventWithOutSettings({ out: outJs }); - }); - - it("when --outFile is set", () => { - const outJs = "/a/out.js"; - verifyEventWithOutSettings({ outFile: outJs }); - }); + verifyEventWithOutSettings("when both options are not set"); + verifyEventWithOutSettings("when --out is set", { out: "/a/out.js" }); + verifyEventWithOutSettings("when --outFile is set", { outFile: "/a/out.js" }); }); describe("with modules and configured project", () => { @@ -191,50 +128,23 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { const files: File[] = [file1Consumer1, moduleFile1, file1Consumer2, moduleFile2, ...additionalFiles, globalFile3, libFile, configFile]; - const filesToReload = firstReloadFileList && getFiles(firstReloadFileList) || files; + const filesToReload = firstReloadFileList?.map(fileName => ts.find(files, file => file.path === fileName)!) || files; const host = createServerHost([filesToReload[0], configFile]); // Initial project creation - const { session, verifyProjectsUpdatedInBackgroundEventHandler, verifyInitialOpen } = createSession(host); - const openFiles = [filesToReload[0].path]; - verifyInitialOpen(filesToReload[0]); + const session = createSession(host); + openFilesForSession([filesToReload[0]], session); // Since this is first event, it will have all the files filesToReload.forEach(f => host.ensureFileOrFolder(f)); if (!firstReloadFileList) host.runQueuedTimeoutCallbacks(); // Invalidated module resolutions to schedule project update - verifyProjectsUpdatedInBackgroundEvent(); return { - host, + host, session, moduleFile1, file1Consumer1, file1Consumer2, moduleFile2, globalFile3, configFile, updateContentOfOpenFile, - verifyNoProjectsUpdatedInBackgroundEvent, - verifyProjectsUpdatedInBackgroundEvent }; - function getFiles(filelist: string[]) { - return ts.map(filelist, getFile); - } - - function getFile(fileName: string) { - return ts.find(files, file => file.path === fileName)!; - } - - function verifyNoProjectsUpdatedInBackgroundEvent() { - host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([]); - } - - function verifyProjectsUpdatedInBackgroundEvent() { - host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: ts.server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); - } - function updateContentOfOpenFile(file: File, newContent: string) { session.executeCommandSeq({ command: ts.server.protocol.CommandTypes.Change, @@ -252,35 +162,36 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { } it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { - const { host, moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState(); + const { host, moduleFile1, session } = getInitialState(); // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); // Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { console.log('hi'); };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should contains only itself`, session); }); it("should be up-to-date with the reference map changes", () => { - const { host, moduleFile1, file1Consumer1, updateContentOfOpenFile, verifyProjectsUpdatedInBackgroundEvent, verifyNoProjectsUpdatedInBackgroundEvent } = getInitialState(); + const { host, moduleFile1, file1Consumer1, updateContentOfOpenFile, session } = getInitialState(); // Change file1Consumer1 content to `export let y = Foo();` updateContentOfOpenFile(file1Consumer1, "export let y = Foo();"); - verifyNoProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); // Add the import statements back to file1Consumer1 updateContentOfOpenFile(file1Consumer1, `import {Foo} from "./moduleFile1";let y = Foo();`); - verifyNoProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); // Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };` host.writeFile(moduleFile1.path, `export var T: number;export var T2: string;export function Foo() { };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); // Multiple file edits in one go: @@ -288,65 +199,72 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` updateContentOfOpenFile(file1Consumer1, `export let y = Foo();`); host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should be up-to-date with the reference map changes`, session); }); it("should be up-to-date with deleted files", () => { - const { host, moduleFile1, file1Consumer2, verifyProjectsUpdatedInBackgroundEvent } = getInitialState(); + const { host, moduleFile1, file1Consumer2, session } = getInitialState(); // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { };`); // Delete file1Consumer2 host.deleteFile(file1Consumer2.path); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should be up-to-date with deleted files`, session); }); it("should be up-to-date with newly created files", () => { - const { host, moduleFile1, verifyProjectsUpdatedInBackgroundEvent, } = getInitialState(); + const { host, moduleFile1, session, } = getInitialState(); host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { };`); host.writeFile("/a/b/file1Consumer3.ts", `import {Foo} from "./moduleFile1"; let y = Foo();`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should be up-to-date with newly created files`, session); }); it("should detect changes in non-root files", () => { - const { host, moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + const { host, moduleFile1, session } = getInitialState({ configObj: { files: [file1Consumer1Path] }, }); host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); // change file1 internal, and verify only file1 is affected host.writeFile(moduleFile1.path, moduleFile1.content + "var T1: number;"); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should detect changes in non-root files`, session); }); it("should return all files if a global file changed shape", () => { - const { host, globalFile3, verifyProjectsUpdatedInBackgroundEvent } = getInitialState(); + const { host, globalFile3, session } = getInitialState(); host.writeFile(globalFile3.path, globalFile3.content + "var T2: string;"); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should return all files if a global file changed shape`, session); }); it("should always return the file itself if '--isolatedModules' is specified", () => { - const { host, moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + const { host, moduleFile1, session } = getInitialState({ configObj: { compilerOptions: { isolatedModules: true } } }); host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should always return the file itself if --isolatedModules is specified`, session); }); it("should always return the file itself if '--out' or '--outFile' is specified", () => { const outFilePath = "/a/b/out.js"; - const { host, moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + const { host, moduleFile1, session } = getInitialState({ configObj: { compilerOptions: { module: "system", outFile: outFilePath } } }); host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should always return the file itself if --out or --outFile is specified`, session); }); it("should return cascaded affected file list", () => { @@ -354,21 +272,22 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { path: "/a/b/file1Consumer1Consumer1.ts", content: `import {y} from "./file1Consumer1";` }; - const { host, moduleFile1, file1Consumer1, updateContentOfOpenFile, verifyNoProjectsUpdatedInBackgroundEvent, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + const { host, moduleFile1, file1Consumer1, updateContentOfOpenFile, session } = getInitialState({ getAdditionalFileOrFolder: () => [file1Consumer1Consumer1] }); updateContentOfOpenFile(file1Consumer1, file1Consumer1.content + "export var T: number;"); - verifyNoProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); // Doesnt change the shape of file1Consumer1 host.writeFile(moduleFile1.path, `export var T: number;export function Foo() { };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); // Change both files before the timeout updateContentOfOpenFile(file1Consumer1, file1Consumer1.content + "export var T2: number;"); host.writeFile(moduleFile1.path, `export var T2: number;export function Foo() { };`); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should return cascaded affected file list`, session); }); it("should work fine for files with circular references", () => { @@ -384,13 +303,14 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { /// export var t2 = 10;` }; - const { host, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + const { host, session } = getInitialState({ getAdditionalFileOrFolder: () => [file1, file2], firstReloadFileList: [file1.path, libFile.path, file2.path, configFilePath] }); host.writeFile(file2.path, file2.content + "export var t3 = 10;"); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should work fine for files with circular references`, session); }); it("should detect removed code file", () => { @@ -400,13 +320,14 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { /// export var x = Foo();` }; - const { host, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + const { host, session } = getInitialState({ getAdditionalFileOrFolder: () => [referenceFile1], firstReloadFileList: [referenceFile1.path, libFile.path, moduleFile1Path, configFilePath] }); host.deleteFile(moduleFile1Path); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should detect removed code file`, session); }); it("should detect non-existing code file", () => { @@ -416,17 +337,18 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { /// export var x = Foo();` }; - const { host, moduleFile2, updateContentOfOpenFile, verifyNoProjectsUpdatedInBackgroundEvent, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + const { host, moduleFile2, updateContentOfOpenFile, session } = getInitialState({ getAdditionalFileOrFolder: () => [referenceFile1], firstReloadFileList: [referenceFile1.path, libFile.path, configFilePath] }); updateContentOfOpenFile(referenceFile1, referenceFile1.content + "export var yy = Foo();"); - verifyNoProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); // Create module File2 and see both files are saved host.writeFile(moduleFile2.path, moduleFile2.content); - verifyProjectsUpdatedInBackgroundEvent(); + host.runQueuedTimeoutCallbacks(); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and should detect non-existing code file`, session); }); }); @@ -451,34 +373,19 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { content: JSON.stringify({ compilerOptions: { typeRoots: [] } }) }; - const openFiles = [file1.path]; const host = createServerHost([file1, file3, libFile, configFile]); - const { session, verifyInitialOpen, verifyProjectsUpdatedInBackgroundEventHandler } = createSession(host, createLoggerWithInMemoryLogs(host)); - verifyInitialOpen(file1); + const session = createSession(host); + openFilesForSession([file1], session); file3.content += "export class d {}"; host.writeFile(file3.path, file3.content); host.checkTimeoutQueueLengthAndRun(2); - // Since this is first event - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: ts.server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); - host.writeFile(file2.path, file2.content); host.runQueuedTimeoutCallbacks(); // For invalidation host.runQueuedTimeoutCallbacks(); // For actual update - verifyProjectsUpdatedInBackgroundEventHandler(useSlashRootAsSomeNotRootFolderInUserDirectory ? [{ - eventName: ts.server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }] : []); - baselineTsserverLogs("projectUpdatedInBackground", `${scenario} and ${subScenario}`, session); + baselineTsserverLogs("events/projectUpdatedInBackground", `${scenario} and ${subScenario}`, session); }); } verifyWithMaxCacheLimit("project is not at root level", /*useSlashRootAsSomeNotRootFolderInUserDirectory*/ true); @@ -487,85 +394,23 @@ describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { } describe("when event handler is set in the session", () => { - verifyProjectsUpdatedInBackgroundEvent("when event handler is set in the session", createSessionWithProjectChangedEventHandler); - - function createSessionWithProjectChangedEventHandler(host: TestServerHost, logger: Logger | undefined): ProjectsUpdatedInBackgroundEventVerifier { - const { session, events: projectChangedEvents } = createSessionWithEventTracking( - host, - ts.server.ProjectsUpdatedInBackgroundEvent, - logger && { logger } - ); - return { - session, - verifyProjectsUpdatedInBackgroundEventHandler, - verifyInitialOpen: createVerifyInitialOpen(session, verifyProjectsUpdatedInBackgroundEventHandler) - }; - - function eventToString(event: ts.server.ProjectsUpdatedInBackgroundEvent) { - return JSON.stringify(event && { eventName: event.eventName, data: event.data }); - } - - function eventsToString(events: readonly ts.server.ProjectsUpdatedInBackgroundEvent[]) { - return "[" + ts.map(events, eventToString).join(",") + "]"; - } - - function verifyProjectsUpdatedInBackgroundEventHandler(expectedEvents: readonly ts.server.ProjectsUpdatedInBackgroundEvent[]) { - assert.equal(projectChangedEvents.length, expectedEvents.length, `Incorrect number of events Actual: ${eventsToString(projectChangedEvents)} Expected: ${eventsToString(expectedEvents)}`); - ts.forEach(projectChangedEvents, (actualEvent, i) => { - const expectedEvent = expectedEvents[i]; - assert.strictEqual(actualEvent.eventName, expectedEvent.eventName); - verifyFiles("openFiles", actualEvent.data.openFiles, expectedEvent.data.openFiles); - }); - - // Verified the events, reset them - projectChangedEvents.length = 0; - } - } + verifyProjectsUpdatedInBackgroundEvent("when event handler is set in the session", createSessionWithCustomEventHandler); }); describe("when event handler is not set but session is created with canUseEvents = true", () => { describe("without noGetErrOnBackgroundUpdate, diagnostics for open files are queued", () => { - verifyProjectsUpdatedInBackgroundEvent("without noGetErrOnBackgroundUpdate", createSessionThatUsesEvents); + verifyProjectsUpdatedInBackgroundEvent("without noGetErrOnBackgroundUpdate", host => createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + })); }); describe("with noGetErrOnBackgroundUpdate, diagnostics for open file are not queued", () => { - verifyProjectsUpdatedInBackgroundEvent("with noGetErrOnBackgroundUpdate", (host, logger) => createSessionThatUsesEvents(host, logger, /*noGetErrOnBackgroundUpdate*/ true)); + verifyProjectsUpdatedInBackgroundEvent("with noGetErrOnBackgroundUpdate", host => createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host), + noGetErrOnBackgroundUpdate: true + })); }); - - - function createSessionThatUsesEvents(host: TestServerHost, logger: Logger | undefined, noGetErrOnBackgroundUpdate?: boolean): ProjectsUpdatedInBackgroundEventVerifier { - const { session, getEvents, clearEvents } = createSessionWithDefaultEventHandler( - host, - ts.server.ProjectsUpdatedInBackgroundEvent, - { noGetErrOnBackgroundUpdate, logger: logger || createHasErrorMessageLogger() } - ); - - return { - session, - verifyProjectsUpdatedInBackgroundEventHandler, - verifyInitialOpen: createVerifyInitialOpen(session, verifyProjectsUpdatedInBackgroundEventHandler) - }; - - function verifyProjectsUpdatedInBackgroundEventHandler(expected: readonly ts.server.ProjectsUpdatedInBackgroundEvent[]) { - const expectedEvents: ts.server.protocol.ProjectsUpdatedInBackgroundEventBody[] = ts.map(expected, e => { - return { - openFiles: e.data.openFiles - }; - }); - const events = getEvents(); - assert.equal(events.length, expectedEvents.length, `Incorrect number of events Actual: ${ts.map(events, e => e.body)} Expected: ${expectedEvents}`); - ts.forEach(events, (actualEvent, i) => { - const expectedEvent = expectedEvents[i]; - verifyFiles("openFiles", actualEvent.body.openFiles, expectedEvent.openFiles); - }); - - // Verified the events, reset them - clearEvents(); - - if (events.length) { - host.checkTimeoutQueueLength(noGetErrOnBackgroundUpdate ? 0 : 1); // Error checking queued only if not noGetErrOnBackgroundUpdate - } - } - } }); }); diff --git a/src/testRunner/unittests/tsserver/helpers.ts b/src/testRunner/unittests/tsserver/helpers.ts index db63fa0dc83..17b2025cc1f 100644 --- a/src/testRunner/unittests/tsserver/helpers.ts +++ b/src/testRunner/unittests/tsserver/helpers.ts @@ -387,81 +387,6 @@ export function toExternalFiles(fileNames: string[]) { return ts.map(fileNames, toExternalFile); } -export function fileStats(nonZeroStats: Partial): ts.server.FileStats { - return { ts: 0, tsSize: 0, tsx: 0, tsxSize: 0, dts: 0, dtsSize: 0, js: 0, jsSize: 0, jsx: 0, jsxSize: 0, deferred: 0, deferredSize: 0, ...nonZeroStats }; -} - -export class TestServerEventManager { - private events: ts.server.ProjectServiceEvent[] = []; - readonly session: TestSession; - readonly service: ts.server.ProjectService; - readonly host: TestServerHost; - constructor(files: File[], suppressDiagnosticEvents?: boolean) { - this.host = createServerHost(files); - this.session = createSession(this.host, { - canUseEvents: true, - eventHandler: event => this.events.push(event), - suppressDiagnosticEvents, - }); - this.service = this.session.getProjectService(); - } - - getEvents(): readonly ts.server.ProjectServiceEvent[] { - const events = this.events; - this.events = []; - return events; - } - - getEvent(eventName: T["eventName"]): T["data"] { - let eventData: T["data"] | undefined; - ts.filterMutate(this.events, e => { - if (e.eventName === eventName) { - if (eventData !== undefined) { - assert(false, "more than one event found"); - } - eventData = e.data; - return false; - } - return true; - }); - return ts.Debug.checkDefined(eventData); - } - - hasZeroEvent(eventName: T["eventName"]) { - this.events.forEach(event => assert.notEqual(event.eventName, eventName)); - } - - assertProjectInfoTelemetryEvent(partial: Partial, configFile = "/tsconfig.json"): void { - assert.deepEqual(this.getEvent(ts.server.ProjectInfoTelemetryEvent), { - projectId: ts.sys.createSHA256Hash!(configFile), - fileStats: fileStats({ ts: 1 }), - compilerOptions: {}, - extends: false, - files: false, - include: false, - exclude: false, - compileOnSave: false, - typeAcquisition: { - enable: false, - exclude: false, - include: false, - }, - configFileName: "tsconfig.json", - projectType: "configured", - languageServiceEnabled: true, - version: ts.version, - ...partial, - }); - } - - assertOpenFileTelemetryEvent(info: ts.server.OpenFileInfo): void { - assert.deepEqual(this.getEvent(ts.server.OpenFileInfoTelemetryEvent), { info }); - } - assertNoOpenFilesTelemetryEvent(): void { - this.hasZeroEvent(ts.server.OpenFileInfoTelemetryEvent); - } -} - export type TestSessionAndServiceHost = TestServerHostTrackingWrittenFiles & { patched: boolean; baselineHost(title: string): void; @@ -528,7 +453,6 @@ export interface TestSessionOptions extends ts.server.SessionOptions { export type TestSessionRequest = Pick; export class TestSession extends ts.server.Session { private seq = 0; - public events: ts.server.protocol.Event[] = []; public testhost: TestSessionAndServiceHost; public override logger: Logger; @@ -574,13 +498,7 @@ export class TestSession extends ts.server.Session { return this.executeCommand(request); } - public override event(body: T, eventName: string) { - this.events.push(ts.server.toEvent(eventName, body)); - super.event(body, eventName); - } - public clearMessages() { - ts.clear(this.events); this.testhost.clearOutput(); } } @@ -610,38 +528,32 @@ export function createSession(host: TestServerHost, opts: Partial(host: TestServerHost, eventNames: T["eventName"] | T["eventName"][], opts: Partial = {}) { - const events: T[] = []; - const session = createSession(host, { - eventHandler: e => { - if (ts.isArray(eventNames) ? eventNames.some(eventName => e.eventName === eventName) : eventNames === e.eventName) { - events.push(e as T); - } - }, - ...opts - }); - - return { session, events }; -} - -export function createSessionWithDefaultEventHandler(host: TestServerHost, eventNames: T["event"] | T["event"][], opts: Partial = {}) { - const session = createSession(host, { canUseEvents: true, ...opts }); - - return { - session, - getEvents, - clearEvents - }; - - function getEvents() { - return ts.mapDefined(host.getOutput(), s => { - const e = mapOutputToJson(s); - return (ts.isArray(eventNames) ? eventNames.some(eventName => e.event === eventName) : e.event === eventNames) ? e as T : undefined; - }); - } - - function clearEvents() { - session.clearMessages(); +export function createSessionWithCustomEventHandler(host: TestServerHost, opts?: Partial) { + const session = createSession(host, { eventHandler, logger: createLoggerWithInMemoryLogs(host), ...opts }); + return session; + function eventHandler(event: ts.server.ProjectServiceEvent) { + let data = event.data as any; + switch (event.eventName) { + // No change to data + case ts.server.ProjectsUpdatedInBackgroundEvent: + case ts.server.LargeFileReferencedEvent: + case ts.server.ProjectInfoTelemetryEvent: + case ts.server.OpenFileInfoTelemetryEvent: + break; + // Convert project to project name + case ts.server.ProjectLoadingStartEvent: + case ts.server.ProjectLoadingFinishEvent: + case ts.server.ProjectLanguageServiceStateEvent: + data = { ...data, project: event.data.project.getProjectName() }; + break; + // Map diagnostics + case ts.server.ConfigFileDiagEvent: + data = { ...data, diagnostics: ts.map(event.data.diagnostics, diagnostic => ts.server.formatDiagnosticToProtocol(diagnostic, /*includeFileName*/ true)) }; + break; + default: + ts.Debug.assertNever(event); + } + session.event(data, `CustomHandler::${event.eventName}`); } } diff --git a/src/testRunner/unittests/tsserver/telemetry.ts b/src/testRunner/unittests/tsserver/telemetry.ts index 1697ac9e97d..cdb3ab39a18 100644 --- a/src/testRunner/unittests/tsserver/telemetry.ts +++ b/src/testRunner/unittests/tsserver/telemetry.ts @@ -1,18 +1,24 @@ import * as ts from "../../_namespaces/ts"; -import { File } from "../virtualFileSystemWithWatch"; +import { createServerHost, File } from "../virtualFileSystemWithWatch"; import { - checkNumberOfProjects, - fileStats, - TestServerEventManager, + baselineTsserverLogs, + closeFilesForSession, + createLoggerWithInMemoryLogs, + createSession, + openFilesForSession, toExternalFiles, } from "./helpers"; describe("unittests:: tsserver:: project telemetry", () => { it("does nothing for inferred project", () => { const file = makeFile("/a.js"); - const et = new TestServerEventManager([file]); - et.service.openClientFile(file.path); - et.hasZeroEvent(ts.server.ProjectInfoTelemetryEvent); + const host = createServerHost([file]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + }); + openFilesForSession([file], session); + baselineTsserverLogs("telemetry", "does nothing for inferred project", session); }); it("only sends an event once", () => { @@ -20,22 +26,16 @@ describe("unittests:: tsserver:: project telemetry", () => { const file2 = makeFile("/b.ts"); const tsconfig = makeFile("/a/tsconfig.json", {}); - const et = new TestServerEventManager([file, file2, tsconfig]); - et.service.openClientFile(file.path); - et.assertProjectInfoTelemetryEvent({}, tsconfig.path); - - et.service.closeClientFile(file.path); - checkNumberOfProjects(et.service, { configuredProjects: 1 }); - - et.service.openClientFile(file2.path); - checkNumberOfProjects(et.service, { inferredProjects: 1 }); - - et.hasZeroEvent(ts.server.ProjectInfoTelemetryEvent); - - et.service.openClientFile(file.path); - checkNumberOfProjects(et.service, { configuredProjects: 1, inferredProjects: 1 }); - - et.hasZeroEvent(ts.server.ProjectInfoTelemetryEvent); + const host = createServerHost([file, file2, tsconfig]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + }); + openFilesForSession([file], session); + closeFilesForSession([file], session); + openFilesForSession([file2], session); + openFilesForSession([file], session); + baselineTsserverLogs("telemetry", "only sends an event once", session); }); it("counts files by extension", () => { @@ -44,54 +44,49 @@ describe("unittests:: tsserver:: project telemetry", () => { const compilerOptions: ts.CompilerOptions = { allowJs: true }; const tsconfig = makeFile("/tsconfig.json", { compilerOptions, include: ["src"] }); - const et = new TestServerEventManager([...files, notIncludedFile, tsconfig]); - et.service.openClientFile(files[0].path); - et.assertProjectInfoTelemetryEvent({ - fileStats: fileStats({ ts: 2, tsx: 1, js: 1, jsx: 1, dts: 1 }), - compilerOptions, - include: true, + const host = createServerHost([...files, notIncludedFile, tsconfig]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) }); + openFilesForSession([files[0]], session); + baselineTsserverLogs("telemetry", "counts files by extension", session); }); it("works with external project", () => { const file1 = makeFile("/a.ts"); - const et = new TestServerEventManager([file1]); + const host = createServerHost([file1]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + }); const compilerOptions: ts.server.protocol.CompilerOptions = { strict: true }; const projectFileName = "/hunter2/foo.csproj"; open(); - // TODO: Apparently compilerOptions is mutated, so have to repeat it here! - et.assertProjectInfoTelemetryEvent({ - compilerOptions: { strict: true }, - compileOnSave: true, - // These properties can't be present for an external project, so they are undefined instead of false. - extends: undefined, - files: undefined, - include: undefined, - exclude: undefined, - configFileName: "other", - projectType: "external", - }, "/hunter2/foo.csproj"); - // Also test that opening an external project only sends an event once. - et.service.closeClientFile(file1.path); + closeFilesForSession([file1], session); - et.service.closeExternalProject(projectFileName); - checkNumberOfProjects(et.service, { externalProjects: 0 }); + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.CloseExternalProject, + arguments: { projectFileName } + }); open(); - assert.equal(et.getEvents().length, 0); + baselineTsserverLogs("telemetry", "works with external project", session); function open(): void { - et.service.openExternalProject({ - rootFiles: toExternalFiles([file1.path]), - options: compilerOptions, - projectFileName, + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.OpenExternalProject, + arguments: { + rootFiles: toExternalFiles([file1.path]), + options: compilerOptions, + projectFileName, + } }); - checkNumberOfProjects(et.service, { externalProjects: 1 }); - et.service.openClientFile(file1.path); // Only on file open the project will be updated + openFilesForSession([file1], session); // Only on file open the project will be updated } }); @@ -128,39 +123,16 @@ describe("unittests:: tsserver:: project telemetry", () => { // Sensitive data doesn't get through even if sent to an option of safe type checkJs: "hunter2" as any as boolean, }; - const safeCompilerOptions: ts.CompilerOptions = { - project: "", - outFile: "", - outDir: "", - rootDir: "", - baseUrl: "", - rootDirs: [""], - typeRoots: [""], - types: [""], - sourceRoot: "", - mapRoot: "", - jsxFactory: "", - out: "", - reactNamespace: "", - charset: "", - locale: "", - declarationDir: "", - paths: "" as any, - - declaration: true, - - lib: ["es6", "dom"], - }; (compilerOptions as any).unknownCompilerOption = "hunter2"; // These are always ignored. const tsconfig = makeFile("/tsconfig.json", { compilerOptions, files: ["/a.ts"] }); - const et = new TestServerEventManager([file, tsconfig]); - et.service.openClientFile(file.path); - - et.assertProjectInfoTelemetryEvent({ - compilerOptions: safeCompilerOptions, - files: true, + const host = createServerHost([file, tsconfig]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) }); + openFilesForSession([file], session); + baselineTsserverLogs("telemetry", "does not expose paths", session); }); it("sends telemetry for extends, files, include, exclude, and compileOnSave", () => { @@ -173,16 +145,13 @@ describe("unittests:: tsserver:: project telemetry", () => { exclude: ["hunter2"], compileOnSave: true, }); - - const et = new TestServerEventManager([tsconfig, file]); - et.service.openClientFile(file.path); - et.assertProjectInfoTelemetryEvent({ - extends: true, - files: true, - include: true, - exclude: true, - compileOnSave: true, + const host = createServerHost([file, tsconfig]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) }); + openFilesForSession([file], session); + baselineTsserverLogs("telemetry", "sends telemetry for extends, files, include, exclude, and compileOnSave", session); }); const autoJsCompilerOptions = { @@ -204,18 +173,13 @@ describe("unittests:: tsserver:: project telemetry", () => { exclude: [], }, }); - const et = new TestServerEventManager([jsconfig, file]); - et.service.openClientFile(file.path); - et.assertProjectInfoTelemetryEvent({ - fileStats: fileStats({ js: 1 }), - compilerOptions: autoJsCompilerOptions, - typeAcquisition: { - enable: true, - include: true, - exclude: false, - }, - configFileName: "jsconfig.json", - }, "/jsconfig.json"); + const host = createServerHost([file, jsconfig]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + }); + openFilesForSession([file], session); + baselineTsserverLogs("telemetry", "sends telemetry for typeAcquisition settings", session); }); it("sends telemetry for file sizes", () => { @@ -224,73 +188,67 @@ describe("unittests:: tsserver:: project telemetry", () => { const tsconfig = makeFile("/jsconfig.json", { compilerOptions: autoJsCompilerOptions }); - const et = new TestServerEventManager([tsconfig, jsFile, tsFile]); - et.service.openClientFile(jsFile.path); - et.assertProjectInfoTelemetryEvent({ - fileStats: fileStats({ js: 1, jsSize: 1, ts: 1, tsSize: 2 }), - compilerOptions: autoJsCompilerOptions, - typeAcquisition: { - enable: true, - include: false, - exclude: false, - }, - configFileName: "jsconfig.json", - }, "/jsconfig.json"); + const host = createServerHost([tsconfig, tsFile, jsFile]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + }); + openFilesForSession([jsFile], session); + baselineTsserverLogs("telemetry", "sends telemetry for file sizes", session); }); it("detects whether language service was disabled", () => { const file = makeFile("/a.js"); const tsconfig = makeFile("/jsconfig.json", {}); - const et = new TestServerEventManager([tsconfig, file]); + const host = createServerHost([tsconfig, file]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + }); const fileSize = ts.server.maxProgramSizeForNonTsFiles + 1; - et.host.getFileSize = () => fileSize; - et.service.openClientFile(file.path); - et.getEvent(ts.server.ProjectLanguageServiceStateEvent); - et.assertProjectInfoTelemetryEvent({ - fileStats: fileStats({ js: 1, jsSize: fileSize }), - compilerOptions: autoJsCompilerOptions, - configFileName: "jsconfig.json", - typeAcquisition: { - enable: true, - include: false, - exclude: false, - }, - languageServiceEnabled: false, - }, "/jsconfig.json"); + host.getFileSize = () => fileSize; + openFilesForSession([file], session); + baselineTsserverLogs("telemetry", "detects whether language service was disabled", session); }); describe("open files telemetry", () => { it("sends event for inferred project", () => { const ajs = makeFile("/a.js", "// @ts-check\nconst x = 0;"); const bjs = makeFile("/b.js"); - const et = new TestServerEventManager([ajs, bjs]); - - et.service.openClientFile(ajs.path); - et.assertOpenFileTelemetryEvent({ checkJs: true }); - - et.service.openClientFile(bjs.path); - et.assertOpenFileTelemetryEvent({ checkJs: false }); + const host = createServerHost([ajs, bjs]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + }); + openFilesForSession([ajs, bjs], session); // No repeated send for opening a file seen before. - et.service.openClientFile(bjs.path); - et.assertNoOpenFilesTelemetryEvent(); + openFilesForSession([bjs], session); + baselineTsserverLogs("telemetry", "sends event for inferred project", session); }); it("not for '.ts' file", () => { const ats = makeFile("/a.ts", ""); - const et = new TestServerEventManager([ats]); - - et.service.openClientFile(ats.path); - et.assertNoOpenFilesTelemetryEvent(); + const host = createServerHost([ats]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + }); + openFilesForSession([ats], session); + baselineTsserverLogs("telemetry", "not for ts file", session); }); it("even for project with 'ts-check' in config", () => { const file = makeFile("/a.js"); const compilerOptions: ts.CompilerOptions = { checkJs: true }; const jsconfig = makeFile("/jsconfig.json", { compilerOptions }); - const et = new TestServerEventManager([jsconfig, file]); - et.service.openClientFile(file.path); - et.assertOpenFileTelemetryEvent({ checkJs: false }); + const host = createServerHost([jsconfig, file]); + const session = createSession(host, { + canUseEvents: true, + logger: createLoggerWithInMemoryLogs(host) + }); + openFilesForSession([file], session); + baselineTsserverLogs("telemetry", "even for project with ts-check in config", session); }); }); }); diff --git a/tests/baselines/reference/tsserver/configuredProjects/should-be-tolerated-without-crashing-the-server.js b/tests/baselines/reference/tsserver/configuredProjects/should-be-tolerated-without-crashing-the-server.js new file mode 100644 index 00000000000..b3bc879d29c --- /dev/null +++ b/tests/baselines/reference/tsserver/configuredProjects/should-be-tolerated-without-crashing-the-server.js @@ -0,0 +1,96 @@ +Info 0 [00:00:21.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/user/username/projects/myproject/file1.ts] +let t = 10; + +//// [/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/tsconfig.json] + + + +Info 1 [00:00:22.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/file1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:23.000] Search path: /user/username/projects/myproject +Info 3 [00:00:24.000] For info: /user/username/projects/myproject/file1.ts :: Config file name: /user/username/projects/myproject/tsconfig.json +Info 4 [00:00:25.000] Creating configuration project /user/username/projects/myproject/tsconfig.json +Info 5 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file +Info 6 [00:00:27.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/myproject/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/myproject/file1.ts to open"}} +Info 7 [00:00:28.000] Config: /user/username/projects/myproject/tsconfig.json : { + "rootNames": [ + "/user/username/projects/myproject/file1.ts" + ], + "options": { + "configFilePath": "/user/username/projects/myproject/tsconfig.json" + } +} +Info 8 [00:00:29.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:30.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:31.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info 11 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:33.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots +Info 13 [00:00:34.000] 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 14 [00:00:35.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:36.000] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info 16 [00:00:37.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/myproject/file1.ts SVC-1-0 "let t = 10;" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:38.000] ----------------------------------------------- +Info 18 [00:00:39.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/myproject/tsconfig.json"}} +Info 19 [00:00:40.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"4a33d78ee40d836c4f4e64c59aed976628aea0013be9585c5ff171dfc41baf98","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":11,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:41.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/myproject/file1.ts","configFile":"/user/username/projects/myproject/tsconfig.json","diagnostics":[{"text":"Cannot read file '/user/username/projects/myproject/tsconfig.json'.","code":5083,"category":"error"}]}} +Info 21 [00:00:42.000] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info 21 [00:00:43.000] Files (2) + +Info 21 [00:00:44.000] ----------------------------------------------- +Info 21 [00:00:45.000] Open files: +Info 21 [00:00:46.000] FileName: /user/username/projects/myproject/file1.ts ProjectRootPath: undefined +Info 21 [00:00:47.000] Projects: /user/username/projects/myproject/tsconfig.json +Info 21 [00:00:48.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} diff --git a/tests/baselines/reference/tsserver/configuredProjects/syntactic-features-work-even-if-language-service-is-disabled.js b/tests/baselines/reference/tsserver/configuredProjects/syntactic-features-work-even-if-language-service-is-disabled.js new file mode 100644 index 00000000000..285a699b65f --- /dev/null +++ b/tests/baselines/reference/tsserver/configuredProjects/syntactic-features-work-even-if-language-service-is-disabled.js @@ -0,0 +1,115 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/app.js] +let x = 1; + +//// [/a/largefile.js] + + +//// [/a/jsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/a/app.js" + } + } +Info 2 [00:00:13.000] Search path: /a +Info 3 [00:00:14.000] For info: /a/app.js :: Config file name: /a/jsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/jsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/jsconfig.json 2000 undefined Project: /a/jsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/jsconfig.json","reason":"Creating possible configured project for /a/app.js to open"}} +Info 7 [00:00:18.000] Config: /a/jsconfig.json : { + "rootNames": [ + "/a/app.js", + "/a/largefile.js" + ], + "options": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "/a/jsconfig.json" + } +} +Info 8 [00:00:19.000] Non TS file size exceeded limit (20971533). Largest files: /a/largefile.js:20971521, /a/app.js:12 +Info 9 [00:00:20.000] event: + {"seq":0,"type":"event","event":"projectLanguageServiceState","body":{"projectName":"/a/jsconfig.json","languageServiceEnabled":false}} +Info 10 [00:00:21.000] FileWatcher:: Added:: WatchInfo: /a/largefile.js 500 undefined WatchType: Closed Script info +Info 11 [00:00:22.000] Starting updateGraphWorker: Project: /a/jsconfig.json +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/jsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] Finishing updateGraphWorker: Project: /a/jsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 14 [00:00:25.000] Project '/a/jsconfig.json' (Configured) +Info 15 [00:00:26.000] Files (1) + /a/app.js SVC-1-0 "let x = 1;" + + + app.js + Matched by default include pattern '**/*' + +Info 16 [00:00:27.000] ----------------------------------------------- +Info 17 [00:00:28.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/jsconfig.json"}} +Info 18 [00:00:29.000] Skipped loading contents of large file /a/largefile.js for info /a/largefile.js: fileSize: 20971521 +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"largeFileReferenced","body":{"file":"/a/largefile.js","fileSize":20971521,"maxFileSize":4194304}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"d0d8dad6731288ecaafd815d288fca9793f4a55553e712b664ec18e525950982","fileStats":{"js":2,"jsSize":12,"jsx":0,"jsxSize":0,"ts":0,"tsSize":0,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true},"typeAcquisition":{"enable":true,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"jsconfig.json","projectType":"configured","languageServiceEnabled":false,"version":"FakeVersion"}}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/app.js","configFile":"/a/jsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 22 [00:00:33.000] Project '/a/jsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/app.js ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/jsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/a/jsconfig.json: *new* + {} +/a/largefile.js: *new* + {} + +Language languageServiceEnabled:: false +Before request + +Info 23 [00:00:40.000] request: + { + "command": "format-full", + "arguments": { + "file": "/a/app.js" + }, + "seq": 1, + "type": "request" + } +Info 24 [00:00:41.000] response: + { + "response": [ + { + "span": { + "start": 7, + "length": 3 + }, + "newText": " " + } + ], + "responseRequired": true + } +After request diff --git a/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-js-file-is-included-by-module-resolution.js b/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-js-file-is-included-by-module-resolution.js new file mode 100644 index 00000000000..3c95fd298ef --- /dev/null +++ b/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-js-file-is-included-by-module-resolution.js @@ -0,0 +1,103 @@ +Info 0 [00:00:23.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/user/username/projects/myproject/src/file.ts] +export var y = 10;import {x} from "./large" + +//// [/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/src/large.js] +export var x = 10; + + +Info 1 [00:00:24.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/src/file.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:25.000] Search path: /user/username/projects/myproject/src +Info 3 [00:00:26.000] For info: /user/username/projects/myproject/src/file.ts :: No config files found. +Info 4 [00:00:27.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info 5 [00:00:28.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info 6 [00:00:29.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info 7 [00:00:30.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info 8 [00:00:31.000] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info 9 [00:00:32.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/large 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info 10 [00:00:33.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/large 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info 11 [00:00:34.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info 12 [00:00:35.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info 13 [00:00:36.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/large.js 500 undefined WatchType: Closed Script info +Info 14 [00:00:37.000] Skipped loading contents of large file /user/username/projects/myproject/src/large.js for info /user/username/projects/myproject/src/large.js: fileSize: 4194305 +Info 15 [00:00:38.000] event: + {"seq":0,"type":"event","event":"largeFileReferenced","body":{"file":"/user/username/projects/myproject/src/large.js","fileSize":4194305,"maxFileSize":4194304}} +Info 16 [00:00:39.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 17 [00:00:40.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info 18 [00:00:41.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info 19 [00:00:42.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info 20 [00:00:43.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info 21 [00:00:44.000] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 22 [00:00:45.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 23 [00:00:46.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/myproject/src/large.js Text-1 "" + /user/username/projects/myproject/src/file.ts SVC-1-0 "export var y = 10;import {x} from \"./large\"" + + + ../../../../../a/lib/lib.d.ts + Default library for target 'es5' + large.js + Imported via "./large" from file 'file.ts' + file.ts + Root file specified for compilation + +Info 24 [00:00:47.000] ----------------------------------------------- +Info 25 [00:00:48.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 25 [00:00:49.000] Files (3) + +Info 25 [00:00:50.000] ----------------------------------------------- +Info 25 [00:00:51.000] Open files: +Info 25 [00:00:52.000] FileName: /user/username/projects/myproject/src/file.ts ProjectRootPath: undefined +Info 25 [00:00:53.000] Projects: /dev/null/inferredProject1* +Info 25 [00:00:54.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/myproject/src/tsconfig.json: *new* + {"pollingInterval":2000} +/user/username/projects/myproject/src/jsconfig.json: *new* + {"pollingInterval":2000} +/user/username/projects/myproject/tsconfig.json: *new* + {"pollingInterval":2000} +/user/username/projects/myproject/jsconfig.json: *new* + {"pollingInterval":2000} +/user/username/projects/myproject/src/large: *new* + {"pollingInterval":500} +/user/username/projects/myproject/src/node_modules/@types: *new* + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/src: *new* + {} +/user/username/projects/myproject/src/large.js: *new* + {} +/a/lib/lib.d.ts: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-js-file-is-included-by-tsconfig.js b/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-js-file-is-included-by-tsconfig.js new file mode 100644 index 00000000000..da117b57bbe --- /dev/null +++ b/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-js-file-is-included-by-tsconfig.js @@ -0,0 +1,104 @@ +Info 0 [00:00:25.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/user/username/projects/myproject/src/file.ts] +export var y = 10; + +//// [/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/tsconfig.json] +{"files":["src/file.ts","src/large.js"],"compilerOptions":{"target":1,"allowJs":true}} + +//// [/user/username/projects/myproject/src/large.js] +export var x = 10; + + +Info 1 [00:00:26.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/src/file.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:27.000] Search path: /user/username/projects/myproject/src +Info 3 [00:00:28.000] For info: /user/username/projects/myproject/src/file.ts :: Config file name: /user/username/projects/myproject/tsconfig.json +Info 4 [00:00:29.000] Creating configuration project /user/username/projects/myproject/tsconfig.json +Info 5 [00:00:30.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file +Info 6 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/myproject/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/myproject/src/file.ts to open"}} +Info 7 [00:00:32.000] Config: /user/username/projects/myproject/tsconfig.json : { + "rootNames": [ + "/user/username/projects/myproject/src/file.ts", + "/user/username/projects/myproject/src/large.js" + ], + "options": { + "allowJs": true, + "configFilePath": "/user/username/projects/myproject/tsconfig.json" + } +} +Info 8 [00:00:33.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/large.js 500 undefined WatchType: Closed Script info +Info 9 [00:00:34.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info 10 [00:00:35.000] Skipped loading contents of large file /user/username/projects/myproject/src/large.js for info /user/username/projects/myproject/src/large.js: fileSize: 4194305 +Info 11 [00:00:36.000] event: + {"seq":0,"type":"event","event":"largeFileReferenced","body":{"file":"/user/username/projects/myproject/src/large.js","fileSize":4194305,"maxFileSize":4194304}} +Info 12 [00:00:37.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 13 [00:00:38.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots +Info 14 [00:00:39.000] 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 15 [00:00:40.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:41.000] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info 17 [00:00:42.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/myproject/src/file.ts SVC-1-0 "export var y = 10;" + /user/username/projects/myproject/src/large.js Text-1 "" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/file.ts + Part of 'files' list in tsconfig.json + src/large.js + Part of 'files' list in tsconfig.json + +Info 18 [00:00:43.000] ----------------------------------------------- +Info 19 [00:00:44.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/myproject/tsconfig.json"}} +Info 20 [00:00:45.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"4a33d78ee40d836c4f4e64c59aed976628aea0013be9585c5ff171dfc41baf98","fileStats":{"js":1,"jsSize":4194305,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":true,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 21 [00:00:46.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/myproject/src/file.ts","configFile":"/user/username/projects/myproject/tsconfig.json","diagnostics":[{"text":"Cannot write file '/user/username/projects/myproject/src/large.js' because it would overwrite input file.","code":5055,"category":"error"},{"start":{"line":1,"offset":69},"end":{"line":1,"offset":70},"text":"Compiler option 'target' requires a value of type string.","code":5024,"category":"error","fileName":"/user/username/projects/myproject/tsconfig.json"}]}} +Info 22 [00:00:47.000] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info 22 [00:00:48.000] Files (3) + +Info 22 [00:00:49.000] ----------------------------------------------- +Info 22 [00:00:50.000] Open files: +Info 22 [00:00:51.000] FileName: /user/username/projects/myproject/src/file.ts ProjectRootPath: undefined +Info 22 [00:00:52.000] Projects: /user/username/projects/myproject/tsconfig.json +Info 22 [00:00:53.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/src/large.js: *new* + {} +/a/lib/lib.d.ts: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-ts-file-is-included-by-module-resolution.js b/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-ts-file-is-included-by-module-resolution.js new file mode 100644 index 00000000000..b04ab9b9f14 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-ts-file-is-included-by-module-resolution.js @@ -0,0 +1,92 @@ +Info 0 [00:00:23.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/user/username/projects/myproject/src/file.ts] +export var y = 10;import {x} from "./large" + +//// [/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/src/large.ts] +export var x = 10; + + +Info 1 [00:00:24.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/src/file.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:25.000] Search path: /user/username/projects/myproject/src +Info 3 [00:00:26.000] For info: /user/username/projects/myproject/src/file.ts :: No config files found. +Info 4 [00:00:27.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info 5 [00:00:28.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info 6 [00:00:29.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info 7 [00:00:30.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info 8 [00:00:31.000] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info 9 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/large.ts 500 undefined WatchType: Closed Script info +Info 10 [00:00:33.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:34.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info 12 [00:00:35.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info 13 [00:00:36.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info 14 [00:00:37.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info 15 [00:00:38.000] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:39.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 17 [00:00:40.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/myproject/src/large.ts Text-1 "export var x = 10;" + /user/username/projects/myproject/src/file.ts SVC-1-0 "export var y = 10;import {x} from \"./large\"" + + + ../../../../../a/lib/lib.d.ts + Default library for target 'es5' + large.ts + Imported via "./large" from file 'file.ts' + file.ts + Root file specified for compilation + +Info 18 [00:00:41.000] ----------------------------------------------- +Info 19 [00:00:42.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 19 [00:00:43.000] Files (3) + +Info 19 [00:00:44.000] ----------------------------------------------- +Info 19 [00:00:45.000] Open files: +Info 19 [00:00:46.000] FileName: /user/username/projects/myproject/src/file.ts ProjectRootPath: undefined +Info 19 [00:00:47.000] Projects: /dev/null/inferredProject1* +Info 19 [00:00:48.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/myproject/src/tsconfig.json: *new* + {"pollingInterval":2000} +/user/username/projects/myproject/src/jsconfig.json: *new* + {"pollingInterval":2000} +/user/username/projects/myproject/tsconfig.json: *new* + {"pollingInterval":2000} +/user/username/projects/myproject/jsconfig.json: *new* + {"pollingInterval":2000} +/user/username/projects/myproject/src/node_modules/@types: *new* + {"pollingInterval":500} +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/src/large.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-ts-file-is-included-by-tsconfig.js b/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-ts-file-is-included-by-tsconfig.js new file mode 100644 index 00000000000..271ed1525de --- /dev/null +++ b/tests/baselines/reference/tsserver/events/largeFileReferenced/when-large-ts-file-is-included-by-tsconfig.js @@ -0,0 +1,101 @@ +Info 0 [00:00:25.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/user/username/projects/myproject/src/file.ts] +export var y = 10; + +//// [/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/tsconfig.json] +{"files":["src/file.ts","src/large.ts"],"compilerOptions":{"target":1,"allowJs":true}} + +//// [/user/username/projects/myproject/src/large.ts] +export var x = 10; + + +Info 1 [00:00:26.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/myproject/src/file.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:27.000] Search path: /user/username/projects/myproject/src +Info 3 [00:00:28.000] For info: /user/username/projects/myproject/src/file.ts :: Config file name: /user/username/projects/myproject/tsconfig.json +Info 4 [00:00:29.000] Creating configuration project /user/username/projects/myproject/tsconfig.json +Info 5 [00:00:30.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/tsconfig.json 2000 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Config file +Info 6 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/myproject/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/myproject/src/file.ts to open"}} +Info 7 [00:00:32.000] Config: /user/username/projects/myproject/tsconfig.json : { + "rootNames": [ + "/user/username/projects/myproject/src/file.ts", + "/user/username/projects/myproject/src/large.ts" + ], + "options": { + "allowJs": true, + "configFilePath": "/user/username/projects/myproject/tsconfig.json" + } +} +Info 8 [00:00:33.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/large.ts 500 undefined WatchType: Closed Script info +Info 9 [00:00:34.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info 10 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:36.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Type roots +Info 12 [00:00:37.000] 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 13 [00:00:38.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 14 [00:00:39.000] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info 15 [00:00:40.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/myproject/src/file.ts SVC-1-0 "export var y = 10;" + /user/username/projects/myproject/src/large.ts Text-1 "export var x = 10;" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/file.ts + Part of 'files' list in tsconfig.json + src/large.ts + Part of 'files' list in tsconfig.json + +Info 16 [00:00:41.000] ----------------------------------------------- +Info 17 [00:00:42.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/myproject/tsconfig.json"}} +Info 18 [00:00:43.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"4a33d78ee40d836c4f4e64c59aed976628aea0013be9585c5ff171dfc41baf98","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":2,"tsSize":36,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":true,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 19 [00:00:44.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/myproject/src/file.ts","configFile":"/user/username/projects/myproject/tsconfig.json","diagnostics":[{"start":{"line":1,"offset":69},"end":{"line":1,"offset":70},"text":"Compiler option 'target' requires a value of type string.","code":5024,"category":"error","fileName":"/user/username/projects/myproject/tsconfig.json"}]}} +Info 20 [00:00:45.000] Project '/user/username/projects/myproject/tsconfig.json' (Configured) +Info 20 [00:00:46.000] Files (3) + +Info 20 [00:00:47.000] ----------------------------------------------- +Info 20 [00:00:48.000] Open files: +Info 20 [00:00:49.000] FileName: /user/username/projects/myproject/src/file.ts ProjectRootPath: undefined +Info 20 [00:00:50.000] Projects: /user/username/projects/myproject/tsconfig.json +Info 20 [00:00:51.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/myproject/tsconfig.json: *new* + {} +/user/username/projects/myproject/src/large.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/projectLanguageServiceState/language-service-disabled-events-are-triggered.js b/tests/baselines/reference/tsserver/events/projectLanguageServiceState/language-service-disabled-events-are-triggered.js new file mode 100644 index 00000000000..08422441878 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLanguageServiceState/language-service-disabled-events-are-triggered.js @@ -0,0 +1,249 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/app.js] +let x = 1; + +//// [/a/largefile.js] + + +//// [/a/jsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "seq": 0, + "type": "request", + "command": "open", + "arguments": { + "file": "/a/app.js" + } + } +Info 2 [00:00:13.000] Search path: /a +Info 3 [00:00:14.000] For info: /a/app.js :: Config file name: /a/jsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/jsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/jsconfig.json 2000 undefined Project: /a/jsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/jsconfig.json","reason":"Creating possible configured project for /a/app.js to open"}} +Info 7 [00:00:18.000] Config: /a/jsconfig.json : { + "rootNames": [ + "/a/app.js", + "/a/largefile.js" + ], + "options": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "/a/jsconfig.json" + } +} +Info 8 [00:00:19.000] Non TS file size exceeded limit (20971531). Largest files: /a/largefile.js:20971521, /a/app.js:10 +Info 9 [00:00:20.000] event: + {"seq":0,"type":"event","event":"projectLanguageServiceState","body":{"projectName":"/a/jsconfig.json","languageServiceEnabled":false}} +Info 10 [00:00:21.000] FileWatcher:: Added:: WatchInfo: /a/largefile.js 500 undefined WatchType: Closed Script info +Info 11 [00:00:22.000] Starting updateGraphWorker: Project: /a/jsconfig.json +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/jsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] Finishing updateGraphWorker: Project: /a/jsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 14 [00:00:25.000] Project '/a/jsconfig.json' (Configured) +Info 15 [00:00:26.000] Files (1) + /a/app.js SVC-1-0 "let x = 1;" + + + app.js + Matched by default include pattern '**/*' + +Info 16 [00:00:27.000] ----------------------------------------------- +Info 17 [00:00:28.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/jsconfig.json"}} +Info 18 [00:00:29.000] Skipped loading contents of large file /a/largefile.js for info /a/largefile.js: fileSize: 20971521 +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"largeFileReferenced","body":{"file":"/a/largefile.js","fileSize":20971521,"maxFileSize":4194304}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"d0d8dad6731288ecaafd815d288fca9793f4a55553e712b664ec18e525950982","fileStats":{"js":2,"jsSize":10,"jsx":0,"jsxSize":0,"ts":0,"tsSize":0,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true},"typeAcquisition":{"enable":true,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"jsconfig.json","projectType":"configured","languageServiceEnabled":false,"version":"FakeVersion"}}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/app.js","configFile":"/a/jsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 22 [00:00:33.000] Project '/a/jsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/app.js ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/jsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/a/jsconfig.json: *new* + {} +/a/largefile.js: *new* + {} + +Language service enabled: false +Info 23 [00:00:43.000] FileWatcher:: Triggered with /a/jsconfig.json 1:: WatchInfo: /a/jsconfig.json 2000 undefined Project: /a/jsconfig.json WatchType: Config file +Info 24 [00:00:44.000] Scheduled: /a/jsconfig.json +Info 25 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 26 [00:00:46.000] Elapsed:: *ms FileWatcher:: Triggered with /a/jsconfig.json 1:: WatchInfo: /a/jsconfig.json 2000 undefined Project: /a/jsconfig.json WatchType: Config file +Before checking timeout queue length (2) and running +//// [/a/jsconfig.json] +{"exclude":["largefile.js"]} + + +Info 27 [00:00:47.000] Running: /a/jsconfig.json +Info 28 [00:00:48.000] Reloading configured project /a/jsconfig.json +Info 29 [00:00:49.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/jsconfig.json","reason":"Change in config file detected"}} +Info 30 [00:00:50.000] Config: /a/jsconfig.json : { + "rootNames": [ + "/a/app.js" + ], + "options": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "/a/jsconfig.json" + } +} +Info 31 [00:00:51.000] event: + {"seq":0,"type":"event","event":"projectLanguageServiceState","body":{"projectName":"/a/jsconfig.json","languageServiceEnabled":true}} +Info 32 [00:00:52.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 33 [00:00:53.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 34 [00:00:54.000] Starting updateGraphWorker: Project: /a/jsconfig.json +Info 35 [00:00:55.000] Finishing updateGraphWorker: Project: /a/jsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 36 [00:00:56.000] Project '/a/jsconfig.json' (Configured) +Info 37 [00:00:57.000] Files (1) + /a/app.js SVC-1-0 "let x = 1;" + + + app.js + Matched by default include pattern '**/*' + +Info 38 [00:00:58.000] ----------------------------------------------- +TI:: Creating typing installer + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/jsconfig.json: + {} +/a/largefile.js: + {} + +FsWatchesRecursive:: +/a: *new* + {} + +TI:: [00:00:59.000] Global cache location '/a/data/', safe file path '/safeList.json', types map path /typesMap.json +TI:: [00:01:00.000] Processing cache location '/a/data/' +TI:: [00:01:01.000] Trying to find '/a/data/package.json'... +TI:: [00:01:02.000] Finished processing cache location '/a/data/' +TI:: [00:01:03.000] Npm config file: /a/data/package.json +TI:: [00:01:04.000] Npm config file: '/a/data/package.json' is missing, creating new one... +Info 39 [00:01:07.000] DirectoryWatcher:: Triggered with /a/data :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 40 [00:01:08.000] Scheduled: /a/jsconfig.json +Info 41 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 42 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/data :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 43 [00:01:13.000] DirectoryWatcher:: Triggered with /a/data/package.json :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 44 [00:01:14.000] Config: /a/jsconfig.json Detected new package.json: /a/data/package.json +Info 45 [00:01:15.000] FileWatcher:: Added:: WatchInfo: /a/data/package.json 250 undefined WatchType: package.json file +Info 46 [00:01:16.000] Project: /a/jsconfig.json Detected file add/remove of non supported extension: /a/data/package.json +Info 47 [00:01:17.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/data/package.json :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +TI:: [00:01:18.000] Updating types-registry npm package... +TI:: [00:01:19.000] npm install --ignore-scripts types-registry@latest +Info 48 [00:01:24.000] DirectoryWatcher:: Triggered with /a/data/node_modules :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 49 [00:01:25.000] Scheduled: /a/jsconfig.json, Cancelled earlier one +Info 50 [00:01:26.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 51 [00:01:27.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/data/node_modules :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 52 [00:01:29.000] DirectoryWatcher:: Triggered with /a/data/node_modules/types-registry :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 53 [00:01:30.000] Scheduled: /a/jsconfig.json, Cancelled earlier one +Info 54 [00:01:31.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 55 [00:01:32.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/data/node_modules/types-registry :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 56 [00:01:34.000] DirectoryWatcher:: Triggered with /a/data/node_modules/types-registry/index.json :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +Info 57 [00:01:35.000] Project: /a/jsconfig.json Detected file add/remove of non supported extension: /a/data/node_modules/types-registry/index.json +Info 58 [00:01:36.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/data/node_modules/types-registry/index.json :: WatchInfo: /a 1 undefined Config: /a/jsconfig.json WatchType: Wild card directory +TI:: [00:01:37.000] TI:: Updated types-registry npm package +TI:: typing installer creation complete +//// [/a/data/package.json] +{ "private": true } + +//// [/a/data/node_modules/types-registry/index.json] +{ + "entries": {} +} + + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/jsconfig.json: + {} +/a/largefile.js: + {} +/a/data/package.json: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +TI:: [00:01:38.000] Got install request {"projectName":"/a/jsconfig.json","fileNames":["/a/app.js"],"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"configFilePath":"/a/jsconfig.json","allowNonTsExtensions":true},"typeAcquisition":{"enable":true,"include":[],"exclude":[]},"projectRootPath":"/a","cachePath":"/a/data/","kind":"discover"} +TI:: [00:01:39.000] Request specifies cache path '/a/data/', loading cached information... +TI:: [00:01:40.000] Processing cache location '/a/data/' +TI:: [00:01:41.000] Cache location was already processed... +TI:: [00:01:42.000] Failed to load safelist from types map file '/typesMap.json' +TI:: [00:01:43.000] Explicitly included types: [] +TI:: [00:01:44.000] Result: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/a/bower_components","/a/node_modules"]} +TI:: [00:01:45.000] Finished typings discovery: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/a/bower_components","/a/node_modules"]} +TI:: [00:01:46.000] DirectoryWatcher:: Added:: WatchInfo: /a/bower_components +TI:: [00:01:47.000] DirectoryWatcher:: Added:: WatchInfo: /a/bower_components 1 undefined Project: /a/jsconfig.json watcher already invoked: false +TI:: [00:01:48.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/bower_components 1 undefined Project: /a/jsconfig.json watcher already invoked: false +TI:: [00:01:49.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules +TI:: [00:01:50.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules 1 undefined Project: /a/jsconfig.json watcher already invoked: false +TI:: [00:01:51.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules 1 undefined Project: /a/jsconfig.json watcher already invoked: false +TI:: [00:01:52.000] Sending response: + {"projectName":"/a/jsconfig.json","typeAcquisition":{"enable":true,"include":[],"exclude":[]},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"configFilePath":"/a/jsconfig.json","allowNonTsExtensions":true},"typings":[],"kind":"action::set"} +TI:: [00:01:53.000] No new typings were requested as a result of typings discovery +Info 59 [00:01:54.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/jsconfig.json"}} +Info 60 [00:01:55.000] Starting updateGraphWorker: Project: /a/jsconfig.json +Info 61 [00:01:56.000] Finishing updateGraphWorker: Project: /a/jsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 62 [00:01:57.000] Same program as before +Info 63 [00:01:58.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/jsconfig.json","configFile":"/a/jsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +After checking timeout queue length (2) and running + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/bower_components: *new* + {"pollingInterval":500} +/a/node_modules: *new* + {"pollingInterval":500} + +FsWatches:: +/a/jsconfig.json: + {} +/a/largefile.js: + {} +/a/data/package.json: + {} + +FsWatchesRecursive:: +/a: + {} + +Language service enabled: true \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/projectLanguageServiceStateEvent/large-file-size-is-determined-correctly.js b/tests/baselines/reference/tsserver/events/projectLanguageServiceState/large-file-size-is-determined-correctly.js similarity index 100% rename from tests/baselines/reference/tsserver/projectLanguageServiceStateEvent/large-file-size-is-determined-correctly.js rename to tests/baselines/reference/tsserver/events/projectLanguageServiceState/large-file-size-is-determined-correctly.js diff --git a/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-an-extended-config-file-when-using-default-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-an-extended-config-file-when-using-default-event-handler.js new file mode 100644 index 00000000000..1372514c1b5 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-an-extended-config-file-when-using-default-event-handler.js @@ -0,0 +1,153 @@ +Info 0 [00:00:27.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + +//// [/user/username/projects/b/b.ts] +export class B {} + +//// [/user/username/projects/b/tsconfig.json] +{"extends":"../a/tsconfig.json"} + + +Info 1 [00:00:28.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/b/b.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:29.000] Search path: /user/username/projects/b +Info 3 [00:00:30.000] For info: /user/username/projects/b/b.ts :: Config file name: /user/username/projects/b/tsconfig.json +Info 4 [00:00:31.000] Creating configuration project /user/username/projects/b/tsconfig.json +Info 5 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/b/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 6 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/b/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/b/b.ts to open"}} +Info 7 [00:00:34.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "configFilePath": "/user/username/projects/b/tsconfig.json" + } +} +Info 8 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Extended config file +Info 9 [00:00:36.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:37.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 11 [00:00:38.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 12 [00:00:39.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 13 [00:00:40.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:41.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:42.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:43.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 17 [00:00:44.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/b/b.ts SVC-1-0 "export class B {}" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + b.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:45.000] ----------------------------------------------- +Info 19 [00:00:46.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/b/tsconfig.json"}} +Info 20 [00:00:47.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20501ec57de369fa110ede8c3db8fe97460676d82a7b594783e32439eba20158","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":17,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":true,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 21 [00:00:48.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/b/b.ts","configFile":"/user/username/projects/b/tsconfig.json","diagnostics":[]}} +Info 22 [00:00:49.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 22 [00:00:50.000] Files (2) + +Info 22 [00:00:51.000] ----------------------------------------------- +Info 22 [00:00:52.000] Open files: +Info 22 [00:00:53.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 22 [00:00:54.000] Projects: /user/username/projects/b/tsconfig.json +Info 22 [00:00:55.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: *new* + {} +/user/username/projects/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/b: *new* + {} + +Info 23 [00:00:59.000] FileWatcher:: Triggered with /user/username/projects/a/tsconfig.json 1:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Extended config file +Info 24 [00:01:00.000] Scheduled: /user/username/projects/b/tsconfig.json +Info 25 [00:01:01.000] Scheduled: *ensureProjectForOpenFiles* +Info 26 [00:01:02.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/a/tsconfig.json 1:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Extended config file +Before checking timeout queue length (2) and running +//// [/user/username/projects/a/tsconfig.json] file written with same contents + +Info 27 [00:01:03.000] Running: /user/username/projects/b/tsconfig.json +Info 28 [00:01:04.000] Reloading configured project /user/username/projects/b/tsconfig.json +Info 29 [00:01:05.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/b/tsconfig.json","reason":"Change in extended config file /user/username/projects/a/tsconfig.json detected"}} +Info 30 [00:01:06.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "configFilePath": "/user/username/projects/b/tsconfig.json" + } +} +Info 31 [00:01:07.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 32 [00:01:08.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Not Elapsed:: *ms +Info 33 [00:01:09.000] Same program as before +Info 34 [00:01:10.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/b/tsconfig.json"}} +Info 35 [00:01:11.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/b/tsconfig.json","configFile":"/user/username/projects/b/tsconfig.json","diagnostics":[]}} +Info 36 [00:01:12.000] Running: *ensureProjectForOpenFiles* +Info 37 [00:01:13.000] Before ensureProjectForOpenFiles: +Info 38 [00:01:14.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 38 [00:01:15.000] Files (2) + +Info 38 [00:01:16.000] ----------------------------------------------- +Info 38 [00:01:17.000] Open files: +Info 38 [00:01:18.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 38 [00:01:19.000] Projects: /user/username/projects/b/tsconfig.json +Info 38 [00:01:20.000] After ensureProjectForOpenFiles: +Info 39 [00:01:21.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 39 [00:01:22.000] Files (2) + +Info 39 [00:01:23.000] ----------------------------------------------- +Info 39 [00:01:24.000] Open files: +Info 39 [00:01:25.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 39 [00:01:26.000] Projects: /user/username/projects/b/tsconfig.json +Info 39 [00:01:27.000] got projects updated in background, updating diagnostics for /user/username/projects/b/b.ts +Info 40 [00:01:28.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/b/b.ts"]}} +After checking timeout queue length (2) and running diff --git a/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-an-extended-config-file-when-using-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-an-extended-config-file-when-using-event-handler.js new file mode 100644 index 00000000000..288f784f66f --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-an-extended-config-file-when-using-event-handler.js @@ -0,0 +1,152 @@ +Info 0 [00:00:27.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + +//// [/user/username/projects/b/b.ts] +export class B {} + +//// [/user/username/projects/b/tsconfig.json] +{"extends":"../a/tsconfig.json"} + + +Info 1 [00:00:28.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/b/b.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:29.000] Search path: /user/username/projects/b +Info 3 [00:00:30.000] For info: /user/username/projects/b/b.ts :: Config file name: /user/username/projects/b/tsconfig.json +Info 4 [00:00:31.000] Creating configuration project /user/username/projects/b/tsconfig.json +Info 5 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/b/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 6 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/b/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/b/b.ts to open"}} +Info 7 [00:00:34.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "configFilePath": "/user/username/projects/b/tsconfig.json" + } +} +Info 8 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Extended config file +Info 9 [00:00:36.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:37.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 11 [00:00:38.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 12 [00:00:39.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 13 [00:00:40.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:41.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:42.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:43.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 17 [00:00:44.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/b/b.ts SVC-1-0 "export class B {}" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + b.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:45.000] ----------------------------------------------- +Info 19 [00:00:46.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/b/tsconfig.json"}} +Info 20 [00:00:47.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20501ec57de369fa110ede8c3db8fe97460676d82a7b594783e32439eba20158","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":17,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":true,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 21 [00:00:48.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/b/tsconfig.json","diagnostics":[],"triggerFile":"/user/username/projects/b/b.ts"}} +Info 22 [00:00:49.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 22 [00:00:50.000] Files (2) + +Info 22 [00:00:51.000] ----------------------------------------------- +Info 22 [00:00:52.000] Open files: +Info 22 [00:00:53.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 22 [00:00:54.000] Projects: /user/username/projects/b/tsconfig.json +Info 22 [00:00:55.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: *new* + {} +/user/username/projects/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/b: *new* + {} + +Info 23 [00:00:59.000] FileWatcher:: Triggered with /user/username/projects/a/tsconfig.json 1:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Extended config file +Info 24 [00:01:00.000] Scheduled: /user/username/projects/b/tsconfig.json +Info 25 [00:01:01.000] Scheduled: *ensureProjectForOpenFiles* +Info 26 [00:01:02.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/a/tsconfig.json 1:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Extended config file +Before checking timeout queue length (2) and running +//// [/user/username/projects/a/tsconfig.json] file written with same contents + +Info 27 [00:01:03.000] Running: /user/username/projects/b/tsconfig.json +Info 28 [00:01:04.000] Reloading configured project /user/username/projects/b/tsconfig.json +Info 29 [00:01:05.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/b/tsconfig.json","reason":"Change in extended config file /user/username/projects/a/tsconfig.json detected"}} +Info 30 [00:01:06.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "configFilePath": "/user/username/projects/b/tsconfig.json" + } +} +Info 31 [00:01:07.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 32 [00:01:08.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Not Elapsed:: *ms +Info 33 [00:01:09.000] Same program as before +Info 34 [00:01:10.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/b/tsconfig.json"}} +Info 35 [00:01:11.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/b/tsconfig.json","diagnostics":[],"triggerFile":"/user/username/projects/b/tsconfig.json"}} +Info 36 [00:01:12.000] Running: *ensureProjectForOpenFiles* +Info 37 [00:01:13.000] Before ensureProjectForOpenFiles: +Info 38 [00:01:14.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 38 [00:01:15.000] Files (2) + +Info 38 [00:01:16.000] ----------------------------------------------- +Info 38 [00:01:17.000] Open files: +Info 38 [00:01:18.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 38 [00:01:19.000] Projects: /user/username/projects/b/tsconfig.json +Info 38 [00:01:20.000] After ensureProjectForOpenFiles: +Info 39 [00:01:21.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 39 [00:01:22.000] Files (2) + +Info 39 [00:01:23.000] ----------------------------------------------- +Info 39 [00:01:24.000] Open files: +Info 39 [00:01:25.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 39 [00:01:26.000] Projects: /user/username/projects/b/tsconfig.json +Info 39 [00:01:27.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/b/b.ts"]}} +After checking timeout queue length (2) and running diff --git a/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-the-config-file-when-using-default-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-the-config-file-when-using-default-event-handler.js new file mode 100644 index 00000000000..f114e1022c3 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-the-config-file-when-using-default-event-handler.js @@ -0,0 +1,144 @@ +Info 0 [00:00:21.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + + +Info 1 [00:00:22.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:23.000] Search path: /user/username/projects/a +Info 3 [00:00:24.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 4 [00:00:25.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 5 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 6 [00:00:27.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/a/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/a/a.ts to open"}} +Info 7 [00:00:28.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 8 [00:00:29.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:30.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:31.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 11 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:33.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 13 [00:00:34.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 14 [00:00:35.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:36.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 16 [00:00:37.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts SVC-1-0 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:38.000] ----------------------------------------------- +Info 18 [00:00:39.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/a/tsconfig.json"}} +Info 19 [00:00:40.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:41.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/a/a.ts","configFile":"/user/username/projects/a/tsconfig.json","diagnostics":[]}} +Info 21 [00:00:42.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 21 [00:00:43.000] Files (2) + +Info 21 [00:00:44.000] ----------------------------------------------- +Info 21 [00:00:45.000] Open files: +Info 21 [00:00:46.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 21 [00:00:47.000] Projects: /user/username/projects/a/tsconfig.json +Info 21 [00:00:48.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} + +Info 22 [00:00:52.000] FileWatcher:: Triggered with /user/username/projects/a/tsconfig.json 1:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 23 [00:00:53.000] Scheduled: /user/username/projects/a/tsconfig.json +Info 24 [00:00:54.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:55.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/a/tsconfig.json 1:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Before checking timeout queue length (2) and running +//// [/user/username/projects/a/tsconfig.json] file written with same contents + +Info 26 [00:00:56.000] Running: /user/username/projects/a/tsconfig.json +Info 27 [00:00:57.000] Reloading configured project /user/username/projects/a/tsconfig.json +Info 28 [00:00:58.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/a/tsconfig.json","reason":"Change in config file detected"}} +Info 29 [00:00:59.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 30 [00:01:00.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 31 [00:01:01.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Not Elapsed:: *ms +Info 32 [00:01:02.000] Same program as before +Info 33 [00:01:03.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/a/tsconfig.json"}} +Info 34 [00:01:04.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/a/tsconfig.json","configFile":"/user/username/projects/a/tsconfig.json","diagnostics":[]}} +Info 35 [00:01:05.000] Running: *ensureProjectForOpenFiles* +Info 36 [00:01:06.000] Before ensureProjectForOpenFiles: +Info 37 [00:01:07.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 37 [00:01:08.000] Files (2) + +Info 37 [00:01:09.000] ----------------------------------------------- +Info 37 [00:01:10.000] Open files: +Info 37 [00:01:11.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 37 [00:01:12.000] Projects: /user/username/projects/a/tsconfig.json +Info 37 [00:01:13.000] After ensureProjectForOpenFiles: +Info 38 [00:01:14.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 38 [00:01:15.000] Files (2) + +Info 38 [00:01:16.000] ----------------------------------------------- +Info 38 [00:01:17.000] Open files: +Info 38 [00:01:18.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 38 [00:01:19.000] Projects: /user/username/projects/a/tsconfig.json +Info 38 [00:01:20.000] got projects updated in background, updating diagnostics for /user/username/projects/a/a.ts +Info 39 [00:01:21.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/a/a.ts"]}} +After checking timeout queue length (2) and running diff --git a/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-the-config-file-when-using-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-the-config-file-when-using-event-handler.js new file mode 100644 index 00000000000..71cacede627 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/change-is-detected-in-the-config-file-when-using-event-handler.js @@ -0,0 +1,143 @@ +Info 0 [00:00:21.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + + +Info 1 [00:00:22.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:23.000] Search path: /user/username/projects/a +Info 3 [00:00:24.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 4 [00:00:25.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 5 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 6 [00:00:27.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/a/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/a/a.ts to open"}} +Info 7 [00:00:28.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 8 [00:00:29.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:30.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:31.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 11 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:33.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 13 [00:00:34.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 14 [00:00:35.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:36.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 16 [00:00:37.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts SVC-1-0 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:38.000] ----------------------------------------------- +Info 18 [00:00:39.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/a/tsconfig.json"}} +Info 19 [00:00:40.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 20 [00:00:41.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/a/tsconfig.json","diagnostics":[],"triggerFile":"/user/username/projects/a/a.ts"}} +Info 21 [00:00:42.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 21 [00:00:43.000] Files (2) + +Info 21 [00:00:44.000] ----------------------------------------------- +Info 21 [00:00:45.000] Open files: +Info 21 [00:00:46.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 21 [00:00:47.000] Projects: /user/username/projects/a/tsconfig.json +Info 21 [00:00:48.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} + +Info 22 [00:00:52.000] FileWatcher:: Triggered with /user/username/projects/a/tsconfig.json 1:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 23 [00:00:53.000] Scheduled: /user/username/projects/a/tsconfig.json +Info 24 [00:00:54.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:55.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/a/tsconfig.json 1:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Before checking timeout queue length (2) and running +//// [/user/username/projects/a/tsconfig.json] file written with same contents + +Info 26 [00:00:56.000] Running: /user/username/projects/a/tsconfig.json +Info 27 [00:00:57.000] Reloading configured project /user/username/projects/a/tsconfig.json +Info 28 [00:00:58.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/a/tsconfig.json","reason":"Change in config file detected"}} +Info 29 [00:00:59.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 30 [00:01:00.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 31 [00:01:01.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Not Elapsed:: *ms +Info 32 [00:01:02.000] Same program as before +Info 33 [00:01:03.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/a/tsconfig.json"}} +Info 34 [00:01:04.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/a/tsconfig.json","diagnostics":[],"triggerFile":"/user/username/projects/a/tsconfig.json"}} +Info 35 [00:01:05.000] Running: *ensureProjectForOpenFiles* +Info 36 [00:01:06.000] Before ensureProjectForOpenFiles: +Info 37 [00:01:07.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 37 [00:01:08.000] Files (2) + +Info 37 [00:01:09.000] ----------------------------------------------- +Info 37 [00:01:10.000] Open files: +Info 37 [00:01:11.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 37 [00:01:12.000] Projects: /user/username/projects/a/tsconfig.json +Info 37 [00:01:13.000] After ensureProjectForOpenFiles: +Info 38 [00:01:14.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 38 [00:01:15.000] Files (2) + +Info 38 [00:01:16.000] ----------------------------------------------- +Info 38 [00:01:17.000] Open files: +Info 38 [00:01:18.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 38 [00:01:19.000] Projects: /user/username/projects/a/tsconfig.json +Info 38 [00:01:20.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/a/a.ts"]}} +After checking timeout queue length (2) and running diff --git a/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-disabled-when-using-default-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-disabled-when-using-default-event-handler.js new file mode 100644 index 00000000000..a1e55dd2d2c --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-disabled-when-using-default-event-handler.js @@ -0,0 +1,147 @@ +Info 0 [00:00:21.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + + +Info 1 [00:00:22.000] request: + { + "command": "configure", + "arguments": { + "preferences": { + "lazyConfiguredProjectsFromExternalProject": true + } + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:23.000] response: + {"seq":0,"type":"response","command":"configure","request_seq":1,"success":true} +Info 3 [00:00:24.000] response: + { + "responseRequired": false + } +After request + +Before request + +Info 4 [00:00:25.000] request: + { + "command": "openExternalProject", + "arguments": { + "projectFileName": "/user/username/projects/a/project.csproj", + "rootFiles": [ + { + "fileName": "/user/username/projects/a/a.ts" + }, + { + "fileName": "/user/username/projects/a/tsconfig.json" + } + ], + "options": {} + }, + "seq": 2, + "type": "request" + } +Info 5 [00:00:26.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 6 [00:00:27.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 7 [00:00:28.000] response: + { + "response": true, + "responseRequired": true + } +After request + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} + +Before request + +Info 8 [00:00:29.000] request: + { + "command": "configure", + "arguments": { + "preferences": { + "lazyConfiguredProjectsFromExternalProject": false + } + }, + "seq": 3, + "type": "request" + } +Info 9 [00:00:30.000] Loading configured project /user/username/projects/a/tsconfig.json +Info 10 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/a/tsconfig.json","reason":"Creating configured project in external project: /user/username/projects/a/project.csproj"}} +Info 11 [00:00:32.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 12 [00:00:33.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 13 [00:00:34.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 14 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.ts 500 undefined WatchType: Closed Script info +Info 15 [00:00:36.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 16 [00:00:37.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 17 [00:00:38.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 18 [00:00:39.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 19 [00:00:40.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 20 [00:00:41.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 21 [00:00:42.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 22 [00:00:43.000] ----------------------------------------------- +Info 23 [00:00:44.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/a/tsconfig.json"}} +Info 24 [00:00:45.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 25 [00:00:46.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/a/tsconfig.json","configFile":"/user/username/projects/a/tsconfig.json","diagnostics":[]}} +Info 26 [00:00:47.000] response: + {"seq":0,"type":"response","command":"configure","request_seq":3,"success":true,"performanceData":{"updateGraphDurationMs":*}} +Info 27 [00:00:48.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: + {} +/user/username/projects/a/a.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-disabled-when-using-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-disabled-when-using-event-handler.js new file mode 100644 index 00000000000..a10389db7e6 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-disabled-when-using-event-handler.js @@ -0,0 +1,147 @@ +Info 0 [00:00:21.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + + +Info 1 [00:00:22.000] request: + { + "command": "configure", + "arguments": { + "preferences": { + "lazyConfiguredProjectsFromExternalProject": true + } + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:23.000] response: + {"seq":0,"type":"response","command":"configure","request_seq":1,"success":true} +Info 3 [00:00:24.000] response: + { + "responseRequired": false + } +After request + +Before request + +Info 4 [00:00:25.000] request: + { + "command": "openExternalProject", + "arguments": { + "projectFileName": "/user/username/projects/a/project.csproj", + "rootFiles": [ + { + "fileName": "/user/username/projects/a/a.ts" + }, + { + "fileName": "/user/username/projects/a/tsconfig.json" + } + ], + "options": {} + }, + "seq": 2, + "type": "request" + } +Info 5 [00:00:26.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 6 [00:00:27.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 7 [00:00:28.000] response: + { + "response": true, + "responseRequired": true + } +After request + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} + +Before request + +Info 8 [00:00:29.000] request: + { + "command": "configure", + "arguments": { + "preferences": { + "lazyConfiguredProjectsFromExternalProject": false + } + }, + "seq": 3, + "type": "request" + } +Info 9 [00:00:30.000] Loading configured project /user/username/projects/a/tsconfig.json +Info 10 [00:00:31.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/a/tsconfig.json","reason":"Creating configured project in external project: /user/username/projects/a/project.csproj"}} +Info 11 [00:00:32.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 12 [00:00:33.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 13 [00:00:34.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 14 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.ts 500 undefined WatchType: Closed Script info +Info 15 [00:00:36.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 16 [00:00:37.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 17 [00:00:38.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 18 [00:00:39.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 19 [00:00:40.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 20 [00:00:41.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 21 [00:00:42.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 22 [00:00:43.000] ----------------------------------------------- +Info 23 [00:00:44.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/a/tsconfig.json"}} +Info 24 [00:00:45.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 25 [00:00:46.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/a/tsconfig.json","diagnostics":[],"triggerFile":"/user/username/projects/a/tsconfig.json"}} +Info 26 [00:00:47.000] response: + {"seq":0,"type":"response","command":"configure","request_seq":3,"success":true,"performanceData":{"updateGraphDurationMs":*}} +Info 27 [00:00:48.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: + {} +/user/username/projects/a/a.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-false-when-using-default-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-false-when-using-default-event-handler.js new file mode 100644 index 00000000000..2cb1b740ba6 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-false-when-using-default-event-handler.js @@ -0,0 +1,119 @@ +Info 0 [00:00:21.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + + +Info 1 [00:00:22.000] request: + { + "command": "configure", + "arguments": { + "preferences": { + "lazyConfiguredProjectsFromExternalProject": false + } + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:23.000] response: + {"seq":0,"type":"response","command":"configure","request_seq":1,"success":true} +Info 3 [00:00:24.000] response: + { + "responseRequired": false + } +After request + +Before request + +Info 4 [00:00:25.000] request: + { + "command": "openExternalProject", + "arguments": { + "projectFileName": "/user/username/projects/a/project.csproj", + "rootFiles": [ + { + "fileName": "/user/username/projects/a/a.ts" + }, + { + "fileName": "/user/username/projects/a/tsconfig.json" + } + ], + "options": {} + }, + "seq": 2, + "type": "request" + } +Info 5 [00:00:26.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 6 [00:00:27.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 7 [00:00:28.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/a/tsconfig.json","reason":"Creating configured project in external project: /user/username/projects/a/project.csproj"}} +Info 8 [00:00:29.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 9 [00:00:30.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:31.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 11 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:33.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 13 [00:00:34.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 14 [00:00:35.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 15 [00:00:36.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 16 [00:00:37.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 17 [00:00:38.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 18 [00:00:39.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 19 [00:00:40.000] ----------------------------------------------- +Info 20 [00:00:41.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/a/tsconfig.json"}} +Info 21 [00:00:42.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 22 [00:00:43.000] response: + { + "response": true, + "responseRequired": true + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} +/user/username/projects/a/a.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-false-when-using-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-false-when-using-event-handler.js new file mode 100644 index 00000000000..b87aa4f602e --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-false-when-using-event-handler.js @@ -0,0 +1,119 @@ +Info 0 [00:00:21.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + + +Info 1 [00:00:22.000] request: + { + "command": "configure", + "arguments": { + "preferences": { + "lazyConfiguredProjectsFromExternalProject": false + } + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:23.000] response: + {"seq":0,"type":"response","command":"configure","request_seq":1,"success":true} +Info 3 [00:00:24.000] response: + { + "responseRequired": false + } +After request + +Before request + +Info 4 [00:00:25.000] request: + { + "command": "openExternalProject", + "arguments": { + "projectFileName": "/user/username/projects/a/project.csproj", + "rootFiles": [ + { + "fileName": "/user/username/projects/a/a.ts" + }, + { + "fileName": "/user/username/projects/a/tsconfig.json" + } + ], + "options": {} + }, + "seq": 2, + "type": "request" + } +Info 5 [00:00:26.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 6 [00:00:27.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 7 [00:00:28.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/a/tsconfig.json","reason":"Creating configured project in external project: /user/username/projects/a/project.csproj"}} +Info 8 [00:00:29.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 9 [00:00:30.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:31.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 11 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:33.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 13 [00:00:34.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 14 [00:00:35.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 15 [00:00:36.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 16 [00:00:37.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 17 [00:00:38.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 18 [00:00:39.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 19 [00:00:40.000] ----------------------------------------------- +Info 20 [00:00:41.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/a/tsconfig.json"}} +Info 21 [00:00:42.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 22 [00:00:43.000] response: + { + "response": true, + "responseRequired": true + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} +/user/username/projects/a/a.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-true-and-file-is-opened-when-using-default-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-true-and-file-is-opened-when-using-default-event-handler.js new file mode 100644 index 00000000000..abec05f116b --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-true-and-file-is-opened-when-using-default-event-handler.js @@ -0,0 +1,149 @@ +Info 0 [00:00:21.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + + +Info 1 [00:00:22.000] request: + { + "command": "configure", + "arguments": { + "preferences": { + "lazyConfiguredProjectsFromExternalProject": true + } + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:23.000] response: + {"seq":0,"type":"response","command":"configure","request_seq":1,"success":true} +Info 3 [00:00:24.000] response: + { + "responseRequired": false + } +After request + +Before request + +Info 4 [00:00:25.000] request: + { + "command": "openExternalProject", + "arguments": { + "projectFileName": "/user/username/projects/a/project.csproj", + "rootFiles": [ + { + "fileName": "/user/username/projects/a/a.ts" + }, + { + "fileName": "/user/username/projects/a/tsconfig.json" + } + ], + "options": {} + }, + "seq": 2, + "type": "request" + } +Info 5 [00:00:26.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 6 [00:00:27.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 7 [00:00:28.000] response: + { + "response": true, + "responseRequired": true + } +After request + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} + +Before request + +Info 8 [00:00:29.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/a/a.ts" + }, + "seq": 3, + "type": "request" + } +Info 9 [00:00:30.000] Search path: /user/username/projects/a +Info 10 [00:00:31.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 11 [00:00:32.000] Loading configured project /user/username/projects/a/tsconfig.json +Info 12 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/a/tsconfig.json","reason":"Creating configured project in external project: /user/username/projects/a/project.csproj"}} +Info 13 [00:00:34.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 14 [00:00:35.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 15 [00:00:36.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 16 [00:00:37.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 17 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 18 [00:00:39.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 19 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 20 [00:00:41.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 21 [00:00:42.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 22 [00:00:43.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts SVC-1-0 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 23 [00:00:44.000] ----------------------------------------------- +Info 24 [00:00:45.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/a/tsconfig.json"}} +Info 25 [00:00:46.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 26 [00:00:47.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/a/tsconfig.json","configFile":"/user/username/projects/a/tsconfig.json","diagnostics":[]}} +Info 27 [00:00:48.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 27 [00:00:49.000] Files (2) + +Info 27 [00:00:50.000] ----------------------------------------------- +Info 27 [00:00:51.000] Open files: +Info 27 [00:00:52.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 27 [00:00:53.000] Projects: /user/username/projects/a/tsconfig.json +Info 27 [00:00:54.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-true-and-file-is-opened-when-using-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-true-and-file-is-opened-when-using-event-handler.js new file mode 100644 index 00000000000..0aa12fa2fa8 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/lazyConfiguredProjectsFromExternalProject-is-true-and-file-is-opened-when-using-event-handler.js @@ -0,0 +1,149 @@ +Info 0 [00:00:21.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + + +Info 1 [00:00:22.000] request: + { + "command": "configure", + "arguments": { + "preferences": { + "lazyConfiguredProjectsFromExternalProject": true + } + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:23.000] response: + {"seq":0,"type":"response","command":"configure","request_seq":1,"success":true} +Info 3 [00:00:24.000] response: + { + "responseRequired": false + } +After request + +Before request + +Info 4 [00:00:25.000] request: + { + "command": "openExternalProject", + "arguments": { + "projectFileName": "/user/username/projects/a/project.csproj", + "rootFiles": [ + { + "fileName": "/user/username/projects/a/a.ts" + }, + { + "fileName": "/user/username/projects/a/tsconfig.json" + } + ], + "options": {} + }, + "seq": 2, + "type": "request" + } +Info 5 [00:00:26.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 6 [00:00:27.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 7 [00:00:28.000] response: + { + "response": true, + "responseRequired": true + } +After request + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} + +Before request + +Info 8 [00:00:29.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/a/a.ts" + }, + "seq": 3, + "type": "request" + } +Info 9 [00:00:30.000] Search path: /user/username/projects/a +Info 10 [00:00:31.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 11 [00:00:32.000] Loading configured project /user/username/projects/a/tsconfig.json +Info 12 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/a/tsconfig.json","reason":"Creating configured project in external project: /user/username/projects/a/project.csproj"}} +Info 13 [00:00:34.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 14 [00:00:35.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 15 [00:00:36.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 16 [00:00:37.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 17 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 18 [00:00:39.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 19 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 20 [00:00:41.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 21 [00:00:42.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 22 [00:00:43.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts SVC-1-0 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 23 [00:00:44.000] ----------------------------------------------- +Info 24 [00:00:45.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/a/tsconfig.json"}} +Info 25 [00:00:46.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 26 [00:00:47.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/a/tsconfig.json","diagnostics":[],"triggerFile":"/user/username/projects/a/tsconfig.json"}} +Info 27 [00:00:48.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 27 [00:00:49.000] Files (2) + +Info 27 [00:00:50.000] ----------------------------------------------- +Info 27 [00:00:51.000] Open files: +Info 27 [00:00:52.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 27 [00:00:53.000] Projects: /user/username/projects/a/tsconfig.json +Info 27 [00:00:54.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-disableSourceOfProjectReferenceRedirect-when-using-default-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-disableSourceOfProjectReferenceRedirect-when-using-default-event-handler.js new file mode 100644 index 00000000000..038283b8b95 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-disableSourceOfProjectReferenceRedirect-when-using-default-event-handler.js @@ -0,0 +1,278 @@ +Info 0 [00:00:31.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + +//// [/user/username/projects/a/a.d.ts] +export declare class A { +} +//# sourceMappingURL=a.d.ts.map + + +//// [/user/username/projects/a/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["./a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;CAAI"} + +//// [/user/username/projects/b/b.ts] +import {A} from "../a/a"; new A(); + +//// [/user/username/projects/b/tsconfig.json] +{"compilerOptions":{"disableSourceOfProjectReferenceRedirect":true},"references":[{"path":"../a"}]} + + +Info 1 [00:00:32.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/b/b.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:33.000] Search path: /user/username/projects/b +Info 3 [00:00:34.000] For info: /user/username/projects/b/b.ts :: Config file name: /user/username/projects/b/tsconfig.json +Info 4 [00:00:35.000] Creating configuration project /user/username/projects/b/tsconfig.json +Info 5 [00:00:36.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/b/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 6 [00:00:37.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/b/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/b/b.ts to open"}} +Info 7 [00:00:38.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "disableSourceOfProjectReferenceRedirect": true, + "configFilePath": "/user/username/projects/b/tsconfig.json" + }, + "projectReferences": [ + { + "path": "/user/username/projects/a", + "originalPath": "../a" + } + ] +} +Info 8 [00:00:39.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:41.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 11 [00:00:42.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 12 [00:00:43.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 13 [00:00:44.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 14 [00:00:45.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 15 [00:00:46.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.d.ts 500 undefined WatchType: Closed Script info +Info 16 [00:00:47.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 17 [00:00:48.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:49.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 19 [00:00:50.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 20 [00:00:51.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 21 [00:00:52.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.d.ts Text-1 "export declare class A {\n}\n//# sourceMappingURL=a.d.ts.map\n" + /user/username/projects/b/b.ts SVC-1-0 "import {A} from \"../a/a\"; new A();" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + ../a/a.d.ts + Imported via "../a/a" from file 'b.ts' + File is output of project reference source '../a/a.ts' + b.ts + Matched by default include pattern '**/*' + +Info 22 [00:00:53.000] ----------------------------------------------- +Info 23 [00:00:54.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/b/tsconfig.json"}} +Info 24 [00:00:55.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20501ec57de369fa110ede8c3db8fe97460676d82a7b594783e32439eba20158","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":34,"tsx":0,"tsxSize":0,"dts":2,"dtsSize":393,"deferred":0,"deferredSize":0},"compilerOptions":{"disableSourceOfProjectReferenceRedirect":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 25 [00:00:56.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/b/b.ts","configFile":"/user/username/projects/b/tsconfig.json","diagnostics":[{"start":{"line":1,"offset":83},"end":{"line":1,"offset":98},"text":"Referenced project '/user/username/projects/a' must have setting \"composite\": true.","code":6306,"category":"error","fileName":"/user/username/projects/b/tsconfig.json"}]}} +Info 26 [00:00:57.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 26 [00:00:58.000] Files (3) + +Info 26 [00:00:59.000] ----------------------------------------------- +Info 26 [00:01:00.000] Open files: +Info 26 [00:01:01.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 26 [00:01:02.000] Projects: /user/username/projects/b/tsconfig.json +Info 26 [00:01:03.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: *new* + {} +/user/username/projects/a/tsconfig.json: *new* + {} +/user/username/projects/a/a.d.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/b: *new* + {} +/user/username/projects/a: *new* + {} + +Before request + +Info 27 [00:01:04.000] request: + { + "command": "references", + "arguments": { + "file": "/user/username/projects/b/b.ts", + "line": 1, + "offset": 31 + }, + "seq": 2, + "type": "request" + } +Info 28 [00:01:05.000] Finding references to /user/username/projects/b/b.ts position 30 in project /user/username/projects/b/tsconfig.json +Info 29 [00:01:06.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.d.ts.map 500 undefined WatchType: Closed Script info +Info 30 [00:01:07.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.ts 500 undefined WatchType: Closed Script info +Info 31 [00:01:08.000] Search path: /user/username/projects/a +Info 32 [00:01:09.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 33 [00:01:10.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 34 [00:01:11.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/a/tsconfig.json","reason":"Creating project for original file: /user/username/projects/a/a.ts for location: /user/username/projects/a/a.d.ts"}} +Info 35 [00:01:12.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 36 [00:01:13.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 37 [00:01:14.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 38 [00:01:15.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 39 [00:01:16.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 40 [00:01:17.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 41 [00:01:18.000] ----------------------------------------------- +Info 42 [00:01:19.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/a/tsconfig.json"}} +Info 43 [00:01:20.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 44 [00:01:21.000] Search path: /user/username/projects/a +Info 45 [00:01:22.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 46 [00:01:23.000] Finding references to /user/username/projects/a/a.ts position 13 in project /user/username/projects/a/tsconfig.json +Info 47 [00:01:24.000] response: + { + "response": { + "refs": [ + { + "file": "/user/username/projects/b/b.ts", + "start": { + "line": 1, + "offset": 9 + }, + "end": { + "line": 1, + "offset": 10 + }, + "contextStart": { + "line": 1, + "offset": 1 + }, + "contextEnd": { + "line": 1, + "offset": 26 + }, + "lineText": "import {A} from \"../a/a\"; new A();", + "isWriteAccess": true + }, + { + "file": "/user/username/projects/b/b.ts", + "start": { + "line": 1, + "offset": 31 + }, + "end": { + "line": 1, + "offset": 32 + }, + "lineText": "import {A} from \"../a/a\"; new A();", + "isWriteAccess": false + }, + { + "file": "/user/username/projects/a/a.ts", + "start": { + "line": 1, + "offset": 14 + }, + "end": { + "line": 1, + "offset": 15 + }, + "contextStart": { + "line": 1, + "offset": 1 + }, + "contextEnd": { + "line": 1, + "offset": 19 + }, + "lineText": "export class A { }", + "isWriteAccess": true + } + ], + "symbolName": "A", + "symbolStartOffset": 31, + "symbolDisplayString": "(alias) new A(): A\nimport A" + }, + "responseRequired": true + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: + {} +/user/username/projects/a/tsconfig.json: + {} +/user/username/projects/a/a.d.ts: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/a/a.d.ts.map: *new* + {} +/user/username/projects/a/a.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/b: + {} +/user/username/projects/a: + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-disableSourceOfProjectReferenceRedirect-when-using-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-disableSourceOfProjectReferenceRedirect-when-using-event-handler.js new file mode 100644 index 00000000000..5136df52002 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-disableSourceOfProjectReferenceRedirect-when-using-event-handler.js @@ -0,0 +1,278 @@ +Info 0 [00:00:31.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + +//// [/user/username/projects/a/a.d.ts] +export declare class A { +} +//# sourceMappingURL=a.d.ts.map + + +//// [/user/username/projects/a/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["./a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;CAAI"} + +//// [/user/username/projects/b/b.ts] +import {A} from "../a/a"; new A(); + +//// [/user/username/projects/b/tsconfig.json] +{"compilerOptions":{"disableSourceOfProjectReferenceRedirect":true},"references":[{"path":"../a"}]} + + +Info 1 [00:00:32.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/b/b.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:33.000] Search path: /user/username/projects/b +Info 3 [00:00:34.000] For info: /user/username/projects/b/b.ts :: Config file name: /user/username/projects/b/tsconfig.json +Info 4 [00:00:35.000] Creating configuration project /user/username/projects/b/tsconfig.json +Info 5 [00:00:36.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/b/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 6 [00:00:37.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/b/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/b/b.ts to open"}} +Info 7 [00:00:38.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "disableSourceOfProjectReferenceRedirect": true, + "configFilePath": "/user/username/projects/b/tsconfig.json" + }, + "projectReferences": [ + { + "path": "/user/username/projects/a", + "originalPath": "../a" + } + ] +} +Info 8 [00:00:39.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:41.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 11 [00:00:42.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 12 [00:00:43.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 13 [00:00:44.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 14 [00:00:45.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 15 [00:00:46.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.d.ts 500 undefined WatchType: Closed Script info +Info 16 [00:00:47.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 17 [00:00:48.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:49.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 19 [00:00:50.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 20 [00:00:51.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 21 [00:00:52.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.d.ts Text-1 "export declare class A {\n}\n//# sourceMappingURL=a.d.ts.map\n" + /user/username/projects/b/b.ts SVC-1-0 "import {A} from \"../a/a\"; new A();" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + ../a/a.d.ts + Imported via "../a/a" from file 'b.ts' + File is output of project reference source '../a/a.ts' + b.ts + Matched by default include pattern '**/*' + +Info 22 [00:00:53.000] ----------------------------------------------- +Info 23 [00:00:54.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/b/tsconfig.json"}} +Info 24 [00:00:55.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20501ec57de369fa110ede8c3db8fe97460676d82a7b594783e32439eba20158","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":34,"tsx":0,"tsxSize":0,"dts":2,"dtsSize":393,"deferred":0,"deferredSize":0},"compilerOptions":{"disableSourceOfProjectReferenceRedirect":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 25 [00:00:56.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/b/tsconfig.json","diagnostics":[{"start":{"line":1,"offset":83},"end":{"line":1,"offset":98},"text":"Referenced project '/user/username/projects/a' must have setting \"composite\": true.","code":6306,"category":"error","fileName":"/user/username/projects/b/tsconfig.json"}],"triggerFile":"/user/username/projects/b/b.ts"}} +Info 26 [00:00:57.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 26 [00:00:58.000] Files (3) + +Info 26 [00:00:59.000] ----------------------------------------------- +Info 26 [00:01:00.000] Open files: +Info 26 [00:01:01.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 26 [00:01:02.000] Projects: /user/username/projects/b/tsconfig.json +Info 26 [00:01:03.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: *new* + {} +/user/username/projects/a/tsconfig.json: *new* + {} +/user/username/projects/a/a.d.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/b: *new* + {} +/user/username/projects/a: *new* + {} + +Before request + +Info 27 [00:01:04.000] request: + { + "command": "references", + "arguments": { + "file": "/user/username/projects/b/b.ts", + "line": 1, + "offset": 31 + }, + "seq": 2, + "type": "request" + } +Info 28 [00:01:05.000] Finding references to /user/username/projects/b/b.ts position 30 in project /user/username/projects/b/tsconfig.json +Info 29 [00:01:06.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.d.ts.map 500 undefined WatchType: Closed Script info +Info 30 [00:01:07.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.ts 500 undefined WatchType: Closed Script info +Info 31 [00:01:08.000] Search path: /user/username/projects/a +Info 32 [00:01:09.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 33 [00:01:10.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 34 [00:01:11.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/a/tsconfig.json","reason":"Creating project for original file: /user/username/projects/a/a.ts for location: /user/username/projects/a/a.d.ts"}} +Info 35 [00:01:12.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 36 [00:01:13.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 37 [00:01:14.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 38 [00:01:15.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 39 [00:01:16.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 40 [00:01:17.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 41 [00:01:18.000] ----------------------------------------------- +Info 42 [00:01:19.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/a/tsconfig.json"}} +Info 43 [00:01:20.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 44 [00:01:21.000] Search path: /user/username/projects/a +Info 45 [00:01:22.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 46 [00:01:23.000] Finding references to /user/username/projects/a/a.ts position 13 in project /user/username/projects/a/tsconfig.json +Info 47 [00:01:24.000] response: + { + "response": { + "refs": [ + { + "file": "/user/username/projects/b/b.ts", + "start": { + "line": 1, + "offset": 9 + }, + "end": { + "line": 1, + "offset": 10 + }, + "contextStart": { + "line": 1, + "offset": 1 + }, + "contextEnd": { + "line": 1, + "offset": 26 + }, + "lineText": "import {A} from \"../a/a\"; new A();", + "isWriteAccess": true + }, + { + "file": "/user/username/projects/b/b.ts", + "start": { + "line": 1, + "offset": 31 + }, + "end": { + "line": 1, + "offset": 32 + }, + "lineText": "import {A} from \"../a/a\"; new A();", + "isWriteAccess": false + }, + { + "file": "/user/username/projects/a/a.ts", + "start": { + "line": 1, + "offset": 14 + }, + "end": { + "line": 1, + "offset": 15 + }, + "contextStart": { + "line": 1, + "offset": 1 + }, + "contextEnd": { + "line": 1, + "offset": 19 + }, + "lineText": "export class A { }", + "isWriteAccess": true + } + ], + "symbolName": "A", + "symbolStartOffset": 31, + "symbolDisplayString": "(alias) new A(): A\nimport A" + }, + "responseRequired": true + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: + {} +/user/username/projects/a/tsconfig.json: + {} +/user/username/projects/a/a.d.ts: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/a/a.d.ts.map: *new* + {} +/user/username/projects/a/a.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/b: + {} +/user/username/projects/a: + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-when-using-default-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-when-using-default-event-handler.js new file mode 100644 index 00000000000..ac736c66ad8 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-when-using-default-event-handler.js @@ -0,0 +1,270 @@ +Info 0 [00:00:31.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + +//// [/user/username/projects/a/a.d.ts] +export declare class A { +} +//# sourceMappingURL=a.d.ts.map + + +//// [/user/username/projects/a/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["./a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;CAAI"} + +//// [/user/username/projects/b/b.ts] +import {A} from "../a/a"; new A(); + +//// [/user/username/projects/b/tsconfig.json] +{"references":[{"path":"../a"}]} + + +Info 1 [00:00:32.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/b/b.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:33.000] Search path: /user/username/projects/b +Info 3 [00:00:34.000] For info: /user/username/projects/b/b.ts :: Config file name: /user/username/projects/b/tsconfig.json +Info 4 [00:00:35.000] Creating configuration project /user/username/projects/b/tsconfig.json +Info 5 [00:00:36.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/b/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 6 [00:00:37.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/b/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/b/b.ts to open"}} +Info 7 [00:00:38.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "configFilePath": "/user/username/projects/b/tsconfig.json" + }, + "projectReferences": [ + { + "path": "/user/username/projects/a", + "originalPath": "../a" + } + ] +} +Info 8 [00:00:39.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:41.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 11 [00:00:42.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 12 [00:00:43.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 13 [00:00:44.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 14 [00:00:45.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 15 [00:00:46.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.ts 500 undefined WatchType: Closed Script info +Info 16 [00:00:47.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 17 [00:00:48.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:49.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 19 [00:00:50.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 20 [00:00:51.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 21 [00:00:52.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + /user/username/projects/b/b.ts SVC-1-0 "import {A} from \"../a/a\"; new A();" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + ../a/a.ts + Imported via "../a/a" from file 'b.ts' + b.ts + Matched by default include pattern '**/*' + +Info 22 [00:00:53.000] ----------------------------------------------- +Info 23 [00:00:54.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/b/tsconfig.json"}} +Info 24 [00:00:55.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20501ec57de369fa110ede8c3db8fe97460676d82a7b594783e32439eba20158","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":2,"tsSize":52,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 25 [00:00:56.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/b/b.ts","configFile":"/user/username/projects/b/tsconfig.json","diagnostics":[{"start":{"line":1,"offset":16},"end":{"line":1,"offset":31},"text":"Referenced project '/user/username/projects/a' must have setting \"composite\": true.","code":6306,"category":"error","fileName":"/user/username/projects/b/tsconfig.json"}]}} +Info 26 [00:00:57.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 26 [00:00:58.000] Files (3) + +Info 26 [00:00:59.000] ----------------------------------------------- +Info 26 [00:01:00.000] Open files: +Info 26 [00:01:01.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 26 [00:01:02.000] Projects: /user/username/projects/b/tsconfig.json +Info 26 [00:01:03.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: *new* + {} +/user/username/projects/a/tsconfig.json: *new* + {} +/user/username/projects/a/a.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/b: *new* + {} +/user/username/projects/a: *new* + {} + +Before request + +Info 27 [00:01:04.000] request: + { + "command": "references", + "arguments": { + "file": "/user/username/projects/b/b.ts", + "line": 1, + "offset": 31 + }, + "seq": 2, + "type": "request" + } +Info 28 [00:01:05.000] Finding references to /user/username/projects/b/b.ts position 30 in project /user/username/projects/b/tsconfig.json +Info 29 [00:01:06.000] Search path: /user/username/projects/a +Info 30 [00:01:07.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 31 [00:01:08.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 32 [00:01:09.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/a/tsconfig.json","reason":"Creating project for original file: /user/username/projects/a/a.ts"}} +Info 33 [00:01:10.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 34 [00:01:11.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 35 [00:01:12.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 36 [00:01:13.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 37 [00:01:14.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 38 [00:01:15.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 39 [00:01:16.000] ----------------------------------------------- +Info 40 [00:01:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/a/tsconfig.json"}} +Info 41 [00:01:18.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 42 [00:01:19.000] Search path: /user/username/projects/a +Info 43 [00:01:20.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 44 [00:01:21.000] Finding references to /user/username/projects/a/a.ts position 13 in project /user/username/projects/a/tsconfig.json +Info 45 [00:01:22.000] response: + { + "response": { + "refs": [ + { + "file": "/user/username/projects/b/b.ts", + "start": { + "line": 1, + "offset": 9 + }, + "end": { + "line": 1, + "offset": 10 + }, + "contextStart": { + "line": 1, + "offset": 1 + }, + "contextEnd": { + "line": 1, + "offset": 26 + }, + "lineText": "import {A} from \"../a/a\"; new A();", + "isWriteAccess": true + }, + { + "file": "/user/username/projects/b/b.ts", + "start": { + "line": 1, + "offset": 31 + }, + "end": { + "line": 1, + "offset": 32 + }, + "lineText": "import {A} from \"../a/a\"; new A();", + "isWriteAccess": false + }, + { + "file": "/user/username/projects/a/a.ts", + "start": { + "line": 1, + "offset": 14 + }, + "end": { + "line": 1, + "offset": 15 + }, + "contextStart": { + "line": 1, + "offset": 1 + }, + "contextEnd": { + "line": 1, + "offset": 19 + }, + "lineText": "export class A { }", + "isWriteAccess": true + } + ], + "symbolName": "A", + "symbolStartOffset": 31, + "symbolDisplayString": "(alias) new A(): A\nimport A" + }, + "responseRequired": true + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: + {} +/user/username/projects/a/tsconfig.json: + {} +/user/username/projects/a/a.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/user/username/projects/b: + {} +/user/username/projects/a: + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-when-using-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-when-using-event-handler.js new file mode 100644 index 00000000000..12c15fa3a4f --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/opening-original-location-project-when-using-event-handler.js @@ -0,0 +1,270 @@ +Info 0 [00:00:31.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + +//// [/user/username/projects/a/a.d.ts] +export declare class A { +} +//# sourceMappingURL=a.d.ts.map + + +//// [/user/username/projects/a/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["./a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;CAAI"} + +//// [/user/username/projects/b/b.ts] +import {A} from "../a/a"; new A(); + +//// [/user/username/projects/b/tsconfig.json] +{"references":[{"path":"../a"}]} + + +Info 1 [00:00:32.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/b/b.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:33.000] Search path: /user/username/projects/b +Info 3 [00:00:34.000] For info: /user/username/projects/b/b.ts :: Config file name: /user/username/projects/b/tsconfig.json +Info 4 [00:00:35.000] Creating configuration project /user/username/projects/b/tsconfig.json +Info 5 [00:00:36.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/b/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 6 [00:00:37.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/b/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/b/b.ts to open"}} +Info 7 [00:00:38.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "configFilePath": "/user/username/projects/b/tsconfig.json" + }, + "projectReferences": [ + { + "path": "/user/username/projects/a", + "originalPath": "../a" + } + ] +} +Info 8 [00:00:39.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:41.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 11 [00:00:42.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 12 [00:00:43.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 13 [00:00:44.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 14 [00:00:45.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 15 [00:00:46.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/a.ts 500 undefined WatchType: Closed Script info +Info 16 [00:00:47.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 17 [00:00:48.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:49.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 19 [00:00:50.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 20 [00:00:51.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 21 [00:00:52.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + /user/username/projects/b/b.ts SVC-1-0 "import {A} from \"../a/a\"; new A();" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + ../a/a.ts + Imported via "../a/a" from file 'b.ts' + b.ts + Matched by default include pattern '**/*' + +Info 22 [00:00:53.000] ----------------------------------------------- +Info 23 [00:00:54.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/b/tsconfig.json"}} +Info 24 [00:00:55.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20501ec57de369fa110ede8c3db8fe97460676d82a7b594783e32439eba20158","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":2,"tsSize":52,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 25 [00:00:56.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/b/tsconfig.json","diagnostics":[{"start":{"line":1,"offset":16},"end":{"line":1,"offset":31},"text":"Referenced project '/user/username/projects/a' must have setting \"composite\": true.","code":6306,"category":"error","fileName":"/user/username/projects/b/tsconfig.json"}],"triggerFile":"/user/username/projects/b/b.ts"}} +Info 26 [00:00:57.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 26 [00:00:58.000] Files (3) + +Info 26 [00:00:59.000] ----------------------------------------------- +Info 26 [00:01:00.000] Open files: +Info 26 [00:01:01.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 26 [00:01:02.000] Projects: /user/username/projects/b/tsconfig.json +Info 26 [00:01:03.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: *new* + {} +/user/username/projects/a/tsconfig.json: *new* + {} +/user/username/projects/a/a.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/b: *new* + {} +/user/username/projects/a: *new* + {} + +Before request + +Info 27 [00:01:04.000] request: + { + "command": "references", + "arguments": { + "file": "/user/username/projects/b/b.ts", + "line": 1, + "offset": 31 + }, + "seq": 2, + "type": "request" + } +Info 28 [00:01:05.000] Finding references to /user/username/projects/b/b.ts position 30 in project /user/username/projects/b/tsconfig.json +Info 29 [00:01:06.000] Search path: /user/username/projects/a +Info 30 [00:01:07.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 31 [00:01:08.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 32 [00:01:09.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/a/tsconfig.json","reason":"Creating project for original file: /user/username/projects/a/a.ts"}} +Info 33 [00:01:10.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 34 [00:01:11.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 35 [00:01:12.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 36 [00:01:13.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 37 [00:01:14.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 38 [00:01:15.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts Text-1 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 39 [00:01:16.000] ----------------------------------------------- +Info 40 [00:01:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/a/tsconfig.json"}} +Info 41 [00:01:18.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 42 [00:01:19.000] Search path: /user/username/projects/a +Info 43 [00:01:20.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 44 [00:01:21.000] Finding references to /user/username/projects/a/a.ts position 13 in project /user/username/projects/a/tsconfig.json +Info 45 [00:01:22.000] response: + { + "response": { + "refs": [ + { + "file": "/user/username/projects/b/b.ts", + "start": { + "line": 1, + "offset": 9 + }, + "end": { + "line": 1, + "offset": 10 + }, + "contextStart": { + "line": 1, + "offset": 1 + }, + "contextEnd": { + "line": 1, + "offset": 26 + }, + "lineText": "import {A} from \"../a/a\"; new A();", + "isWriteAccess": true + }, + { + "file": "/user/username/projects/b/b.ts", + "start": { + "line": 1, + "offset": 31 + }, + "end": { + "line": 1, + "offset": 32 + }, + "lineText": "import {A} from \"../a/a\"; new A();", + "isWriteAccess": false + }, + { + "file": "/user/username/projects/a/a.ts", + "start": { + "line": 1, + "offset": 14 + }, + "end": { + "line": 1, + "offset": 15 + }, + "contextStart": { + "line": 1, + "offset": 1 + }, + "contextEnd": { + "line": 1, + "offset": 19 + }, + "lineText": "export class A { }", + "isWriteAccess": true + } + ], + "symbolName": "A", + "symbolStartOffset": 31, + "symbolDisplayString": "(alias) new A(): A\nimport A" + }, + "responseRequired": true + } +After request + +PolledWatches:: +/user/username/projects/b/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/b/tsconfig.json: + {} +/user/username/projects/a/tsconfig.json: + {} +/user/username/projects/a/a.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/user/username/projects/b: + {} +/user/username/projects/a: + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/project-is-created-by-open-file-when-using-default-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/project-is-created-by-open-file-when-using-default-event-handler.js new file mode 100644 index 00000000000..a944befc03f --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/project-is-created-by-open-file-when-using-default-event-handler.js @@ -0,0 +1,190 @@ +Info 0 [00:00:27.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + +//// [/user/username/projects/b/b.ts] +export class B {} + +//// [/user/username/projects/b/tsconfig.json] +{} + + +Info 1 [00:00:28.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:29.000] Search path: /user/username/projects/a +Info 3 [00:00:30.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 4 [00:00:31.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 5 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 6 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/a/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/a/a.ts to open"}} +Info 7 [00:00:34.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 8 [00:00:35.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:36.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:37.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 11 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:39.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 13 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 14 [00:00:41.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:42.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 16 [00:00:43.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts SVC-1-0 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:44.000] ----------------------------------------------- +Info 18 [00:00:45.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/a/tsconfig.json"}} +Info 19 [00:00:46.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:47.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/a/a.ts","configFile":"/user/username/projects/a/tsconfig.json","diagnostics":[]}} +Info 21 [00:00:48.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 21 [00:00:49.000] Files (2) + +Info 21 [00:00:50.000] ----------------------------------------------- +Info 21 [00:00:51.000] Open files: +Info 21 [00:00:52.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 21 [00:00:53.000] Projects: /user/username/projects/a/tsconfig.json +Info 21 [00:00:54.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} + +Before request + +Info 22 [00:00:55.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/b/b.ts" + }, + "seq": 2, + "type": "request" + } +Info 23 [00:00:56.000] Search path: /user/username/projects/b +Info 24 [00:00:57.000] For info: /user/username/projects/b/b.ts :: Config file name: /user/username/projects/b/tsconfig.json +Info 25 [00:00:58.000] Creating configuration project /user/username/projects/b/tsconfig.json +Info 26 [00:00:59.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/b/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 27 [00:01:00.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/user/username/projects/b/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/b/b.ts to open"}} +Info 28 [00:01:01.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "configFilePath": "/user/username/projects/b/tsconfig.json" + } +} +Info 29 [00:01:02.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:01:03.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 31 [00:01:04.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 32 [00:01:05.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 33 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 34 [00:01:07.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 35 [00:01:08.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 36 [00:01:09.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/b/b.ts SVC-1-0 "export class B {}" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + b.ts + Matched by default include pattern '**/*' + +Info 37 [00:01:10.000] ----------------------------------------------- +Info 38 [00:01:11.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/b/tsconfig.json"}} +Info 39 [00:01:12.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"20501ec57de369fa110ede8c3db8fe97460676d82a7b594783e32439eba20158","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":17,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 40 [00:01:13.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/b/b.ts","configFile":"/user/username/projects/b/tsconfig.json","diagnostics":[]}} +Info 41 [00:01:14.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 41 [00:01:15.000] Files (2) + +Info 41 [00:01:16.000] ----------------------------------------------- +Info 41 [00:01:17.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 41 [00:01:18.000] Files (2) + +Info 41 [00:01:19.000] ----------------------------------------------- +Info 41 [00:01:20.000] Open files: +Info 41 [00:01:21.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 41 [00:01:22.000] Projects: /user/username/projects/a/tsconfig.json +Info 41 [00:01:23.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 41 [00:01:24.000] Projects: /user/username/projects/b/tsconfig.json +Info 41 [00:01:25.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: + {} +/user/username/projects/b: *new* + {} diff --git a/tests/baselines/reference/tsserver/events/projectLoading/project-is-created-by-open-file-when-using-event-handler.js b/tests/baselines/reference/tsserver/events/projectLoading/project-is-created-by-open-file-when-using-event-handler.js new file mode 100644 index 00000000000..bd335a43c9a --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectLoading/project-is-created-by-open-file-when-using-event-handler.js @@ -0,0 +1,190 @@ +Info 0 [00:00:27.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +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/a/a.ts] +export class A { } + +//// [/user/username/projects/a/tsconfig.json] +{} + +//// [/user/username/projects/b/b.ts] +export class B {} + +//// [/user/username/projects/b/tsconfig.json] +{} + + +Info 1 [00:00:28.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:29.000] Search path: /user/username/projects/a +Info 3 [00:00:30.000] For info: /user/username/projects/a/a.ts :: Config file name: /user/username/projects/a/tsconfig.json +Info 4 [00:00:31.000] Creating configuration project /user/username/projects/a/tsconfig.json +Info 5 [00:00:32.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/a/tsconfig.json 2000 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Config file +Info 6 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/a/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/a/a.ts to open"}} +Info 7 [00:00:34.000] Config: /user/username/projects/a/tsconfig.json : { + "rootNames": [ + "/user/username/projects/a/a.ts" + ], + "options": { + "configFilePath": "/user/username/projects/a/tsconfig.json" + } +} +Info 8 [00:00:35.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:36.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a 1 undefined Config: /user/username/projects/a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:37.000] Starting updateGraphWorker: Project: /user/username/projects/a/tsconfig.json +Info 11 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:39.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 13 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/a/node_modules/@types 1 undefined Project: /user/username/projects/a/tsconfig.json WatchType: Type roots +Info 14 [00:00:41.000] Finishing updateGraphWorker: Project: /user/username/projects/a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:42.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 16 [00:00:43.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/a/a.ts SVC-1-0 "export class A { }" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + a.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:44.000] ----------------------------------------------- +Info 18 [00:00:45.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/a/tsconfig.json"}} +Info 19 [00:00:46.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20a91f8dffe761e39e0ada0a62a3058faad15d4a8c135539aaccd61bb5497dea","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 20 [00:00:47.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/a/tsconfig.json","diagnostics":[],"triggerFile":"/user/username/projects/a/a.ts"}} +Info 21 [00:00:48.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 21 [00:00:49.000] Files (2) + +Info 21 [00:00:50.000] ----------------------------------------------- +Info 21 [00:00:51.000] Open files: +Info 21 [00:00:52.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 21 [00:00:53.000] Projects: /user/username/projects/a/tsconfig.json +Info 21 [00:00:54.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: *new* + {} + +Before request + +Info 22 [00:00:55.000] request: + { + "command": "open", + "arguments": { + "file": "/user/username/projects/b/b.ts" + }, + "seq": 2, + "type": "request" + } +Info 23 [00:00:56.000] Search path: /user/username/projects/b +Info 24 [00:00:57.000] For info: /user/username/projects/b/b.ts :: Config file name: /user/username/projects/b/tsconfig.json +Info 25 [00:00:58.000] Creating configuration project /user/username/projects/b/tsconfig.json +Info 26 [00:00:59.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/b/tsconfig.json 2000 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Config file +Info 27 [00:01:00.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/projects/b/tsconfig.json","reason":"Creating possible configured project for /user/username/projects/b/b.ts to open"}} +Info 28 [00:01:01.000] Config: /user/username/projects/b/tsconfig.json : { + "rootNames": [ + "/user/username/projects/b/b.ts" + ], + "options": { + "configFilePath": "/user/username/projects/b/tsconfig.json" + } +} +Info 29 [00:01:02.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:01:03.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b 1 undefined Config: /user/username/projects/b/tsconfig.json WatchType: Wild card directory +Info 31 [00:01:04.000] Starting updateGraphWorker: Project: /user/username/projects/b/tsconfig.json +Info 32 [00:01:05.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 33 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/b/node_modules/@types 1 undefined Project: /user/username/projects/b/tsconfig.json WatchType: Type roots +Info 34 [00:01:07.000] Finishing updateGraphWorker: Project: /user/username/projects/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 35 [00:01:08.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 36 [00:01:09.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /user/username/projects/b/b.ts SVC-1-0 "export class B {}" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + b.ts + Matched by default include pattern '**/*' + +Info 37 [00:01:10.000] ----------------------------------------------- +Info 38 [00:01:11.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/projects/b/tsconfig.json"}} +Info 39 [00:01:12.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"20501ec57de369fa110ede8c3db8fe97460676d82a7b594783e32439eba20158","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":17,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 40 [00:01:13.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/projects/b/tsconfig.json","diagnostics":[],"triggerFile":"/user/username/projects/b/b.ts"}} +Info 41 [00:01:14.000] Project '/user/username/projects/a/tsconfig.json' (Configured) +Info 41 [00:01:15.000] Files (2) + +Info 41 [00:01:16.000] ----------------------------------------------- +Info 41 [00:01:17.000] Project '/user/username/projects/b/tsconfig.json' (Configured) +Info 41 [00:01:18.000] Files (2) + +Info 41 [00:01:19.000] ----------------------------------------------- +Info 41 [00:01:20.000] Open files: +Info 41 [00:01:21.000] FileName: /user/username/projects/a/a.ts ProjectRootPath: undefined +Info 41 [00:01:22.000] Projects: /user/username/projects/a/tsconfig.json +Info 41 [00:01:23.000] FileName: /user/username/projects/b/b.ts ProjectRootPath: undefined +Info 41 [00:01:24.000] Projects: /user/username/projects/b/tsconfig.json +Info 41 [00:01:25.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/user/username/projects/a/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/user/username/projects/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/a: + {} +/user/username/projects/b: *new* + {} diff --git a/tests/baselines/reference/tsserver/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-at-root-level.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-at-root-level.js similarity index 51% rename from tests/baselines/reference/tsserver/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-at-root-level.js rename to tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-at-root-level.js index 24ef840d7cf..a9f4bcfcc7d 100644 --- a/tests/baselines/reference/tsserver/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-at-root-level.js +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-at-root-level.js @@ -36,7 +36,9 @@ Info 2 [00:00:21.000] Search path: /a/b/project Info 3 [00:00:22.000] For info: /a/b/project/file1.ts :: Config file name: /a/b/project/tsconfig.json Info 4 [00:00:23.000] Creating configuration project /a/b/project/tsconfig.json Info 5 [00:00:24.000] FileWatcher:: Added:: WatchInfo: /a/b/project/tsconfig.json 2000 undefined Project: /a/b/project/tsconfig.json WatchType: Config file -Info 6 [00:00:25.000] Config: /a/b/project/tsconfig.json : { +Info 6 [00:00:25.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/project/tsconfig.json","reason":"Creating possible configured project for /a/b/project/file1.ts to open"}} +Info 7 [00:00:26.000] Config: /a/b/project/tsconfig.json : { "rootNames": [ "/a/b/project/file1.ts", "/a/b/project/file3.ts" @@ -46,16 +48,16 @@ Info 6 [00:00:25.000] Config: /a/b/project/tsconfig.json : { "configFilePath": "/a/b/project/tsconfig.json" } } -Info 7 [00:00:26.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/project 1 undefined Config: /a/b/project/tsconfig.json WatchType: Wild card directory -Info 8 [00:00:27.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/project 1 undefined Config: /a/b/project/tsconfig.json WatchType: Wild card directory -Info 9 [00:00:28.000] FileWatcher:: Added:: WatchInfo: /a/b/project/file3.ts 500 undefined WatchType: Closed Script info -Info 10 [00:00:29.000] Starting updateGraphWorker: Project: /a/b/project/tsconfig.json -Info 11 [00:00:30.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info -Info 12 [00:00:31.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/project/node_modules 1 undefined Project: /a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 13 [00:00:32.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/project/node_modules 1 undefined Project: /a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 14 [00:00:33.000] Finishing updateGraphWorker: Project: /a/b/project/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms -Info 15 [00:00:34.000] Project '/a/b/project/tsconfig.json' (Configured) -Info 16 [00:00:35.000] Files (3) +Info 8 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/project 1 undefined Config: /a/b/project/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/project 1 undefined Config: /a/b/project/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:29.000] FileWatcher:: Added:: WatchInfo: /a/b/project/file3.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:30.000] Starting updateGraphWorker: Project: /a/b/project/tsconfig.json +Info 12 [00:00:31.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 13 [00:00:32.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/project/node_modules 1 undefined Project: /a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:33.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/project/node_modules 1 undefined Project: /a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:34.000] Finishing updateGraphWorker: Project: /a/b/project/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:35.000] Project '/a/b/project/tsconfig.json' (Configured) +Info 17 [00:00:36.000] Files (3) /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" /a/b/project/file1.ts SVC-1-0 "import a from \"file2\"" /a/b/project/file3.ts Text-1 "export class c { }" @@ -68,15 +70,21 @@ Info 16 [00:00:35.000] Files (3) file3.ts Matched by default include pattern '**/*' -Info 17 [00:00:36.000] ----------------------------------------------- -Info 18 [00:00:37.000] Project '/a/b/project/tsconfig.json' (Configured) -Info 18 [00:00:38.000] Files (3) +Info 18 [00:00:37.000] ----------------------------------------------- +Info 19 [00:00:38.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/project/tsconfig.json"}} +Info 20 [00:00:39.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"1cf2001c133ce00fd258494c136bfa9707203d90270d151ea0f575d93d990f9d","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":2,"tsSize":39,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"typeRoots":[]},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 21 [00:00:40.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/project/tsconfig.json","diagnostics":[],"triggerFile":"/a/b/project/file1.ts"}} +Info 22 [00:00:41.000] Project '/a/b/project/tsconfig.json' (Configured) +Info 22 [00:00:42.000] Files (3) -Info 18 [00:00:39.000] ----------------------------------------------- -Info 18 [00:00:40.000] Open files: -Info 18 [00:00:41.000] FileName: /a/b/project/file1.ts ProjectRootPath: undefined -Info 18 [00:00:42.000] Projects: /a/b/project/tsconfig.json -Info 18 [00:00:43.000] response: +Info 22 [00:00:43.000] ----------------------------------------------- +Info 22 [00:00:44.000] Open files: +Info 22 [00:00:45.000] FileName: /a/b/project/file1.ts ProjectRootPath: undefined +Info 22 [00:00:46.000] Projects: /a/b/project/tsconfig.json +Info 22 [00:00:47.000] response: { "responseRequired": false } @@ -98,42 +106,44 @@ FsWatchesRecursive:: /a/b/project: *new* {} -Info 19 [00:00:47.000] FileWatcher:: Triggered with /a/b/project/file3.ts 1:: WatchInfo: /a/b/project/file3.ts 500 undefined WatchType: Closed Script info -Info 20 [00:00:48.000] Scheduled: /a/b/project/tsconfig.json -Info 21 [00:00:49.000] Scheduled: *ensureProjectForOpenFiles* -Info 22 [00:00:50.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/project/file3.ts 1:: WatchInfo: /a/b/project/file3.ts 500 undefined WatchType: Closed Script info +Info 23 [00:00:51.000] FileWatcher:: Triggered with /a/b/project/file3.ts 1:: WatchInfo: /a/b/project/file3.ts 500 undefined WatchType: Closed Script info +Info 24 [00:00:52.000] Scheduled: /a/b/project/tsconfig.json +Info 25 [00:00:53.000] Scheduled: *ensureProjectForOpenFiles* +Info 26 [00:00:54.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/project/file3.ts 1:: WatchInfo: /a/b/project/file3.ts 500 undefined WatchType: Closed Script info Before checking timeout queue length (2) and running //// [/a/b/project/file3.ts] export class c { }export class d {} -Info 23 [00:00:51.000] Running: /a/b/project/tsconfig.json -Info 24 [00:00:52.000] Starting updateGraphWorker: Project: /a/b/project/tsconfig.json -Info 25 [00:00:53.000] Finishing updateGraphWorker: Project: /a/b/project/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms -Info 26 [00:00:54.000] Project '/a/b/project/tsconfig.json' (Configured) -Info 27 [00:00:55.000] Files (3) +Info 27 [00:00:55.000] Running: /a/b/project/tsconfig.json +Info 28 [00:00:56.000] Starting updateGraphWorker: Project: /a/b/project/tsconfig.json +Info 29 [00:00:57.000] Finishing updateGraphWorker: Project: /a/b/project/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 30 [00:00:58.000] Project '/a/b/project/tsconfig.json' (Configured) +Info 31 [00:00:59.000] Files (3) /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" /a/b/project/file1.ts SVC-1-0 "import a from \"file2\"" /a/b/project/file3.ts Text-2 "export class c { }export class d {}" -Info 28 [00:00:56.000] ----------------------------------------------- -Info 29 [00:00:57.000] Running: *ensureProjectForOpenFiles* -Info 30 [00:00:58.000] Before ensureProjectForOpenFiles: -Info 31 [00:00:59.000] Project '/a/b/project/tsconfig.json' (Configured) -Info 31 [00:01:00.000] Files (3) +Info 32 [00:01:00.000] ----------------------------------------------- +Info 33 [00:01:01.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:01:02.000] Before ensureProjectForOpenFiles: +Info 35 [00:01:03.000] Project '/a/b/project/tsconfig.json' (Configured) +Info 35 [00:01:04.000] Files (3) -Info 31 [00:01:01.000] ----------------------------------------------- -Info 31 [00:01:02.000] Open files: -Info 31 [00:01:03.000] FileName: /a/b/project/file1.ts ProjectRootPath: undefined -Info 31 [00:01:04.000] Projects: /a/b/project/tsconfig.json -Info 31 [00:01:05.000] After ensureProjectForOpenFiles: -Info 32 [00:01:06.000] Project '/a/b/project/tsconfig.json' (Configured) -Info 32 [00:01:07.000] Files (3) +Info 35 [00:01:05.000] ----------------------------------------------- +Info 35 [00:01:06.000] Open files: +Info 35 [00:01:07.000] FileName: /a/b/project/file1.ts ProjectRootPath: undefined +Info 35 [00:01:08.000] Projects: /a/b/project/tsconfig.json +Info 35 [00:01:09.000] After ensureProjectForOpenFiles: +Info 36 [00:01:10.000] Project '/a/b/project/tsconfig.json' (Configured) +Info 36 [00:01:11.000] Files (3) -Info 32 [00:01:08.000] ----------------------------------------------- -Info 32 [00:01:09.000] Open files: -Info 32 [00:01:10.000] FileName: /a/b/project/file1.ts ProjectRootPath: undefined -Info 32 [00:01:11.000] Projects: /a/b/project/tsconfig.json +Info 36 [00:01:12.000] ----------------------------------------------- +Info 36 [00:01:13.000] Open files: +Info 36 [00:01:14.000] FileName: /a/b/project/file1.ts ProjectRootPath: undefined +Info 36 [00:01:15.000] Projects: /a/b/project/tsconfig.json +Info 36 [00:01:16.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/project/file1.ts"]}} After checking timeout queue length (2) and running Before running timeout callbacks diff --git a/tests/baselines/reference/tsserver/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-not-at-root-level.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-not-at-root-level.js similarity index 64% rename from tests/baselines/reference/tsserver/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-not-at-root-level.js rename to tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-not-at-root-level.js index a0c5059bb03..fda6fee471e 100644 --- a/tests/baselines/reference/tsserver/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-not-at-root-level.js +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-project-is-not-at-root-level.js @@ -36,7 +36,9 @@ Info 2 [00:00:31.000] Search path: /user/username/rootfolder/otherfolder/a/b/ Info 3 [00:00:32.000] For info: /user/username/rootfolder/otherfolder/a/b/project/file1.ts :: Config file name: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json Info 4 [00:00:33.000] Creating configuration project /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json Info 5 [00:00:34.000] FileWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json 2000 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Config file -Info 6 [00:00:35.000] Config: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json : { +Info 6 [00:00:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json","reason":"Creating possible configured project for /user/username/rootfolder/otherfolder/a/b/project/file1.ts to open"}} +Info 7 [00:00:36.000] Config: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json : { "rootNames": [ "/user/username/rootfolder/otherfolder/a/b/project/file1.ts", "/user/username/rootfolder/otherfolder/a/b/project/file3.ts" @@ -46,22 +48,22 @@ Info 6 [00:00:35.000] Config: /user/username/rootfolder/otherfolder/a/b/proje "configFilePath": "/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json" } } -Info 7 [00:00:36.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project 1 undefined Config: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Wild card directory -Info 8 [00:00:37.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project 1 undefined Config: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Wild card directory -Info 9 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/file3.ts 500 undefined WatchType: Closed Script info -Info 10 [00:00:39.000] Starting updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 11 [00:00:40.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info -Info 12 [00:00:41.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 13 [00:00:42.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 14 [00:00:43.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 15 [00:00:44.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 16 [00:00:45.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 17 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 18 [00:00:47.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 19 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 20 [00:00:49.000] Finishing updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms -Info 21 [00:00:50.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) -Info 22 [00:00:51.000] Files (3) +Info 8 [00:00:37.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project 1 undefined Config: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:38.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project 1 undefined Config: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:39.000] FileWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/file3.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:40.000] Starting updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 12 [00:00:41.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 13 [00:00:42.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:43.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:44.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 16 [00:00:45.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 17 [00:00:46.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 18 [00:00:47.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 19 [00:00:48.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 20 [00:00:49.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 21 [00:00:50.000] Finishing updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 22 [00:00:51.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) +Info 23 [00:00:52.000] Files (3) /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" /user/username/rootfolder/otherfolder/a/b/project/file1.ts SVC-1-0 "import a from \"file2\"" /user/username/rootfolder/otherfolder/a/b/project/file3.ts Text-1 "export class c { }" @@ -74,15 +76,21 @@ Info 22 [00:00:51.000] Files (3) file3.ts Matched by default include pattern '**/*' -Info 23 [00:00:52.000] ----------------------------------------------- -Info 24 [00:00:53.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) -Info 24 [00:00:54.000] Files (3) +Info 24 [00:00:53.000] ----------------------------------------------- +Info 25 [00:00:54.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json"}} +Info 26 [00:00:55.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"79b1a0103ed8006f174a1f979cf698219d4ec4ae3a48594da1085f7a1749553c","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":2,"tsSize":39,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"typeRoots":[]},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 27 [00:00:56.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json","diagnostics":[],"triggerFile":"/user/username/rootfolder/otherfolder/a/b/project/file1.ts"}} +Info 28 [00:00:57.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) +Info 28 [00:00:58.000] Files (3) -Info 24 [00:00:55.000] ----------------------------------------------- -Info 24 [00:00:56.000] Open files: -Info 24 [00:00:57.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined -Info 24 [00:00:58.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 24 [00:00:59.000] response: +Info 28 [00:00:59.000] ----------------------------------------------- +Info 28 [00:01:00.000] Open files: +Info 28 [00:01:01.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined +Info 28 [00:01:02.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 28 [00:01:03.000] response: { "responseRequired": false } @@ -110,53 +118,55 @@ FsWatchesRecursive:: /user/username/rootfolder/otherfolder/a/b/project: *new* {} -Info 25 [00:01:03.000] FileWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/project/file3.ts 1:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/file3.ts 500 undefined WatchType: Closed Script info -Info 26 [00:01:04.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 27 [00:01:05.000] Scheduled: *ensureProjectForOpenFiles* -Info 28 [00:01:06.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/project/file3.ts 1:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/file3.ts 500 undefined WatchType: Closed Script info +Info 29 [00:01:07.000] FileWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/project/file3.ts 1:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/file3.ts 500 undefined WatchType: Closed Script info +Info 30 [00:01:08.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 31 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:01:10.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/project/file3.ts 1:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/project/file3.ts 500 undefined WatchType: Closed Script info Before checking timeout queue length (2) and running //// [/user/username/rootfolder/otherfolder/a/b/project/file3.ts] export class c { }export class d {} -Info 29 [00:01:07.000] Running: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 30 [00:01:08.000] Starting updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 31 [00:01:09.000] Finishing updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms -Info 32 [00:01:10.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) -Info 33 [00:01:11.000] Files (3) +Info 33 [00:01:11.000] Running: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 34 [00:01:12.000] Starting updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 35 [00:01:13.000] Finishing updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 36 [00:01:14.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) +Info 37 [00:01:15.000] Files (3) /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" /user/username/rootfolder/otherfolder/a/b/project/file1.ts SVC-1-0 "import a from \"file2\"" /user/username/rootfolder/otherfolder/a/b/project/file3.ts Text-2 "export class c { }export class d {}" -Info 34 [00:01:12.000] ----------------------------------------------- -Info 35 [00:01:13.000] Running: *ensureProjectForOpenFiles* -Info 36 [00:01:14.000] Before ensureProjectForOpenFiles: -Info 37 [00:01:15.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) -Info 37 [00:01:16.000] Files (3) +Info 38 [00:01:16.000] ----------------------------------------------- +Info 39 [00:01:17.000] Running: *ensureProjectForOpenFiles* +Info 40 [00:01:18.000] Before ensureProjectForOpenFiles: +Info 41 [00:01:19.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) +Info 41 [00:01:20.000] Files (3) -Info 37 [00:01:17.000] ----------------------------------------------- -Info 37 [00:01:18.000] Open files: -Info 37 [00:01:19.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined -Info 37 [00:01:20.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 37 [00:01:21.000] After ensureProjectForOpenFiles: -Info 38 [00:01:22.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) -Info 38 [00:01:23.000] Files (3) +Info 41 [00:01:21.000] ----------------------------------------------- +Info 41 [00:01:22.000] Open files: +Info 41 [00:01:23.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined +Info 41 [00:01:24.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 41 [00:01:25.000] After ensureProjectForOpenFiles: +Info 42 [00:01:26.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) +Info 42 [00:01:27.000] Files (3) -Info 38 [00:01:24.000] ----------------------------------------------- -Info 38 [00:01:25.000] Open files: -Info 38 [00:01:26.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined -Info 38 [00:01:27.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 42 [00:01:28.000] ----------------------------------------------- +Info 42 [00:01:29.000] Open files: +Info 42 [00:01:30.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined +Info 42 [00:01:31.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 42 [00:01:32.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/user/username/rootfolder/otherfolder/a/b/project/file1.ts"]}} After checking timeout queue length (2) and running -Info 38 [00:01:31.000] DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 39 [00:01:32.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation -Info 40 [00:01:33.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 41 [00:01:34.000] DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 42 [00:01:35.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one -Info 43 [00:01:36.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 44 [00:01:39.000] DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules/file2.d.ts :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 45 [00:01:40.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one -Info 46 [00:01:41.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules/file2.d.ts :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:36.000] DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 44 [00:01:37.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation +Info 45 [00:01:38.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 46 [00:01:39.000] DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 47 [00:01:40.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 48 [00:01:41.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 49 [00:01:44.000] DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules/file2.d.ts :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:45.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 51 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules/file2.d.ts :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations Before running timeout callbacks //// [/user/username/rootfolder/otherfolder/a/b/node_modules/file2.d.ts] export class a { } @@ -188,24 +198,24 @@ FsWatchesRecursive:: /user/username/rootfolder/otherfolder/a/b/node_modules: *new* {} -Info 47 [00:01:42.000] Running: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation -Info 48 [00:01:43.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 49 [00:01:44.000] Scheduled: *ensureProjectForOpenFiles* +Info 52 [00:01:47.000] Running: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation +Info 53 [00:01:48.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 54 [00:01:49.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks Before running timeout callbacks -Info 50 [00:01:45.000] Running: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 51 [00:01:46.000] Starting updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 52 [00:01:47.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache -Info 53 [00:01:48.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache -Info 54 [00:01:49.000] DirectoryWatcher:: Close:: WatchInfo: /user/username/rootfolder/otherfolder/a/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 55 [00:01:50.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/rootfolder/otherfolder/a/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 56 [00:01:51.000] DirectoryWatcher:: Close:: WatchInfo: /user/username/rootfolder/otherfolder/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 57 [00:01:52.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/rootfolder/otherfolder/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations -Info 58 [00:01:53.000] Finishing updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 59 [00:01:54.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) -Info 60 [00:01:55.000] Files (4) +Info 55 [00:01:50.000] Running: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 56 [00:01:51.000] Starting updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 57 [00:01:52.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache +Info 58 [00:01:53.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache +Info 59 [00:01:54.000] DirectoryWatcher:: Close:: WatchInfo: /user/username/rootfolder/otherfolder/a/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 60 [00:01:55.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/rootfolder/otherfolder/a/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 61 [00:01:56.000] DirectoryWatcher:: Close:: WatchInfo: /user/username/rootfolder/otherfolder/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 62 [00:01:57.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/rootfolder/otherfolder/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations +Info 63 [00:01:58.000] Finishing updateGraphWorker: Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 64 [00:01:59.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) +Info 65 [00:02:00.000] Files (4) /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" /user/username/rootfolder/otherfolder/a/b/node_modules/file2.d.ts Text-1 "export class a { }" /user/username/rootfolder/otherfolder/a/b/project/file1.ts SVC-1-0 "import a from \"file2\"" @@ -221,24 +231,26 @@ Info 60 [00:01:55.000] Files (4) file3.ts Matched by default include pattern '**/*' -Info 61 [00:01:56.000] ----------------------------------------------- -Info 62 [00:01:57.000] Running: *ensureProjectForOpenFiles* -Info 63 [00:01:58.000] Before ensureProjectForOpenFiles: -Info 64 [00:01:59.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) -Info 64 [00:02:00.000] Files (4) +Info 66 [00:02:01.000] ----------------------------------------------- +Info 67 [00:02:02.000] Running: *ensureProjectForOpenFiles* +Info 68 [00:02:03.000] Before ensureProjectForOpenFiles: +Info 69 [00:02:04.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) +Info 69 [00:02:05.000] Files (4) -Info 64 [00:02:01.000] ----------------------------------------------- -Info 64 [00:02:02.000] Open files: -Info 64 [00:02:03.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined -Info 64 [00:02:04.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json -Info 64 [00:02:05.000] After ensureProjectForOpenFiles: -Info 65 [00:02:06.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) -Info 65 [00:02:07.000] Files (4) +Info 69 [00:02:06.000] ----------------------------------------------- +Info 69 [00:02:07.000] Open files: +Info 69 [00:02:08.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined +Info 69 [00:02:09.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 69 [00:02:10.000] After ensureProjectForOpenFiles: +Info 70 [00:02:11.000] Project '/user/username/rootfolder/otherfolder/a/b/project/tsconfig.json' (Configured) +Info 70 [00:02:12.000] Files (4) -Info 65 [00:02:08.000] ----------------------------------------------- -Info 65 [00:02:09.000] Open files: -Info 65 [00:02:10.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined -Info 65 [00:02:11.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 70 [00:02:13.000] ----------------------------------------------- +Info 70 [00:02:14.000] Open files: +Info 70 [00:02:15.000] FileName: /user/username/rootfolder/otherfolder/a/b/project/file1.ts ProjectRootPath: undefined +Info 70 [00:02:16.000] Projects: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json +Info 70 [00:02:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/user/username/rootfolder/otherfolder/a/b/project/file1.ts"]}} After running timeout callbacks PolledWatches:: diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js new file mode 100644 index 00000000000..1137b686289 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js @@ -0,0 +1,268 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{"compilerOptions":{"isolatedModules":true}} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "isolatedModules": true, + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"isolatedModules":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1Consumer1.ts"}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 62 [00:01:36.000] Running: /a/b/tsconfig.json +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 68 [00:01:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:43.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 70 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 71 [00:01:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 72 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 73 [00:01:47.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 74 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:49.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 76 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Running: *ensureProjectForOpenFiles* +Info 78 [00:01:52.000] Before ensureProjectForOpenFiles: +Info 79 [00:01:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 79 [00:01:54.000] Files (6) + +Info 79 [00:01:55.000] ----------------------------------------------- +Info 79 [00:01:56.000] Open files: +Info 79 [00:01:57.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 79 [00:01:58.000] Projects: /a/b/tsconfig.json +Info 79 [00:01:59.000] After ensureProjectForOpenFiles: +Info 80 [00:02:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 80 [00:02:01.000] Files (6) + +Info 80 [00:02:02.000] ----------------------------------------------- +Info 80 [00:02:03.000] Open files: +Info 80 [00:02:04.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 80 [00:02:05.000] Projects: /a/b/tsconfig.json +Info 80 [00:02:06.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js new file mode 100644 index 00000000000..d73644ffc42 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js @@ -0,0 +1,257 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{"compilerOptions":{"module":"system","outFile":"/a/b/out.js"}} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "module": 4, + "outFile": "/a/b/out.js", + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 14 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 16 [00:00:27.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 17 [00:00:28.000] Project '/a/b/tsconfig.json' (Configured) +Info 18 [00:00:29.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 19 [00:00:30.000] ----------------------------------------------- +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"module":"system","outFile":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1Consumer1.ts"}} +Info 23 [00:00:34.000] Project '/a/b/tsconfig.json' (Configured) +Info 23 [00:00:35.000] Files (1) + +Info 23 [00:00:36.000] ----------------------------------------------- +Info 23 [00:00:37.000] Open files: +Info 23 [00:00:38.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 23 [00:00:39.000] Projects: /a/b/tsconfig.json +Info 23 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 24 [00:00:44.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 25 [00:00:45.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 26 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 28 [00:00:48.000] Scheduled: /a/b/tsconfig.json +Info 29 [00:00:49.000] Scheduled: *ensureProjectForOpenFiles* +Info 30 [00:00:50.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 31 [00:00:53.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 32 [00:00:54.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 33 [00:00:55.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 35 [00:00:57.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 36 [00:00:58.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 37 [00:00:59.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 38 [00:01:02.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 39 [00:01:03.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 40 [00:01:04.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 42 [00:01:06.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 43 [00:01:07.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 44 [00:01:08.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 45 [00:01:11.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 46 [00:01:12.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 47 [00:01:13.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 49 [00:01:15.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 50 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 51 [00:01:17.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 52 [00:01:22.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 53 [00:01:23.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 54 [00:01:24.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 55 [00:01:25.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 56 [00:01:26.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 57 [00:01:28.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 58 [00:01:29.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 59 [00:01:30.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 60 [00:01:34.000] Running: /a/b/tsconfig.json +Info 61 [00:01:35.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 62 [00:01:36.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 68 [00:01:42.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 69 [00:01:43.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 70 [00:01:44.000] Project '/a/b/tsconfig.json' (Configured) +Info 71 [00:01:45.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 72 [00:01:46.000] ----------------------------------------------- +Info 73 [00:01:47.000] Running: *ensureProjectForOpenFiles* +Info 74 [00:01:48.000] Before ensureProjectForOpenFiles: +Info 75 [00:01:49.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:50.000] Files (6) + +Info 75 [00:01:51.000] ----------------------------------------------- +Info 75 [00:01:52.000] Open files: +Info 75 [00:01:53.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 75 [00:01:54.000] Projects: /a/b/tsconfig.json +Info 75 [00:01:55.000] After ensureProjectForOpenFiles: +Info 76 [00:01:56.000] Project '/a/b/tsconfig.json' (Configured) +Info 76 [00:01:57.000] Files (6) + +Info 76 [00:01:58.000] ----------------------------------------------- +Info 76 [00:01:59.000] Open files: +Info 76 [00:02:00.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 76 [00:02:01.000] Projects: /a/b/tsconfig.json +Info 76 [00:02:02.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-deleted-files.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-deleted-files.js new file mode 100644 index 00000000000..13a971ecb42 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-deleted-files.js @@ -0,0 +1,269 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1Consumer1.ts"}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Info 62 [00:01:37.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 63 [00:01:38.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 64 [00:01:39.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 65 [00:01:40.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 66 [00:01:41.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 67 [00:01:42.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 68 [00:01:43.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] deleted + +Info 69 [00:01:44.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 70 [00:01:45.000] Running: /a/b/tsconfig.json +Info 71 [00:01:46.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 72 [00:01:47.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 73 [00:01:48.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 74 [00:01:49.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 75 [00:01:50.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 76 [00:01:51.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 77 [00:01:52.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 78 [00:01:53.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 79 [00:01:54.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 80 [00:01:55.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 81 [00:01:56.000] Project '/a/b/tsconfig.json' (Configured) +Info 82 [00:01:57.000] Files (5) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 83 [00:01:58.000] ----------------------------------------------- +Info 84 [00:01:59.000] Running: *ensureProjectForOpenFiles* +Info 85 [00:02:00.000] Before ensureProjectForOpenFiles: +Info 86 [00:02:01.000] Project '/a/b/tsconfig.json' (Configured) +Info 86 [00:02:02.000] Files (5) + +Info 86 [00:02:03.000] ----------------------------------------------- +Info 86 [00:02:04.000] Open files: +Info 86 [00:02:05.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 86 [00:02:06.000] Projects: /a/b/tsconfig.json +Info 86 [00:02:07.000] After ensureProjectForOpenFiles: +Info 87 [00:02:08.000] Project '/a/b/tsconfig.json' (Configured) +Info 87 [00:02:09.000] Files (5) + +Info 87 [00:02:10.000] ----------------------------------------------- +Info 87 [00:02:11.000] Open files: +Info 87 [00:02:12.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 87 [00:02:13.000] Projects: /a/b/tsconfig.json +Info 87 [00:02:14.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-newly-created-files.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-newly-created-files.js new file mode 100644 index 00000000000..dedd54df90b --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-newly-created-files.js @@ -0,0 +1,285 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1Consumer1.ts"}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Info 62 [00:01:38.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 63 [00:01:39.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 64 [00:01:40.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 65 [00:01:41.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 66 [00:01:42.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 67 [00:01:43.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 68 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer3.ts] +import {Foo} from "./moduleFile1"; let y = Foo(); + + +Info 69 [00:01:45.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 70 [00:01:46.000] Running: /a/b/tsconfig.json +Info 71 [00:01:47.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 72 [00:01:48.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer3.ts 500 undefined WatchType: Closed Script info +Info 73 [00:01:49.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 74 [00:01:50.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 75 [00:01:51.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 76 [00:01:52.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 77 [00:01:53.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 78 [00:01:54.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 79 [00:01:55.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 80 [00:01:56.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 81 [00:01:57.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 82 [00:01:58.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 83 [00:01:59.000] Project '/a/b/tsconfig.json' (Configured) +Info 84 [00:02:00.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/file1Consumer3.ts Text-1 "import {Foo} from \"./moduleFile1\"; let y = Foo();" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Imported via "./moduleFile1" from file 'file1Consumer3.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + file1Consumer3.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 85 [00:02:01.000] ----------------------------------------------- +Info 86 [00:02:02.000] Running: *ensureProjectForOpenFiles* +Info 87 [00:02:03.000] Before ensureProjectForOpenFiles: +Info 88 [00:02:04.000] Project '/a/b/tsconfig.json' (Configured) +Info 88 [00:02:05.000] Files (7) + +Info 88 [00:02:06.000] ----------------------------------------------- +Info 88 [00:02:07.000] Open files: +Info 88 [00:02:08.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 88 [00:02:09.000] Projects: /a/b/tsconfig.json +Info 88 [00:02:10.000] After ensureProjectForOpenFiles: +Info 89 [00:02:11.000] Project '/a/b/tsconfig.json' (Configured) +Info 89 [00:02:12.000] Files (7) + +Info 89 [00:02:13.000] ----------------------------------------------- +Info 89 [00:02:14.000] Open files: +Info 89 [00:02:15.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 89 [00:02:16.000] Projects: /a/b/tsconfig.json +Info 89 [00:02:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/file1consumer3.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-the-reference-map-changes.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-the-reference-map-changes.js new file mode 100644 index 00000000000..520dfc1f89d --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-the-reference-map-changes.js @@ -0,0 +1,488 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1Consumer1.ts"}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before request + +Info 62 [00:01:33.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "export let y = Foo();", + "endLine": 1, + "endOffset": 53, + "line": 1, + "offset": 1 + }, + "seq": 2, + "type": "request" + } +Info 63 [00:01:34.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +Info 64 [00:01:35.000] Running: /a/b/tsconfig.json +Info 65 [00:01:36.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 68 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:40.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 70 [00:01:41.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 71 [00:01:42.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 72 [00:01:43.000] Project '/a/b/tsconfig.json' (Configured) +Info 73 [00:01:44.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1Consumer1.ts SVC-1-1 "export let y = Foo();;" + /a/b/moduleFile1.ts Text-1 "export function Foo() { };" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1Consumer1.ts + Matched by default include pattern '**/*' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 74 [00:01:45.000] ----------------------------------------------- +Info 75 [00:01:46.000] Running: *ensureProjectForOpenFiles* +Info 76 [00:01:47.000] Before ensureProjectForOpenFiles: +Info 77 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 77 [00:01:49.000] Files (6) + +Info 77 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Open files: +Info 77 [00:01:52.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 77 [00:01:53.000] Projects: /a/b/tsconfig.json +Info 77 [00:01:54.000] After ensureProjectForOpenFiles: +Info 78 [00:01:55.000] Project '/a/b/tsconfig.json' (Configured) +Info 78 [00:01:56.000] Files (6) + +Info 78 [00:01:57.000] ----------------------------------------------- +Info 78 [00:01:58.000] Open files: +Info 78 [00:01:59.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 78 [00:02:00.000] Projects: /a/b/tsconfig.json +Info 78 [00:02:01.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 79 [00:02:05.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 80 [00:02:06.000] Scheduled: /a/b/tsconfig.json +Info 81 [00:02:07.000] Scheduled: *ensureProjectForOpenFiles* +Info 82 [00:02:08.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 83 [00:02:09.000] Running: /a/b/tsconfig.json +Info 84 [00:02:10.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 85 [00:02:11.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 86 [00:02:12.000] Project '/a/b/tsconfig.json' (Configured) +Info 87 [00:02:13.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1Consumer1.ts SVC-1-1 "export let y = Foo();;" + /a/b/moduleFile1.ts Text-2 "export var T: number;export function Foo() { };" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 88 [00:02:14.000] ----------------------------------------------- +Info 89 [00:02:15.000] Running: *ensureProjectForOpenFiles* +Info 90 [00:02:16.000] Before ensureProjectForOpenFiles: +Info 91 [00:02:17.000] Project '/a/b/tsconfig.json' (Configured) +Info 91 [00:02:18.000] Files (6) + +Info 91 [00:02:19.000] ----------------------------------------------- +Info 91 [00:02:20.000] Open files: +Info 91 [00:02:21.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 91 [00:02:22.000] Projects: /a/b/tsconfig.json +Info 91 [00:02:23.000] After ensureProjectForOpenFiles: +Info 92 [00:02:24.000] Project '/a/b/tsconfig.json' (Configured) +Info 92 [00:02:25.000] Files (6) + +Info 92 [00:02:26.000] ----------------------------------------------- +Info 92 [00:02:27.000] Open files: +Info 92 [00:02:28.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 92 [00:02:29.000] Projects: /a/b/tsconfig.json +Info 92 [00:02:30.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +Before request + +Info 93 [00:02:31.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "import {Foo} from \"./moduleFile1\";let y = Foo();", + "endLine": 1, + "endOffset": 21, + "line": 1, + "offset": 1 + }, + "seq": 3, + "type": "request" + } +Info 94 [00:02:32.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +After running timeout callbacks + +Info 95 [00:02:36.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 96 [00:02:37.000] Scheduled: /a/b/tsconfig.json +Info 97 [00:02:38.000] Scheduled: *ensureProjectForOpenFiles* +Info 98 [00:02:39.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export var T2: string;export function Foo() { }; + + +Info 99 [00:02:40.000] Running: /a/b/tsconfig.json +Info 100 [00:02:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 101 [00:02:42.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 102 [00:02:43.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 103 [00:02:44.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 104 [00:02:45.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 105 [00:02:46.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 106 [00:02:47.000] Project '/a/b/tsconfig.json' (Configured) +Info 107 [00:02:48.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-3 "export var T: number;export var T2: string;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-2 "import {Foo} from \"./moduleFile1\";let y = Foo();;;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 108 [00:02:49.000] ----------------------------------------------- +Info 109 [00:02:50.000] Running: *ensureProjectForOpenFiles* +Info 110 [00:02:51.000] Before ensureProjectForOpenFiles: +Info 111 [00:02:52.000] Project '/a/b/tsconfig.json' (Configured) +Info 111 [00:02:53.000] Files (6) + +Info 111 [00:02:54.000] ----------------------------------------------- +Info 111 [00:02:55.000] Open files: +Info 111 [00:02:56.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 111 [00:02:57.000] Projects: /a/b/tsconfig.json +Info 111 [00:02:58.000] After ensureProjectForOpenFiles: +Info 112 [00:02:59.000] Project '/a/b/tsconfig.json' (Configured) +Info 112 [00:03:00.000] Files (6) + +Info 112 [00:03:01.000] ----------------------------------------------- +Info 112 [00:03:02.000] Open files: +Info 112 [00:03:03.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 112 [00:03:04.000] Projects: /a/b/tsconfig.json +Info 112 [00:03:05.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: + {} +/a/b/globalfile3.ts: + {} +/a/b/modulefile1.ts: + {} +/a/b/modulefile2.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Before request + +Info 113 [00:03:06.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "export let y = Foo();", + "endLine": 1, + "endOffset": 48, + "line": 1, + "offset": 1 + }, + "seq": 4, + "type": "request" + } +Info 114 [00:03:07.000] response: + { + "responseRequired": false + } +After request + +Info 115 [00:03:11.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 116 [00:03:12.000] Scheduled: /a/b/tsconfig.json +Info 117 [00:03:13.000] Scheduled: *ensureProjectForOpenFiles* +Info 118 [00:03:14.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 119 [00:03:15.000] Running: /a/b/tsconfig.json +Info 120 [00:03:16.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 121 [00:03:17.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 5 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 122 [00:03:18.000] Project '/a/b/tsconfig.json' (Configured) +Info 123 [00:03:19.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1Consumer1.ts SVC-1-3 "export let y = Foo();;;;" + /a/b/moduleFile1.ts Text-4 "export var T: number;export function Foo() { };" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 124 [00:03:20.000] ----------------------------------------------- +Info 125 [00:03:21.000] Running: *ensureProjectForOpenFiles* +Info 126 [00:03:22.000] Before ensureProjectForOpenFiles: +Info 127 [00:03:23.000] Project '/a/b/tsconfig.json' (Configured) +Info 127 [00:03:24.000] Files (6) + +Info 127 [00:03:25.000] ----------------------------------------------- +Info 127 [00:03:26.000] Open files: +Info 127 [00:03:27.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 127 [00:03:28.000] Projects: /a/b/tsconfig.json +Info 127 [00:03:29.000] After ensureProjectForOpenFiles: +Info 128 [00:03:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 128 [00:03:31.000] Files (6) + +Info 128 [00:03:32.000] ----------------------------------------------- +Info 128 [00:03:33.000] Open files: +Info 128 [00:03:34.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 128 [00:03:35.000] Projects: /a/b/tsconfig.json +Info 128 [00:03:36.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-contains-only-itself.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-contains-only-itself.js new file mode 100644 index 00000000000..0ae2ca5a7d7 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-contains-only-itself.js @@ -0,0 +1,310 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1Consumer1.ts"}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 62 [00:01:36.000] Running: /a/b/tsconfig.json +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 68 [00:01:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:43.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 70 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 71 [00:01:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 72 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 73 [00:01:47.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 74 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:49.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 76 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Running: *ensureProjectForOpenFiles* +Info 78 [00:01:52.000] Before ensureProjectForOpenFiles: +Info 79 [00:01:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 79 [00:01:54.000] Files (6) + +Info 79 [00:01:55.000] ----------------------------------------------- +Info 79 [00:01:56.000] Open files: +Info 79 [00:01:57.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 79 [00:01:58.000] Projects: /a/b/tsconfig.json +Info 79 [00:01:59.000] After ensureProjectForOpenFiles: +Info 80 [00:02:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 80 [00:02:01.000] Files (6) + +Info 80 [00:02:02.000] ----------------------------------------------- +Info 80 [00:02:03.000] Open files: +Info 80 [00:02:04.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 80 [00:02:05.000] Projects: /a/b/tsconfig.json +Info 80 [00:02:06.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 81 [00:02:10.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 82 [00:02:11.000] Scheduled: /a/b/tsconfig.json +Info 83 [00:02:12.000] Scheduled: *ensureProjectForOpenFiles* +Info 84 [00:02:13.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { console.log('hi'); }; + + +Info 85 [00:02:14.000] Running: /a/b/tsconfig.json +Info 86 [00:02:15.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 87 [00:02:16.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 88 [00:02:17.000] Project '/a/b/tsconfig.json' (Configured) +Info 89 [00:02:18.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-2 "export var T: number;export function Foo() { console.log('hi'); };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 90 [00:02:19.000] ----------------------------------------------- +Info 91 [00:02:20.000] Running: *ensureProjectForOpenFiles* +Info 92 [00:02:21.000] Before ensureProjectForOpenFiles: +Info 93 [00:02:22.000] Project '/a/b/tsconfig.json' (Configured) +Info 93 [00:02:23.000] Files (6) + +Info 93 [00:02:24.000] ----------------------------------------------- +Info 93 [00:02:25.000] Open files: +Info 93 [00:02:26.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 93 [00:02:27.000] Projects: /a/b/tsconfig.json +Info 93 [00:02:28.000] After ensureProjectForOpenFiles: +Info 94 [00:02:29.000] Project '/a/b/tsconfig.json' (Configured) +Info 94 [00:02:30.000] Files (6) + +Info 94 [00:02:31.000] ----------------------------------------------- +Info 94 [00:02:32.000] Open files: +Info 94 [00:02:33.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 94 [00:02:34.000] Projects: /a/b/tsconfig.json +Info 94 [00:02:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-changes-in-non-root-files.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-changes-in-non-root-files.js new file mode 100644 index 00000000000..8d71e149fb1 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-changes-in-non-root-files.js @@ -0,0 +1,257 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{"files":["/a/b/file1Consumer1.ts"]} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 9 [00:00:20.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 10 [00:00:21.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 14 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 16 [00:00:27.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 17 [00:00:28.000] Project '/a/b/tsconfig.json' (Configured) +Info 18 [00:00:29.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Part of 'files' list in tsconfig.json + +Info 19 [00:00:30.000] ----------------------------------------------- +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":true,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1Consumer1.ts"}} +Info 23 [00:00:34.000] Project '/a/b/tsconfig.json' (Configured) +Info 23 [00:00:35.000] Files (1) + +Info 23 [00:00:36.000] ----------------------------------------------- +Info 23 [00:00:37.000] Open files: +Info 23 [00:00:38.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 23 [00:00:39.000] Projects: /a/b/tsconfig.json +Info 23 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +Info 24 [00:00:44.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 25 [00:00:45.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 26 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 28 [00:00:50.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 29 [00:00:51.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 30 [00:00:54.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 31 [00:00:55.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 32 [00:00:56.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 33 [00:00:59.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:01:00.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:01:06.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 37 [00:01:07.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 38 [00:01:08.000] Scheduled: /a/b/tsconfig.json +Info 39 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles* +Info 40 [00:01:10.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +Info 41 [00:01:12.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 42 [00:01:13.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 43 [00:01:14.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 44 [00:01:18.000] Running: /a/b/tsconfig.json +Info 45 [00:01:19.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 46 [00:01:20.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 47 [00:01:21.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 48 [00:01:22.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 49 [00:01:23.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:24.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 51 [00:01:25.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 52 [00:01:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 53 [00:01:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 54 [00:01:28.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + file1Consumer1.ts + Part of 'files' list in tsconfig.json + +Info 55 [00:01:29.000] ----------------------------------------------- +Info 56 [00:01:30.000] Running: *ensureProjectForOpenFiles* +Info 57 [00:01:31.000] Before ensureProjectForOpenFiles: +Info 58 [00:01:32.000] Project '/a/b/tsconfig.json' (Configured) +Info 58 [00:01:33.000] Files (3) + +Info 58 [00:01:34.000] ----------------------------------------------- +Info 58 [00:01:35.000] Open files: +Info 58 [00:01:36.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 58 [00:01:37.000] Projects: /a/b/tsconfig.json +Info 58 [00:01:38.000] After ensureProjectForOpenFiles: +Info 59 [00:01:39.000] Project '/a/b/tsconfig.json' (Configured) +Info 59 [00:01:40.000] Files (3) + +Info 59 [00:01:41.000] ----------------------------------------------- +Info 59 [00:01:42.000] Open files: +Info 59 [00:01:43.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 59 [00:01:44.000] Projects: /a/b/tsconfig.json +Info 59 [00:01:45.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/modulefile1.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +Info 60 [00:01:49.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 61 [00:01:50.000] Scheduled: /a/b/tsconfig.json +Info 62 [00:01:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 63 [00:01:52.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { };var T1: number; + + +Info 64 [00:01:53.000] Running: /a/b/tsconfig.json +Info 65 [00:01:54.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 66 [00:01:55.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 67 [00:01:56.000] Project '/a/b/tsconfig.json' (Configured) +Info 68 [00:01:57.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-2 "export function Foo() { };var T1: number;" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + +Info 69 [00:01:58.000] ----------------------------------------------- +Info 70 [00:01:59.000] Running: *ensureProjectForOpenFiles* +Info 71 [00:02:00.000] Before ensureProjectForOpenFiles: +Info 72 [00:02:01.000] Project '/a/b/tsconfig.json' (Configured) +Info 72 [00:02:02.000] Files (3) + +Info 72 [00:02:03.000] ----------------------------------------------- +Info 72 [00:02:04.000] Open files: +Info 72 [00:02:05.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 72 [00:02:06.000] Projects: /a/b/tsconfig.json +Info 72 [00:02:07.000] After ensureProjectForOpenFiles: +Info 73 [00:02:08.000] Project '/a/b/tsconfig.json' (Configured) +Info 73 [00:02:09.000] Files (3) + +Info 73 [00:02:10.000] ----------------------------------------------- +Info 73 [00:02:11.000] Open files: +Info 73 [00:02:12.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 73 [00:02:13.000] Projects: /a/b/tsconfig.json +Info 73 [00:02:14.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-non-existing-code-file.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-non-existing-code-file.js new file mode 100644 index 00000000000..32230463c8b --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-non-existing-code-file.js @@ -0,0 +1,287 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/referenceFile1.ts] + + /// + export var x = Foo(); + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/referenceFile1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/referenceFile1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/referenceFile1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/referenceFile1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 17 [00:00:28.000] Files (1) + /a/b/referenceFile1.ts SVC-1-0 "\n /// \n export var x = Foo();" + + + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:29.000] ----------------------------------------------- +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":104,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/referenceFile1.ts"}} +Info 22 [00:00:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/b/tsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile2.ts: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 23 [00:00:45.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 24 [00:00:46.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 25 [00:00:47.000] Scheduled: /a/b/tsconfig.json +Info 26 [00:00:48.000] Scheduled: *ensureProjectForOpenFiles* +Info 27 [00:00:49.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +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; } + + +PolledWatches:: +/a/b/modulefile2.ts: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 28 [00:00:51.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/referenceFile1.ts", + "insertString": "\n /// \n export var x = Foo();export var yy = Foo();", + "endLine": 1, + "endOffset": 104, + "line": 1, + "offset": 1 + }, + "seq": 2, + "type": "request" + } +Info 29 [00:00:52.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +Info 30 [00:00:53.000] Running: /a/b/tsconfig.json +Info 31 [00:00:54.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 32 [00:00:55.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 33 [00:00:56.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 34 [00:00:57.000] Project '/a/b/tsconfig.json' (Configured) +Info 35 [00:00:58.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/referenceFile1.ts SVC-1-1 "\n /// \n export var x = Foo();export var yy = Foo();;" + + + ../lib/lib.d.ts + Default library for target 'es5' + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 36 [00:00:59.000] ----------------------------------------------- +Info 37 [00:01:00.000] Running: *ensureProjectForOpenFiles* +Info 38 [00:01:01.000] Before ensureProjectForOpenFiles: +Info 39 [00:01:02.000] Project '/a/b/tsconfig.json' (Configured) +Info 39 [00:01:03.000] Files (2) + +Info 39 [00:01:04.000] ----------------------------------------------- +Info 39 [00:01:05.000] Open files: +Info 39 [00:01:06.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 39 [00:01:07.000] Projects: /a/b/tsconfig.json +Info 39 [00:01:08.000] After ensureProjectForOpenFiles: +Info 40 [00:01:09.000] Project '/a/b/tsconfig.json' (Configured) +Info 40 [00:01:10.000] Files (2) + +Info 40 [00:01:11.000] ----------------------------------------------- +Info 40 [00:01:12.000] Open files: +Info 40 [00:01:13.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 40 [00:01:14.000] Projects: /a/b/tsconfig.json +Info 40 [00:01:15.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/referenceFile1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/modulefile2.ts: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 41 [00:01:18.000] FileWatcher:: Triggered with /a/b/modulefile2.ts 0:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 42 [00:01:19.000] FileWatcher:: Close:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 43 [00:01:20.000] Scheduled: /a/b/tsconfig.json +Info 44 [00:01:21.000] Scheduled: *ensureProjectForOpenFiles* +Info 45 [00:01:22.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/modulefile2.ts 0:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 46 [00:01:23.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:24.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 48 [00:01:25.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 49 [00:01:26.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile2.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 50 [00:01:27.000] Running: /a/b/tsconfig.json +Info 51 [00:01:28.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile2.ts 500 undefined WatchType: Closed Script info +Info 52 [00:01:29.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 53 [00:01:30.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 54 [00:01:31.000] Project '/a/b/tsconfig.json' (Configured) +Info 55 [00:01:32.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + /a/b/referenceFile1.ts SVC-1-1 "\n /// \n export var x = Foo();export var yy = Foo();;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile2.ts + Referenced via './moduleFile2.ts' from file 'referenceFile1.ts' + Matched by default include pattern '**/*' + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 56 [00:01:33.000] ----------------------------------------------- +Info 57 [00:01:34.000] Running: *ensureProjectForOpenFiles* +Info 58 [00:01:35.000] Before ensureProjectForOpenFiles: +Info 59 [00:01:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 59 [00:01:37.000] Files (3) + +Info 59 [00:01:38.000] ----------------------------------------------- +Info 59 [00:01:39.000] Open files: +Info 59 [00:01:40.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 59 [00:01:41.000] Projects: /a/b/tsconfig.json +Info 59 [00:01:42.000] After ensureProjectForOpenFiles: +Info 60 [00:01:43.000] Project '/a/b/tsconfig.json' (Configured) +Info 60 [00:01:44.000] Files (3) + +Info 60 [00:01:45.000] ----------------------------------------------- +Info 60 [00:01:46.000] Open files: +Info 60 [00:01:47.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 60 [00:01:48.000] Projects: /a/b/tsconfig.json +Info 60 [00:01:49.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/referenceFile1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b/modulefile2.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-removed-code-file.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-removed-code-file.js new file mode 100644 index 00000000000..0105e8c923c --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-detect-removed-code-file.js @@ -0,0 +1,190 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/referenceFile1.ts] + + /// + export var x = Foo(); + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/referenceFile1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/referenceFile1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/referenceFile1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/referenceFile1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 17 [00:00:28.000] Files (1) + /a/b/referenceFile1.ts SVC-1-0 "\n /// \n export var x = Foo();" + + + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:29.000] ----------------------------------------------- +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":104,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/referenceFile1.ts"}} +Info 22 [00:00:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/b/tsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1.ts: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 23 [00:00:45.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 24 [00:00:46.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 25 [00:00:47.000] Scheduled: /a/b/tsconfig.json +Info 26 [00:00:48.000] Scheduled: *ensureProjectForOpenFiles* +Info 27 [00:00:49.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 28 [00:00:52.000] FileWatcher:: Triggered with /a/b/modulefile1.ts 0:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 29 [00:00:53.000] FileWatcher:: Close:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 30 [00:00:54.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 31 [00:00:55.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 32 [00:00:56.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/modulefile1.ts 0:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 33 [00:00:57.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 34 [00:00:58.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 35 [00:00:59.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 36 [00:01:00.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:01:03.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 38 [00:01:04.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 39 [00:01:05.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 40 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/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; } + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1.ts: + {"pollingInterval":500} +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 41 [00:01:07.000] Running: /a/b/tsconfig.json +Info 42 [00:01:08.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 43 [00:01:09.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 44 [00:01:10.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 45 [00:01:11.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 46 [00:01:12.000] Project '/a/b/tsconfig.json' (Configured) +Info 47 [00:01:13.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/referenceFile1.ts SVC-1-0 "\n /// \n export var x = Foo();" + + + ../lib/lib.d.ts + Default library for target 'es5' + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 48 [00:01:14.000] ----------------------------------------------- +Info 49 [00:01:15.000] Running: *ensureProjectForOpenFiles* +Info 50 [00:01:16.000] Before ensureProjectForOpenFiles: +Info 51 [00:01:17.000] Project '/a/b/tsconfig.json' (Configured) +Info 51 [00:01:18.000] Files (2) + +Info 51 [00:01:19.000] ----------------------------------------------- +Info 51 [00:01:20.000] Open files: +Info 51 [00:01:21.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 51 [00:01:22.000] Projects: /a/b/tsconfig.json +Info 51 [00:01:23.000] After ensureProjectForOpenFiles: +Info 52 [00:01:24.000] Project '/a/b/tsconfig.json' (Configured) +Info 52 [00:01:25.000] Files (2) + +Info 52 [00:01:26.000] ----------------------------------------------- +Info 52 [00:01:27.000] Open files: +Info 52 [00:01:28.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 52 [00:01:29.000] Projects: /a/b/tsconfig.json +Info 52 [00:01:30.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/referenceFile1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} +/a/b/modulefile1.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-return-all-files-if-a-global-file-changed-shape.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-return-all-files-if-a-global-file-changed-shape.js new file mode 100644 index 00000000000..b46e209ad45 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-return-all-files-if-a-global-file-changed-shape.js @@ -0,0 +1,267 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1Consumer1.ts"}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number }var T2: string; + + +Info 62 [00:01:36.000] Running: /a/b/tsconfig.json +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 68 [00:01:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:43.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 70 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 71 [00:01:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 72 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 73 [00:01:47.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 74 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:49.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }var T2: string;" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 76 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Running: *ensureProjectForOpenFiles* +Info 78 [00:01:52.000] Before ensureProjectForOpenFiles: +Info 79 [00:01:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 79 [00:01:54.000] Files (6) + +Info 79 [00:01:55.000] ----------------------------------------------- +Info 79 [00:01:56.000] Open files: +Info 79 [00:01:57.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 79 [00:01:58.000] Projects: /a/b/tsconfig.json +Info 79 [00:01:59.000] After ensureProjectForOpenFiles: +Info 80 [00:02:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 80 [00:02:01.000] Files (6) + +Info 80 [00:02:02.000] ----------------------------------------------- +Info 80 [00:02:03.000] Open files: +Info 80 [00:02:04.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 80 [00:02:05.000] Projects: /a/b/tsconfig.json +Info 80 [00:02:06.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-return-cascaded-affected-file-list.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-return-cascaded-affected-file-list.js new file mode 100644 index 00000000000..f7f2f03d4b1 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-return-cascaded-affected-file-list.js @@ -0,0 +1,413 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1Consumer1.ts"}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:22.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 55 [00:01:23.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 56 [00:01:24.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 57 [00:01:25.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 58 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 59 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 60 [00:01:28.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 61 [00:01:33.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 62 [00:01:34.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 63 [00:01:35.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 64 [00:01:36.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 65 [00:01:37.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/file1Consumer1Consumer1.ts] +import {y} from "./file1Consumer1"; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 66 [00:01:39.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 67 [00:01:40.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 68 [00:01:41.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before request + +Info 69 [00:01:42.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;", + "endLine": 1, + "endOffset": 53, + "line": 1, + "offset": 1 + }, + "seq": 2, + "type": "request" + } +Info 70 [00:01:43.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +Info 71 [00:01:44.000] Running: /a/b/tsconfig.json +Info 72 [00:01:45.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer1Consumer1.ts 500 undefined WatchType: Closed Script info +Info 73 [00:01:46.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 74 [00:01:47.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 75 [00:01:48.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 76 [00:01:49.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 77 [00:01:50.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 78 [00:01:51.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 79 [00:01:52.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 80 [00:01:53.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 81 [00:01:54.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 82 [00:01:55.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 83 [00:01:56.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 84 [00:01:57.000] Project '/a/b/tsconfig.json' (Configured) +Info 85 [00:01:58.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-1 "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;;" + /a/b/file1Consumer1Consumer1.ts Text-1 "import {y} from \"./file1Consumer1\";" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + Imported via "./file1Consumer1" from file 'file1Consumer1Consumer1.ts' + file1Consumer1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 86 [00:01:59.000] ----------------------------------------------- +Info 87 [00:02:00.000] Running: *ensureProjectForOpenFiles* +Info 88 [00:02:01.000] Before ensureProjectForOpenFiles: +Info 89 [00:02:02.000] Project '/a/b/tsconfig.json' (Configured) +Info 89 [00:02:03.000] Files (7) + +Info 89 [00:02:04.000] ----------------------------------------------- +Info 89 [00:02:05.000] Open files: +Info 89 [00:02:06.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 89 [00:02:07.000] Projects: /a/b/tsconfig.json +Info 89 [00:02:08.000] After ensureProjectForOpenFiles: +Info 90 [00:02:09.000] Project '/a/b/tsconfig.json' (Configured) +Info 90 [00:02:10.000] Files (7) + +Info 90 [00:02:11.000] ----------------------------------------------- +Info 90 [00:02:12.000] Open files: +Info 90 [00:02:13.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 90 [00:02:14.000] Projects: /a/b/tsconfig.json +Info 90 [00:02:15.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer1consumer1.ts: *new* + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 91 [00:02:19.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 92 [00:02:20.000] Scheduled: /a/b/tsconfig.json +Info 93 [00:02:21.000] Scheduled: *ensureProjectForOpenFiles* +Info 94 [00:02:22.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 95 [00:02:23.000] Running: /a/b/tsconfig.json +Info 96 [00:02:24.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 97 [00:02:25.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 98 [00:02:26.000] Project '/a/b/tsconfig.json' (Configured) +Info 99 [00:02:27.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-2 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-1 "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;;" + /a/b/file1Consumer1Consumer1.ts Text-1 "import {y} from \"./file1Consumer1\";" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 100 [00:02:28.000] ----------------------------------------------- +Info 101 [00:02:29.000] Running: *ensureProjectForOpenFiles* +Info 102 [00:02:30.000] Before ensureProjectForOpenFiles: +Info 103 [00:02:31.000] Project '/a/b/tsconfig.json' (Configured) +Info 103 [00:02:32.000] Files (7) + +Info 103 [00:02:33.000] ----------------------------------------------- +Info 103 [00:02:34.000] Open files: +Info 103 [00:02:35.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 103 [00:02:36.000] Projects: /a/b/tsconfig.json +Info 103 [00:02:37.000] After ensureProjectForOpenFiles: +Info 104 [00:02:38.000] Project '/a/b/tsconfig.json' (Configured) +Info 104 [00:02:39.000] Files (7) + +Info 104 [00:02:40.000] ----------------------------------------------- +Info 104 [00:02:41.000] Open files: +Info 104 [00:02:42.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 104 [00:02:43.000] Projects: /a/b/tsconfig.json +Info 104 [00:02:44.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +Before request + +Info 105 [00:02:45.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;export var T2: number;", + "endLine": 1, + "endOffset": 74, + "line": 1, + "offset": 1 + }, + "seq": 3, + "type": "request" + } +Info 106 [00:02:46.000] response: + { + "responseRequired": false + } +After request + +Info 107 [00:02:50.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 108 [00:02:51.000] Scheduled: /a/b/tsconfig.json +Info 109 [00:02:52.000] Scheduled: *ensureProjectForOpenFiles* +Info 110 [00:02:53.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T2: number;export function Foo() { }; + + +Info 111 [00:02:54.000] Running: /a/b/tsconfig.json +Info 112 [00:02:55.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 113 [00:02:56.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 4 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 114 [00:02:57.000] Project '/a/b/tsconfig.json' (Configured) +Info 115 [00:02:58.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-3 "export var T2: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-2 "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;export var T2: number;;;" + /a/b/file1Consumer1Consumer1.ts Text-1 "import {y} from \"./file1Consumer1\";" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 116 [00:02:59.000] ----------------------------------------------- +Info 117 [00:03:00.000] Running: *ensureProjectForOpenFiles* +Info 118 [00:03:01.000] Before ensureProjectForOpenFiles: +Info 119 [00:03:02.000] Project '/a/b/tsconfig.json' (Configured) +Info 119 [00:03:03.000] Files (7) + +Info 119 [00:03:04.000] ----------------------------------------------- +Info 119 [00:03:05.000] Open files: +Info 119 [00:03:06.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 119 [00:03:07.000] Projects: /a/b/tsconfig.json +Info 119 [00:03:08.000] After ensureProjectForOpenFiles: +Info 120 [00:03:09.000] Project '/a/b/tsconfig.json' (Configured) +Info 120 [00:03:10.000] Files (7) + +Info 120 [00:03:11.000] ----------------------------------------------- +Info 120 [00:03:12.000] Open files: +Info 120 [00:03:13.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 120 [00:03:14.000] Projects: /a/b/tsconfig.json +Info 120 [00:03:15.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-work-fine-for-files-with-circular-references.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-work-fine-for-files-with-circular-references.js new file mode 100644 index 00000000000..7ad0a2c4170 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-work-fine-for-files-with-circular-references.js @@ -0,0 +1,196 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1.ts] + + /// + export var t1 = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 17 [00:00:28.000] Files (1) + /a/b/file1.ts SVC-1-0 "\n /// \n export var t1 = 10;" + + + file1.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:29.000] ----------------------------------------------- +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":96,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}],"triggerFile":"/a/b/file1.ts"}} +Info 22 [00:00:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/b/tsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/file2.ts: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 23 [00:00:45.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 24 [00:00:46.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 25 [00:00:47.000] Scheduled: /a/b/tsconfig.json +Info 26 [00:00:48.000] Scheduled: *ensureProjectForOpenFiles* +Info 27 [00:00:49.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 28 [00:00:52.000] FileWatcher:: Triggered with /a/b/file2.ts 0:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 29 [00:00:53.000] FileWatcher:: Close:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 30 [00:00:54.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 31 [00:00:55.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 32 [00:00:56.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/file2.ts 0:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 33 [00:00:57.000] DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 34 [00:00:58.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 35 [00:00:59.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 36 [00:01:00.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/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; } + +//// [/a/b/file2.ts] + + /// + export var t2 = 10;export var t3 = 10; + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/file2.ts: + {"pollingInterval":500} +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 37 [00:01:05.000] Running: /a/b/tsconfig.json +Info 38 [00:01:06.000] FileWatcher:: Added:: WatchInfo: /a/b/file2.ts 500 undefined WatchType: Closed Script info +Info 39 [00:01:07.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 40 [00:01:08.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 41 [00:01:09.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 42 [00:01:10.000] Project '/a/b/tsconfig.json' (Configured) +Info 43 [00:01:11.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file2.ts Text-1 "\n /// \n export var t2 = 10;export var t3 = 10;" + /a/b/file1.ts SVC-1-0 "\n /// \n export var t1 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file2.ts + Referenced via './file2.ts' from file 'file1.ts' + Matched by default include pattern '**/*' + file1.ts + Matched by default include pattern '**/*' + Referenced via './file1.ts' from file 'file2.ts' + +Info 44 [00:01:12.000] ----------------------------------------------- +Info 45 [00:01:13.000] Running: *ensureProjectForOpenFiles* +Info 46 [00:01:14.000] Before ensureProjectForOpenFiles: +Info 47 [00:01:15.000] Project '/a/b/tsconfig.json' (Configured) +Info 47 [00:01:16.000] Files (3) + +Info 47 [00:01:17.000] ----------------------------------------------- +Info 47 [00:01:18.000] Open files: +Info 47 [00:01:19.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 47 [00:01:20.000] Projects: /a/b/tsconfig.json +Info 47 [00:01:21.000] After ensureProjectForOpenFiles: +Info 48 [00:01:22.000] Project '/a/b/tsconfig.json' (Configured) +Info 48 [00:01:23.000] Files (3) + +Info 48 [00:01:24.000] ----------------------------------------------- +Info 48 [00:01:25.000] Open files: +Info 48 [00:01:26.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 48 [00:01:27.000] Projects: /a/b/tsconfig.json +Info 48 [00:01:28.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when---out-is-set.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when---out-is-set.js new file mode 100644 index 00000000000..316ab6d5992 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when---out-is-set.js @@ -0,0 +1,203 @@ +Info 0 [00:00:13.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] +export let x = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{"out":"/a/out.js"}} + +//// [/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; } + + +Info 1 [00:00:14.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:15.000] Search path: /a +Info 3 [00:00:16.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:17.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:19.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:20.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/lib/lib.d.ts" + ], + "options": { + "out": "/a/out.js", + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:21.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:24.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 12 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:27.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:28.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:29.000] Files (2) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:30.000] ----------------------------------------------- +Info 18 [00:00:31.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/tsconfig.json"}} +Info 19 [00:00:32.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":16,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"out":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 20 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/tsconfig.json","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":26},"text":"Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '\"ignoreDeprecations\": \"5.0\"' to silence this error.\n Use 'outFile' instead.","code":5101,"category":"error","fileName":"/a/tsconfig.json"}],"triggerFile":"/a/a.ts"}} +Info 21 [00:00:34.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:35.000] Files (2) + +Info 21 [00:00:36.000] ----------------------------------------------- +Info 21 [00:00:37.000] Open files: +Info 21 [00:00:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:39.000] Projects: /a/tsconfig.json +Info 21 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Info 22 [00:00:43.000] DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:44.000] Scheduled: /a/tsconfig.json +Info 24 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b.ts] +export let y = 1 + + +Info 26 [00:00:47.000] Running: /a/tsconfig.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 29 [00:00:50.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:51.000] Project '/a/tsconfig.json' (Configured) +Info 31 [00:00:52.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-1 "export let y = 1" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:53.000] ----------------------------------------------- +Info 33 [00:00:54.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:55.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 35 [00:00:57.000] Files (3) + +Info 35 [00:00:58.000] ----------------------------------------------- +Info 35 [00:00:59.000] Open files: +Info 35 [00:01:00.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 35 [00:01:01.000] Projects: /a/tsconfig.json +Info 35 [00:01:02.000] After ensureProjectForOpenFiles: +Info 36 [00:01:03.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:01:04.000] Files (3) + +Info 36 [00:01:05.000] ----------------------------------------------- +Info 36 [00:01:06.000] Open files: +Info 36 [00:01:07.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 36 [00:01:08.000] Projects: /a/tsconfig.json +Info 36 [00:01:09.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Info 37 [00:01:13.000] FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 38 [00:01:14.000] Scheduled: /a/tsconfig.json +Info 39 [00:01:15.000] Scheduled: *ensureProjectForOpenFiles* +Info 40 [00:01:16.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b.ts] +export let x = 11 + + +Info 41 [00:01:17.000] Running: /a/tsconfig.json +Info 42 [00:01:18.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 43 [00:01:19.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 44 [00:01:20.000] Project '/a/tsconfig.json' (Configured) +Info 45 [00:01:21.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-2 "export let x = 11" + +Info 46 [00:01:22.000] ----------------------------------------------- +Info 47 [00:01:23.000] Running: *ensureProjectForOpenFiles* +Info 48 [00:01:24.000] Before ensureProjectForOpenFiles: +Info 49 [00:01:25.000] Project '/a/tsconfig.json' (Configured) +Info 49 [00:01:26.000] Files (3) + +Info 49 [00:01:27.000] ----------------------------------------------- +Info 49 [00:01:28.000] Open files: +Info 49 [00:01:29.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 49 [00:01:30.000] Projects: /a/tsconfig.json +Info 49 [00:01:31.000] After ensureProjectForOpenFiles: +Info 50 [00:01:32.000] Project '/a/tsconfig.json' (Configured) +Info 50 [00:01:33.000] Files (3) + +Info 50 [00:01:34.000] ----------------------------------------------- +Info 50 [00:01:35.000] Open files: +Info 50 [00:01:36.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 50 [00:01:37.000] Projects: /a/tsconfig.json +Info 50 [00:01:38.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when---outFile-is-set.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when---outFile-is-set.js new file mode 100644 index 00000000000..f67789d2684 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when---outFile-is-set.js @@ -0,0 +1,203 @@ +Info 0 [00:00:13.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] +export let x = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{"outFile":"/a/out.js"}} + +//// [/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; } + + +Info 1 [00:00:14.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:15.000] Search path: /a +Info 3 [00:00:16.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:17.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:19.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:20.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/lib/lib.d.ts" + ], + "options": { + "outFile": "/a/out.js", + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:21.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:24.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 12 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:27.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:28.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:29.000] Files (2) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:30.000] ----------------------------------------------- +Info 18 [00:00:31.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/tsconfig.json"}} +Info 19 [00:00:32.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":16,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"outFile":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 20 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/tsconfig.json","diagnostics":[],"triggerFile":"/a/a.ts"}} +Info 21 [00:00:34.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:35.000] Files (2) + +Info 21 [00:00:36.000] ----------------------------------------------- +Info 21 [00:00:37.000] Open files: +Info 21 [00:00:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:39.000] Projects: /a/tsconfig.json +Info 21 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Info 22 [00:00:43.000] DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:44.000] Scheduled: /a/tsconfig.json +Info 24 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b.ts] +export let y = 1 + + +Info 26 [00:00:47.000] Running: /a/tsconfig.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 29 [00:00:50.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:51.000] Project '/a/tsconfig.json' (Configured) +Info 31 [00:00:52.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-1 "export let y = 1" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:53.000] ----------------------------------------------- +Info 33 [00:00:54.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:55.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 35 [00:00:57.000] Files (3) + +Info 35 [00:00:58.000] ----------------------------------------------- +Info 35 [00:00:59.000] Open files: +Info 35 [00:01:00.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 35 [00:01:01.000] Projects: /a/tsconfig.json +Info 35 [00:01:02.000] After ensureProjectForOpenFiles: +Info 36 [00:01:03.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:01:04.000] Files (3) + +Info 36 [00:01:05.000] ----------------------------------------------- +Info 36 [00:01:06.000] Open files: +Info 36 [00:01:07.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 36 [00:01:08.000] Projects: /a/tsconfig.json +Info 36 [00:01:09.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Info 37 [00:01:13.000] FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 38 [00:01:14.000] Scheduled: /a/tsconfig.json +Info 39 [00:01:15.000] Scheduled: *ensureProjectForOpenFiles* +Info 40 [00:01:16.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b.ts] +export let x = 11 + + +Info 41 [00:01:17.000] Running: /a/tsconfig.json +Info 42 [00:01:18.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 43 [00:01:19.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 44 [00:01:20.000] Project '/a/tsconfig.json' (Configured) +Info 45 [00:01:21.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-2 "export let x = 11" + +Info 46 [00:01:22.000] ----------------------------------------------- +Info 47 [00:01:23.000] Running: *ensureProjectForOpenFiles* +Info 48 [00:01:24.000] Before ensureProjectForOpenFiles: +Info 49 [00:01:25.000] Project '/a/tsconfig.json' (Configured) +Info 49 [00:01:26.000] Files (3) + +Info 49 [00:01:27.000] ----------------------------------------------- +Info 49 [00:01:28.000] Open files: +Info 49 [00:01:29.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 49 [00:01:30.000] Projects: /a/tsconfig.json +Info 49 [00:01:31.000] After ensureProjectForOpenFiles: +Info 50 [00:01:32.000] Project '/a/tsconfig.json' (Configured) +Info 50 [00:01:33.000] Files (3) + +Info 50 [00:01:34.000] ----------------------------------------------- +Info 50 [00:01:35.000] Open files: +Info 50 [00:01:36.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 50 [00:01:37.000] Projects: /a/tsconfig.json +Info 50 [00:01:38.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when-adding-new-file.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when-adding-new-file.js new file mode 100644 index 00000000000..8429f0b8590 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when-adding-new-file.js @@ -0,0 +1,231 @@ +Info 0 [00:00:15.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1.ts] +export var x = 10; + +//// [/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; } + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:16.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:17.000] Search path: /a/b +Info 3 [00:00:18.000] For info: /a/b/file1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:19.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:20.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:21.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1.ts to open"}} +Info 7 [00:00:22.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:23.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:24.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:25.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 13 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 16 [00:00:31.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1.ts SVC-1-0 "export var x = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:32.000] ----------------------------------------------- +Info 18 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/b/tsconfig.json"}} +Info 19 [00:00:34.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 20 [00:00:35.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/b/tsconfig.json","diagnostics":[],"triggerFile":"/a/b/file1.ts"}} +Info 21 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 21 [00:00:37.000] Files (2) + +Info 21 [00:00:38.000] ----------------------------------------------- +Info 21 [00:00:39.000] Open files: +Info 21 [00:00:40.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 21 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 21 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 22 [00:00:45.000] DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:46.000] Scheduled: /a/b/tsconfig.json +Info 24 [00:00:47.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/file2.ts] +export var y = 10; + + +Info 26 [00:00:49.000] Running: /a/b/tsconfig.json +Info 27 [00:00:50.000] FileWatcher:: Added:: WatchInfo: /a/b/file2.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:51.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 29 [00:00:52.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 31 [00:00:54.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1.ts SVC-1-0 "export var x = 10;" + /a/b/file2.ts Text-1 "export var y = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + file2.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:55.000] ----------------------------------------------- +Info 33 [00:00:56.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:57.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:58.000] Project '/a/b/tsconfig.json' (Configured) +Info 35 [00:00:59.000] Files (3) + +Info 35 [00:01:00.000] ----------------------------------------------- +Info 35 [00:01:01.000] Open files: +Info 35 [00:01:02.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 35 [00:01:03.000] Projects: /a/b/tsconfig.json +Info 35 [00:01:04.000] After ensureProjectForOpenFiles: +Info 36 [00:01:05.000] Project '/a/b/tsconfig.json' (Configured) +Info 36 [00:01:06.000] Files (3) + +Info 36 [00:01:07.000] ----------------------------------------------- +Info 36 [00:01:08.000] Open files: +Info 36 [00:01:09.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 36 [00:01:10.000] Projects: /a/b/tsconfig.json +Info 36 [00:01:11.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b/file2.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 37 [00:01:14.000] DirectoryWatcher:: Triggered with /a/b/file3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 38 [00:01:15.000] Scheduled: /a/b/tsconfig.json +Info 39 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles* +Info 40 [00:01:17.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/file3.ts] +export var z = 10; + + +Info 41 [00:01:18.000] Running: /a/b/tsconfig.json +Info 42 [00:01:19.000] FileWatcher:: Added:: WatchInfo: /a/b/file3.ts 500 undefined WatchType: Closed Script info +Info 43 [00:01:20.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 44 [00:01:21.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 45 [00:01:22.000] Project '/a/b/tsconfig.json' (Configured) +Info 46 [00:01:23.000] Files (4) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1.ts SVC-1-0 "export var x = 10;" + /a/b/file2.ts Text-1 "export var y = 10;" + /a/b/file3.ts Text-1 "export var z = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + file2.ts + Matched by default include pattern '**/*' + file3.ts + Matched by default include pattern '**/*' + +Info 47 [00:01:24.000] ----------------------------------------------- +Info 48 [00:01:25.000] Running: *ensureProjectForOpenFiles* +Info 49 [00:01:26.000] Before ensureProjectForOpenFiles: +Info 50 [00:01:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 50 [00:01:28.000] Files (4) + +Info 50 [00:01:29.000] ----------------------------------------------- +Info 50 [00:01:30.000] Open files: +Info 50 [00:01:31.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 50 [00:01:32.000] Projects: /a/b/tsconfig.json +Info 50 [00:01:33.000] After ensureProjectForOpenFiles: +Info 51 [00:01:34.000] Project '/a/b/tsconfig.json' (Configured) +Info 51 [00:01:35.000] Files (4) + +Info 51 [00:01:36.000] ----------------------------------------------- +Info 51 [00:01:37.000] Open files: +Info 51 [00:01:38.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 51 [00:01:39.000] Projects: /a/b/tsconfig.json +Info 51 [00:01:40.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b/file2.ts: + {} +/a/b/file3.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when-both-options-are-not-set.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when-both-options-are-not-set.js new file mode 100644 index 00000000000..2f4097c9159 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-when-both-options-are-not-set.js @@ -0,0 +1,202 @@ +Info 0 [00:00:13.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] +export let x = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{}} + +//// [/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; } + + +Info 1 [00:00:14.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:15.000] Search path: /a +Info 3 [00:00:16.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:17.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:19.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingStart","body":{"project":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:20.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/lib/lib.d.ts" + ], + "options": { + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:21.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:24.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 12 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:27.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:28.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:29.000] Files (2) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:30.000] ----------------------------------------------- +Info 18 [00:00:31.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectLoadingFinish","body":{"project":"/a/tsconfig.json"}} +Info 19 [00:00:32.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectInfo","body":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":16,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}} +Info 20 [00:00:33.000] event: + {"seq":0,"type":"event","event":"CustomHandler::configFileDiag","body":{"configFileName":"/a/tsconfig.json","diagnostics":[],"triggerFile":"/a/a.ts"}} +Info 21 [00:00:34.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:35.000] Files (2) + +Info 21 [00:00:36.000] ----------------------------------------------- +Info 21 [00:00:37.000] Open files: +Info 21 [00:00:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:39.000] Projects: /a/tsconfig.json +Info 21 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Info 22 [00:00:43.000] DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:44.000] Scheduled: /a/tsconfig.json +Info 24 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b.ts] +export let y = 1 + + +Info 26 [00:00:47.000] Running: /a/tsconfig.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 29 [00:00:50.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:51.000] Project '/a/tsconfig.json' (Configured) +Info 31 [00:00:52.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-1 "export let y = 1" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:53.000] ----------------------------------------------- +Info 33 [00:00:54.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:55.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 35 [00:00:57.000] Files (3) + +Info 35 [00:00:58.000] ----------------------------------------------- +Info 35 [00:00:59.000] Open files: +Info 35 [00:01:00.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 35 [00:01:01.000] Projects: /a/tsconfig.json +Info 35 [00:01:02.000] After ensureProjectForOpenFiles: +Info 36 [00:01:03.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:01:04.000] Files (3) + +Info 36 [00:01:05.000] ----------------------------------------------- +Info 36 [00:01:06.000] Open files: +Info 36 [00:01:07.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 36 [00:01:08.000] Projects: /a/tsconfig.json +Info 36 [00:01:09.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Info 37 [00:01:13.000] FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 38 [00:01:14.000] Scheduled: /a/tsconfig.json +Info 39 [00:01:15.000] Scheduled: *ensureProjectForOpenFiles* +Info 40 [00:01:16.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b.ts] +export let x = 11 + + +Info 41 [00:01:17.000] Running: /a/tsconfig.json +Info 42 [00:01:18.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 43 [00:01:19.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 44 [00:01:20.000] Project '/a/tsconfig.json' (Configured) +Info 45 [00:01:21.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-2 "export let x = 11" + +Info 46 [00:01:22.000] ----------------------------------------------- +Info 47 [00:01:23.000] Running: *ensureProjectForOpenFiles* +Info 48 [00:01:24.000] Before ensureProjectForOpenFiles: +Info 49 [00:01:25.000] Project '/a/tsconfig.json' (Configured) +Info 49 [00:01:26.000] Files (3) + +Info 49 [00:01:27.000] ----------------------------------------------- +Info 49 [00:01:28.000] Open files: +Info 49 [00:01:29.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 49 [00:01:30.000] Projects: /a/tsconfig.json +Info 49 [00:01:31.000] After ensureProjectForOpenFiles: +Info 50 [00:01:32.000] Project '/a/tsconfig.json' (Configured) +Info 50 [00:01:33.000] Files (3) + +Info 50 [00:01:34.000] ----------------------------------------------- +Info 50 [00:01:35.000] Open files: +Info 50 [00:01:36.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 50 [00:01:37.000] Projects: /a/tsconfig.json +Info 50 [00:01:38.000] event: + {"seq":0,"type":"event","event":"CustomHandler::projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js similarity index 98% rename from tests/baselines/reference/tsserver/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js rename to tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js index 387356bedc5..a2ed1be9cb6 100644 --- a/tests/baselines/reference/tsserver/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js @@ -147,8 +147,6 @@ Info 37 [00:01:17.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/project/file1.ts"]}} After checking timeout queue length (2) and running -Checking timeout queue length: 0 - Before running timeout callbacks //// [/a/b/node_modules/file2.d.ts] export class a { } diff --git a/tests/baselines/reference/tsserver/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js similarity index 98% rename from tests/baselines/reference/tsserver/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js rename to tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js index 31f45390602..3c731bd7ba9 100644 --- a/tests/baselines/reference/tsserver/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js @@ -159,8 +159,6 @@ Info 43 [00:01:33.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/rootfolder/otherfolder/a/b/project/file1.ts"]}} After checking timeout queue length (2) and running -Checking timeout queue length: 0 - Info 44 [00:01:37.000] DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations Info 45 [00:01:38.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation Info 46 [00:01:39.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations @@ -280,5 +278,3 @@ FsWatchesRecursive:: {} /user/username/rootfolder/otherfolder/a/b/node_modules: {} - -Checking timeout queue length: 0 diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js new file mode 100644 index 00000000000..60cd8a5bcab --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js @@ -0,0 +1,269 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{"compilerOptions":{"isolatedModules":true}} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "isolatedModules": true, + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"isolatedModules":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 62 [00:01:36.000] Running: /a/b/tsconfig.json +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 68 [00:01:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:43.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 70 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 71 [00:01:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 72 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 73 [00:01:47.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 74 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:49.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 76 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Running: *ensureProjectForOpenFiles* +Info 78 [00:01:52.000] Before ensureProjectForOpenFiles: +Info 79 [00:01:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 79 [00:01:54.000] Files (6) + +Info 79 [00:01:55.000] ----------------------------------------------- +Info 79 [00:01:56.000] Open files: +Info 79 [00:01:57.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 79 [00:01:58.000] Projects: /a/b/tsconfig.json +Info 79 [00:01:59.000] After ensureProjectForOpenFiles: +Info 80 [00:02:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 80 [00:02:01.000] Files (6) + +Info 80 [00:02:02.000] ----------------------------------------------- +Info 80 [00:02:03.000] Open files: +Info 80 [00:02:04.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 80 [00:02:05.000] Projects: /a/b/tsconfig.json +Info 80 [00:02:06.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 81 [00:02:07.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js new file mode 100644 index 00000000000..d54a008e545 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js @@ -0,0 +1,258 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{"compilerOptions":{"module":"system","outFile":"/a/b/out.js"}} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "module": 4, + "outFile": "/a/b/out.js", + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 14 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 16 [00:00:27.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 17 [00:00:28.000] Project '/a/b/tsconfig.json' (Configured) +Info 18 [00:00:29.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 19 [00:00:30.000] ----------------------------------------------- +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"module":"system","outFile":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 23 [00:00:34.000] Project '/a/b/tsconfig.json' (Configured) +Info 23 [00:00:35.000] Files (1) + +Info 23 [00:00:36.000] ----------------------------------------------- +Info 23 [00:00:37.000] Open files: +Info 23 [00:00:38.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 23 [00:00:39.000] Projects: /a/b/tsconfig.json +Info 23 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 24 [00:00:44.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 25 [00:00:45.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 26 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 28 [00:00:48.000] Scheduled: /a/b/tsconfig.json +Info 29 [00:00:49.000] Scheduled: *ensureProjectForOpenFiles* +Info 30 [00:00:50.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 31 [00:00:53.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 32 [00:00:54.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 33 [00:00:55.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 35 [00:00:57.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 36 [00:00:58.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 37 [00:00:59.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 38 [00:01:02.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 39 [00:01:03.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 40 [00:01:04.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 42 [00:01:06.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 43 [00:01:07.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 44 [00:01:08.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 45 [00:01:11.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 46 [00:01:12.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 47 [00:01:13.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 49 [00:01:15.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 50 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 51 [00:01:17.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 52 [00:01:22.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 53 [00:01:23.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 54 [00:01:24.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 55 [00:01:25.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 56 [00:01:26.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 57 [00:01:28.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 58 [00:01:29.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 59 [00:01:30.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 60 [00:01:34.000] Running: /a/b/tsconfig.json +Info 61 [00:01:35.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 62 [00:01:36.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 68 [00:01:42.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 69 [00:01:43.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 70 [00:01:44.000] Project '/a/b/tsconfig.json' (Configured) +Info 71 [00:01:45.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 72 [00:01:46.000] ----------------------------------------------- +Info 73 [00:01:47.000] Running: *ensureProjectForOpenFiles* +Info 74 [00:01:48.000] Before ensureProjectForOpenFiles: +Info 75 [00:01:49.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:50.000] Files (6) + +Info 75 [00:01:51.000] ----------------------------------------------- +Info 75 [00:01:52.000] Open files: +Info 75 [00:01:53.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 75 [00:01:54.000] Projects: /a/b/tsconfig.json +Info 75 [00:01:55.000] After ensureProjectForOpenFiles: +Info 76 [00:01:56.000] Project '/a/b/tsconfig.json' (Configured) +Info 76 [00:01:57.000] Files (6) + +Info 76 [00:01:58.000] ----------------------------------------------- +Info 76 [00:01:59.000] Open files: +Info 76 [00:02:00.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 76 [00:02:01.000] Projects: /a/b/tsconfig.json +Info 76 [00:02:02.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 77 [00:02:03.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-deleted-files.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-deleted-files.js new file mode 100644 index 00000000000..30cb1d79be7 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-deleted-files.js @@ -0,0 +1,270 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Info 62 [00:01:37.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 63 [00:01:38.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 64 [00:01:39.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 65 [00:01:40.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 66 [00:01:41.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 67 [00:01:42.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 68 [00:01:43.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] deleted + +Info 69 [00:01:44.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 70 [00:01:45.000] Running: /a/b/tsconfig.json +Info 71 [00:01:46.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 72 [00:01:47.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 73 [00:01:48.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 74 [00:01:49.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 75 [00:01:50.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 76 [00:01:51.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 77 [00:01:52.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 78 [00:01:53.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 79 [00:01:54.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 80 [00:01:55.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 81 [00:01:56.000] Project '/a/b/tsconfig.json' (Configured) +Info 82 [00:01:57.000] Files (5) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 83 [00:01:58.000] ----------------------------------------------- +Info 84 [00:01:59.000] Running: *ensureProjectForOpenFiles* +Info 85 [00:02:00.000] Before ensureProjectForOpenFiles: +Info 86 [00:02:01.000] Project '/a/b/tsconfig.json' (Configured) +Info 86 [00:02:02.000] Files (5) + +Info 86 [00:02:03.000] ----------------------------------------------- +Info 86 [00:02:04.000] Open files: +Info 86 [00:02:05.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 86 [00:02:06.000] Projects: /a/b/tsconfig.json +Info 86 [00:02:07.000] After ensureProjectForOpenFiles: +Info 87 [00:02:08.000] Project '/a/b/tsconfig.json' (Configured) +Info 87 [00:02:09.000] Files (5) + +Info 87 [00:02:10.000] ----------------------------------------------- +Info 87 [00:02:11.000] Open files: +Info 87 [00:02:12.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 87 [00:02:13.000] Projects: /a/b/tsconfig.json +Info 87 [00:02:14.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 88 [00:02:15.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-newly-created-files.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-newly-created-files.js new file mode 100644 index 00000000000..cbe124b156c --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-newly-created-files.js @@ -0,0 +1,286 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Info 62 [00:01:38.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 63 [00:01:39.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 64 [00:01:40.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 65 [00:01:41.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 66 [00:01:42.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 67 [00:01:43.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 68 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer3.ts] +import {Foo} from "./moduleFile1"; let y = Foo(); + + +Info 69 [00:01:45.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 70 [00:01:46.000] Running: /a/b/tsconfig.json +Info 71 [00:01:47.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 72 [00:01:48.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer3.ts 500 undefined WatchType: Closed Script info +Info 73 [00:01:49.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 74 [00:01:50.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 75 [00:01:51.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 76 [00:01:52.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 77 [00:01:53.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 78 [00:01:54.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 79 [00:01:55.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 80 [00:01:56.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 81 [00:01:57.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 82 [00:01:58.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 83 [00:01:59.000] Project '/a/b/tsconfig.json' (Configured) +Info 84 [00:02:00.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/file1Consumer3.ts Text-1 "import {Foo} from \"./moduleFile1\"; let y = Foo();" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Imported via "./moduleFile1" from file 'file1Consumer3.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + file1Consumer3.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 85 [00:02:01.000] ----------------------------------------------- +Info 86 [00:02:02.000] Running: *ensureProjectForOpenFiles* +Info 87 [00:02:03.000] Before ensureProjectForOpenFiles: +Info 88 [00:02:04.000] Project '/a/b/tsconfig.json' (Configured) +Info 88 [00:02:05.000] Files (7) + +Info 88 [00:02:06.000] ----------------------------------------------- +Info 88 [00:02:07.000] Open files: +Info 88 [00:02:08.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 88 [00:02:09.000] Projects: /a/b/tsconfig.json +Info 88 [00:02:10.000] After ensureProjectForOpenFiles: +Info 89 [00:02:11.000] Project '/a/b/tsconfig.json' (Configured) +Info 89 [00:02:12.000] Files (7) + +Info 89 [00:02:13.000] ----------------------------------------------- +Info 89 [00:02:14.000] Open files: +Info 89 [00:02:15.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 89 [00:02:16.000] Projects: /a/b/tsconfig.json +Info 89 [00:02:17.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 90 [00:02:18.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/file1consumer3.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js new file mode 100644 index 00000000000..681bfe3816d --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js @@ -0,0 +1,492 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before request + +Info 62 [00:01:33.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "export let y = Foo();", + "endLine": 1, + "endOffset": 53, + "line": 1, + "offset": 1 + }, + "seq": 2, + "type": "request" + } +Info 63 [00:01:34.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +Info 64 [00:01:35.000] Running: /a/b/tsconfig.json +Info 65 [00:01:36.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 68 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:40.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 70 [00:01:41.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 71 [00:01:42.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 72 [00:01:43.000] Project '/a/b/tsconfig.json' (Configured) +Info 73 [00:01:44.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1Consumer1.ts SVC-1-1 "export let y = Foo();;" + /a/b/moduleFile1.ts Text-1 "export function Foo() { };" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1Consumer1.ts + Matched by default include pattern '**/*' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 74 [00:01:45.000] ----------------------------------------------- +Info 75 [00:01:46.000] Running: *ensureProjectForOpenFiles* +Info 76 [00:01:47.000] Before ensureProjectForOpenFiles: +Info 77 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 77 [00:01:49.000] Files (6) + +Info 77 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Open files: +Info 77 [00:01:52.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 77 [00:01:53.000] Projects: /a/b/tsconfig.json +Info 77 [00:01:54.000] After ensureProjectForOpenFiles: +Info 78 [00:01:55.000] Project '/a/b/tsconfig.json' (Configured) +Info 78 [00:01:56.000] Files (6) + +Info 78 [00:01:57.000] ----------------------------------------------- +Info 78 [00:01:58.000] Open files: +Info 78 [00:01:59.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 78 [00:02:00.000] Projects: /a/b/tsconfig.json +Info 78 [00:02:01.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 79 [00:02:02.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 80 [00:02:06.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 81 [00:02:07.000] Scheduled: /a/b/tsconfig.json +Info 82 [00:02:08.000] Scheduled: *ensureProjectForOpenFiles* +Info 83 [00:02:09.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 84 [00:02:10.000] Running: /a/b/tsconfig.json +Info 85 [00:02:11.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 86 [00:02:12.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 87 [00:02:13.000] Project '/a/b/tsconfig.json' (Configured) +Info 88 [00:02:14.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1Consumer1.ts SVC-1-1 "export let y = Foo();;" + /a/b/moduleFile1.ts Text-2 "export var T: number;export function Foo() { };" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 89 [00:02:15.000] ----------------------------------------------- +Info 90 [00:02:16.000] Running: *ensureProjectForOpenFiles* +Info 91 [00:02:17.000] Before ensureProjectForOpenFiles: +Info 92 [00:02:18.000] Project '/a/b/tsconfig.json' (Configured) +Info 92 [00:02:19.000] Files (6) + +Info 92 [00:02:20.000] ----------------------------------------------- +Info 92 [00:02:21.000] Open files: +Info 92 [00:02:22.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 92 [00:02:23.000] Projects: /a/b/tsconfig.json +Info 92 [00:02:24.000] After ensureProjectForOpenFiles: +Info 93 [00:02:25.000] Project '/a/b/tsconfig.json' (Configured) +Info 93 [00:02:26.000] Files (6) + +Info 93 [00:02:27.000] ----------------------------------------------- +Info 93 [00:02:28.000] Open files: +Info 93 [00:02:29.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 93 [00:02:30.000] Projects: /a/b/tsconfig.json +Info 93 [00:02:31.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 94 [00:02:32.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +Before request + +Info 95 [00:02:33.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "import {Foo} from \"./moduleFile1\";let y = Foo();", + "endLine": 1, + "endOffset": 21, + "line": 1, + "offset": 1 + }, + "seq": 3, + "type": "request" + } +Info 96 [00:02:34.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +After running timeout callbacks + +Info 97 [00:02:38.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 98 [00:02:39.000] Scheduled: /a/b/tsconfig.json +Info 99 [00:02:40.000] Scheduled: *ensureProjectForOpenFiles* +Info 100 [00:02:41.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export var T2: string;export function Foo() { }; + + +Info 101 [00:02:42.000] Running: /a/b/tsconfig.json +Info 102 [00:02:43.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 103 [00:02:44.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 104 [00:02:45.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 105 [00:02:46.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 106 [00:02:47.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 107 [00:02:48.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 108 [00:02:49.000] Project '/a/b/tsconfig.json' (Configured) +Info 109 [00:02:50.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-3 "export var T: number;export var T2: string;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-2 "import {Foo} from \"./moduleFile1\";let y = Foo();;;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 110 [00:02:51.000] ----------------------------------------------- +Info 111 [00:02:52.000] Running: *ensureProjectForOpenFiles* +Info 112 [00:02:53.000] Before ensureProjectForOpenFiles: +Info 113 [00:02:54.000] Project '/a/b/tsconfig.json' (Configured) +Info 113 [00:02:55.000] Files (6) + +Info 113 [00:02:56.000] ----------------------------------------------- +Info 113 [00:02:57.000] Open files: +Info 113 [00:02:58.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 113 [00:02:59.000] Projects: /a/b/tsconfig.json +Info 113 [00:03:00.000] After ensureProjectForOpenFiles: +Info 114 [00:03:01.000] Project '/a/b/tsconfig.json' (Configured) +Info 114 [00:03:02.000] Files (6) + +Info 114 [00:03:03.000] ----------------------------------------------- +Info 114 [00:03:04.000] Open files: +Info 114 [00:03:05.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 114 [00:03:06.000] Projects: /a/b/tsconfig.json +Info 114 [00:03:07.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 115 [00:03:08.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: + {} +/a/b/globalfile3.ts: + {} +/a/b/modulefile1.ts: + {} +/a/b/modulefile2.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Before request + +Info 116 [00:03:09.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "export let y = Foo();", + "endLine": 1, + "endOffset": 48, + "line": 1, + "offset": 1 + }, + "seq": 4, + "type": "request" + } +Info 117 [00:03:10.000] response: + { + "responseRequired": false + } +After request + +Info 118 [00:03:14.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 119 [00:03:15.000] Scheduled: /a/b/tsconfig.json +Info 120 [00:03:16.000] Scheduled: *ensureProjectForOpenFiles* +Info 121 [00:03:17.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 122 [00:03:18.000] Running: /a/b/tsconfig.json +Info 123 [00:03:19.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 124 [00:03:20.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 5 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 125 [00:03:21.000] Project '/a/b/tsconfig.json' (Configured) +Info 126 [00:03:22.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1Consumer1.ts SVC-1-3 "export let y = Foo();;;;" + /a/b/moduleFile1.ts Text-4 "export var T: number;export function Foo() { };" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 127 [00:03:23.000] ----------------------------------------------- +Info 128 [00:03:24.000] Running: *ensureProjectForOpenFiles* +Info 129 [00:03:25.000] Before ensureProjectForOpenFiles: +Info 130 [00:03:26.000] Project '/a/b/tsconfig.json' (Configured) +Info 130 [00:03:27.000] Files (6) + +Info 130 [00:03:28.000] ----------------------------------------------- +Info 130 [00:03:29.000] Open files: +Info 130 [00:03:30.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 130 [00:03:31.000] Projects: /a/b/tsconfig.json +Info 130 [00:03:32.000] After ensureProjectForOpenFiles: +Info 131 [00:03:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 131 [00:03:34.000] Files (6) + +Info 131 [00:03:35.000] ----------------------------------------------- +Info 131 [00:03:36.000] Open files: +Info 131 [00:03:37.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 131 [00:03:38.000] Projects: /a/b/tsconfig.json +Info 131 [00:03:39.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 132 [00:03:40.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-contains-only-itself.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-contains-only-itself.js new file mode 100644 index 00000000000..bc68cbc7eba --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-contains-only-itself.js @@ -0,0 +1,312 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 62 [00:01:36.000] Running: /a/b/tsconfig.json +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 68 [00:01:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:43.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 70 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 71 [00:01:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 72 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 73 [00:01:47.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 74 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:49.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 76 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Running: *ensureProjectForOpenFiles* +Info 78 [00:01:52.000] Before ensureProjectForOpenFiles: +Info 79 [00:01:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 79 [00:01:54.000] Files (6) + +Info 79 [00:01:55.000] ----------------------------------------------- +Info 79 [00:01:56.000] Open files: +Info 79 [00:01:57.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 79 [00:01:58.000] Projects: /a/b/tsconfig.json +Info 79 [00:01:59.000] After ensureProjectForOpenFiles: +Info 80 [00:02:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 80 [00:02:01.000] Files (6) + +Info 80 [00:02:02.000] ----------------------------------------------- +Info 80 [00:02:03.000] Open files: +Info 80 [00:02:04.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 80 [00:02:05.000] Projects: /a/b/tsconfig.json +Info 80 [00:02:06.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 81 [00:02:07.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 82 [00:02:11.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 83 [00:02:12.000] Scheduled: /a/b/tsconfig.json +Info 84 [00:02:13.000] Scheduled: *ensureProjectForOpenFiles* +Info 85 [00:02:14.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { console.log('hi'); }; + + +Info 86 [00:02:15.000] Running: /a/b/tsconfig.json +Info 87 [00:02:16.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 88 [00:02:17.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 89 [00:02:18.000] Project '/a/b/tsconfig.json' (Configured) +Info 90 [00:02:19.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-2 "export var T: number;export function Foo() { console.log('hi'); };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 91 [00:02:20.000] ----------------------------------------------- +Info 92 [00:02:21.000] Running: *ensureProjectForOpenFiles* +Info 93 [00:02:22.000] Before ensureProjectForOpenFiles: +Info 94 [00:02:23.000] Project '/a/b/tsconfig.json' (Configured) +Info 94 [00:02:24.000] Files (6) + +Info 94 [00:02:25.000] ----------------------------------------------- +Info 94 [00:02:26.000] Open files: +Info 94 [00:02:27.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 94 [00:02:28.000] Projects: /a/b/tsconfig.json +Info 94 [00:02:29.000] After ensureProjectForOpenFiles: +Info 95 [00:02:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 95 [00:02:31.000] Files (6) + +Info 95 [00:02:32.000] ----------------------------------------------- +Info 95 [00:02:33.000] Open files: +Info 95 [00:02:34.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 95 [00:02:35.000] Projects: /a/b/tsconfig.json +Info 95 [00:02:36.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 96 [00:02:37.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-changes-in-non-root-files.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-changes-in-non-root-files.js new file mode 100644 index 00000000000..2f24b60be73 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-changes-in-non-root-files.js @@ -0,0 +1,259 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{"files":["/a/b/file1Consumer1.ts"]} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 9 [00:00:20.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 10 [00:00:21.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 14 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 16 [00:00:27.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 17 [00:00:28.000] Project '/a/b/tsconfig.json' (Configured) +Info 18 [00:00:29.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Part of 'files' list in tsconfig.json + +Info 19 [00:00:30.000] ----------------------------------------------- +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":true,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 23 [00:00:34.000] Project '/a/b/tsconfig.json' (Configured) +Info 23 [00:00:35.000] Files (1) + +Info 23 [00:00:36.000] ----------------------------------------------- +Info 23 [00:00:37.000] Open files: +Info 23 [00:00:38.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 23 [00:00:39.000] Projects: /a/b/tsconfig.json +Info 23 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +Info 24 [00:00:44.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 25 [00:00:45.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 26 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 28 [00:00:50.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 29 [00:00:51.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 30 [00:00:54.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 31 [00:00:55.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 32 [00:00:56.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 33 [00:00:59.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:01:00.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:01:06.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 37 [00:01:07.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 38 [00:01:08.000] Scheduled: /a/b/tsconfig.json +Info 39 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles* +Info 40 [00:01:10.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +Info 41 [00:01:12.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 42 [00:01:13.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 43 [00:01:14.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 44 [00:01:18.000] Running: /a/b/tsconfig.json +Info 45 [00:01:19.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 46 [00:01:20.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 47 [00:01:21.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 48 [00:01:22.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 49 [00:01:23.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:24.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 51 [00:01:25.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 52 [00:01:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 53 [00:01:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 54 [00:01:28.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + file1Consumer1.ts + Part of 'files' list in tsconfig.json + +Info 55 [00:01:29.000] ----------------------------------------------- +Info 56 [00:01:30.000] Running: *ensureProjectForOpenFiles* +Info 57 [00:01:31.000] Before ensureProjectForOpenFiles: +Info 58 [00:01:32.000] Project '/a/b/tsconfig.json' (Configured) +Info 58 [00:01:33.000] Files (3) + +Info 58 [00:01:34.000] ----------------------------------------------- +Info 58 [00:01:35.000] Open files: +Info 58 [00:01:36.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 58 [00:01:37.000] Projects: /a/b/tsconfig.json +Info 58 [00:01:38.000] After ensureProjectForOpenFiles: +Info 59 [00:01:39.000] Project '/a/b/tsconfig.json' (Configured) +Info 59 [00:01:40.000] Files (3) + +Info 59 [00:01:41.000] ----------------------------------------------- +Info 59 [00:01:42.000] Open files: +Info 59 [00:01:43.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 59 [00:01:44.000] Projects: /a/b/tsconfig.json +Info 59 [00:01:45.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 60 [00:01:46.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/modulefile1.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +Info 61 [00:01:50.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 62 [00:01:51.000] Scheduled: /a/b/tsconfig.json +Info 63 [00:01:52.000] Scheduled: *ensureProjectForOpenFiles* +Info 64 [00:01:53.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { };var T1: number; + + +Info 65 [00:01:54.000] Running: /a/b/tsconfig.json +Info 66 [00:01:55.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 67 [00:01:56.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 68 [00:01:57.000] Project '/a/b/tsconfig.json' (Configured) +Info 69 [00:01:58.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-2 "export function Foo() { };var T1: number;" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + +Info 70 [00:01:59.000] ----------------------------------------------- +Info 71 [00:02:00.000] Running: *ensureProjectForOpenFiles* +Info 72 [00:02:01.000] Before ensureProjectForOpenFiles: +Info 73 [00:02:02.000] Project '/a/b/tsconfig.json' (Configured) +Info 73 [00:02:03.000] Files (3) + +Info 73 [00:02:04.000] ----------------------------------------------- +Info 73 [00:02:05.000] Open files: +Info 73 [00:02:06.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 73 [00:02:07.000] Projects: /a/b/tsconfig.json +Info 73 [00:02:08.000] After ensureProjectForOpenFiles: +Info 74 [00:02:09.000] Project '/a/b/tsconfig.json' (Configured) +Info 74 [00:02:10.000] Files (3) + +Info 74 [00:02:11.000] ----------------------------------------------- +Info 74 [00:02:12.000] Open files: +Info 74 [00:02:13.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 74 [00:02:14.000] Projects: /a/b/tsconfig.json +Info 74 [00:02:15.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 75 [00:02:16.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-non-existing-code-file.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-non-existing-code-file.js new file mode 100644 index 00000000000..67be5222095 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-non-existing-code-file.js @@ -0,0 +1,289 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/referenceFile1.ts] + + /// + export var x = Foo(); + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/referenceFile1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/referenceFile1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/referenceFile1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/referenceFile1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 17 [00:00:28.000] Files (1) + /a/b/referenceFile1.ts SVC-1-0 "\n /// \n export var x = Foo();" + + + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:29.000] ----------------------------------------------- +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":104,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/referenceFile1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 22 [00:00:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/b/tsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile2.ts: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 23 [00:00:45.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 24 [00:00:46.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 25 [00:00:47.000] Scheduled: /a/b/tsconfig.json +Info 26 [00:00:48.000] Scheduled: *ensureProjectForOpenFiles* +Info 27 [00:00:49.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +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; } + + +PolledWatches:: +/a/b/modulefile2.ts: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 28 [00:00:51.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/referenceFile1.ts", + "insertString": "\n /// \n export var x = Foo();export var yy = Foo();", + "endLine": 1, + "endOffset": 104, + "line": 1, + "offset": 1 + }, + "seq": 2, + "type": "request" + } +Info 29 [00:00:52.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +Info 30 [00:00:53.000] Running: /a/b/tsconfig.json +Info 31 [00:00:54.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 32 [00:00:55.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 33 [00:00:56.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 34 [00:00:57.000] Project '/a/b/tsconfig.json' (Configured) +Info 35 [00:00:58.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/referenceFile1.ts SVC-1-1 "\n /// \n export var x = Foo();export var yy = Foo();;" + + + ../lib/lib.d.ts + Default library for target 'es5' + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 36 [00:00:59.000] ----------------------------------------------- +Info 37 [00:01:00.000] Running: *ensureProjectForOpenFiles* +Info 38 [00:01:01.000] Before ensureProjectForOpenFiles: +Info 39 [00:01:02.000] Project '/a/b/tsconfig.json' (Configured) +Info 39 [00:01:03.000] Files (2) + +Info 39 [00:01:04.000] ----------------------------------------------- +Info 39 [00:01:05.000] Open files: +Info 39 [00:01:06.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 39 [00:01:07.000] Projects: /a/b/tsconfig.json +Info 39 [00:01:08.000] After ensureProjectForOpenFiles: +Info 40 [00:01:09.000] Project '/a/b/tsconfig.json' (Configured) +Info 40 [00:01:10.000] Files (2) + +Info 40 [00:01:11.000] ----------------------------------------------- +Info 40 [00:01:12.000] Open files: +Info 40 [00:01:13.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 40 [00:01:14.000] Projects: /a/b/tsconfig.json +Info 40 [00:01:15.000] got projects updated in background, updating diagnostics for /a/b/referenceFile1.ts +Info 41 [00:01:16.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/referenceFile1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/modulefile2.ts: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 42 [00:01:19.000] FileWatcher:: Triggered with /a/b/modulefile2.ts 0:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 43 [00:01:20.000] FileWatcher:: Close:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 44 [00:01:21.000] Scheduled: /a/b/tsconfig.json +Info 45 [00:01:22.000] Scheduled: *ensureProjectForOpenFiles* +Info 46 [00:01:23.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/modulefile2.ts 0:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 47 [00:01:24.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 48 [00:01:25.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 49 [00:01:26.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 50 [00:01:27.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile2.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 51 [00:01:28.000] Running: /a/b/tsconfig.json +Info 52 [00:01:29.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile2.ts 500 undefined WatchType: Closed Script info +Info 53 [00:01:30.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 54 [00:01:31.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 55 [00:01:32.000] Project '/a/b/tsconfig.json' (Configured) +Info 56 [00:01:33.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + /a/b/referenceFile1.ts SVC-1-1 "\n /// \n export var x = Foo();export var yy = Foo();;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile2.ts + Referenced via './moduleFile2.ts' from file 'referenceFile1.ts' + Matched by default include pattern '**/*' + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 57 [00:01:34.000] ----------------------------------------------- +Info 58 [00:01:35.000] Running: *ensureProjectForOpenFiles* +Info 59 [00:01:36.000] Before ensureProjectForOpenFiles: +Info 60 [00:01:37.000] Project '/a/b/tsconfig.json' (Configured) +Info 60 [00:01:38.000] Files (3) + +Info 60 [00:01:39.000] ----------------------------------------------- +Info 60 [00:01:40.000] Open files: +Info 60 [00:01:41.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 60 [00:01:42.000] Projects: /a/b/tsconfig.json +Info 60 [00:01:43.000] After ensureProjectForOpenFiles: +Info 61 [00:01:44.000] Project '/a/b/tsconfig.json' (Configured) +Info 61 [00:01:45.000] Files (3) + +Info 61 [00:01:46.000] ----------------------------------------------- +Info 61 [00:01:47.000] Open files: +Info 61 [00:01:48.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 61 [00:01:49.000] Projects: /a/b/tsconfig.json +Info 61 [00:01:50.000] got projects updated in background, updating diagnostics for /a/b/referenceFile1.ts +Info 62 [00:01:51.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/referenceFile1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b/modulefile2.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-removed-code-file.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-removed-code-file.js new file mode 100644 index 00000000000..7f319b42b3b --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-detect-removed-code-file.js @@ -0,0 +1,191 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/referenceFile1.ts] + + /// + export var x = Foo(); + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/referenceFile1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/referenceFile1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/referenceFile1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/referenceFile1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 17 [00:00:28.000] Files (1) + /a/b/referenceFile1.ts SVC-1-0 "\n /// \n export var x = Foo();" + + + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:29.000] ----------------------------------------------- +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":104,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/referenceFile1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 22 [00:00:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/b/tsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1.ts: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 23 [00:00:45.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 24 [00:00:46.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 25 [00:00:47.000] Scheduled: /a/b/tsconfig.json +Info 26 [00:00:48.000] Scheduled: *ensureProjectForOpenFiles* +Info 27 [00:00:49.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 28 [00:00:52.000] FileWatcher:: Triggered with /a/b/modulefile1.ts 0:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 29 [00:00:53.000] FileWatcher:: Close:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 30 [00:00:54.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 31 [00:00:55.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 32 [00:00:56.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/modulefile1.ts 0:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 33 [00:00:57.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 34 [00:00:58.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 35 [00:00:59.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 36 [00:01:00.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:01:03.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 38 [00:01:04.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 39 [00:01:05.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 40 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/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; } + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1.ts: + {"pollingInterval":500} +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 41 [00:01:07.000] Running: /a/b/tsconfig.json +Info 42 [00:01:08.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 43 [00:01:09.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 44 [00:01:10.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 45 [00:01:11.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 46 [00:01:12.000] Project '/a/b/tsconfig.json' (Configured) +Info 47 [00:01:13.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/referenceFile1.ts SVC-1-0 "\n /// \n export var x = Foo();" + + + ../lib/lib.d.ts + Default library for target 'es5' + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 48 [00:01:14.000] ----------------------------------------------- +Info 49 [00:01:15.000] Running: *ensureProjectForOpenFiles* +Info 50 [00:01:16.000] Before ensureProjectForOpenFiles: +Info 51 [00:01:17.000] Project '/a/b/tsconfig.json' (Configured) +Info 51 [00:01:18.000] Files (2) + +Info 51 [00:01:19.000] ----------------------------------------------- +Info 51 [00:01:20.000] Open files: +Info 51 [00:01:21.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 51 [00:01:22.000] Projects: /a/b/tsconfig.json +Info 51 [00:01:23.000] After ensureProjectForOpenFiles: +Info 52 [00:01:24.000] Project '/a/b/tsconfig.json' (Configured) +Info 52 [00:01:25.000] Files (2) + +Info 52 [00:01:26.000] ----------------------------------------------- +Info 52 [00:01:27.000] Open files: +Info 52 [00:01:28.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 52 [00:01:29.000] Projects: /a/b/tsconfig.json +Info 52 [00:01:30.000] got projects updated in background, updating diagnostics for /a/b/referenceFile1.ts +Info 53 [00:01:31.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/referenceFile1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} +/a/b/modulefile1.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-return-all-files-if-a-global-file-changed-shape.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-return-all-files-if-a-global-file-changed-shape.js new file mode 100644 index 00000000000..150b2c9cad9 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-return-all-files-if-a-global-file-changed-shape.js @@ -0,0 +1,268 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number }var T2: string; + + +Info 62 [00:01:36.000] Running: /a/b/tsconfig.json +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 68 [00:01:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:43.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 70 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 71 [00:01:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 72 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 73 [00:01:47.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 74 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:49.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }var T2: string;" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 76 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Running: *ensureProjectForOpenFiles* +Info 78 [00:01:52.000] Before ensureProjectForOpenFiles: +Info 79 [00:01:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 79 [00:01:54.000] Files (6) + +Info 79 [00:01:55.000] ----------------------------------------------- +Info 79 [00:01:56.000] Open files: +Info 79 [00:01:57.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 79 [00:01:58.000] Projects: /a/b/tsconfig.json +Info 79 [00:01:59.000] After ensureProjectForOpenFiles: +Info 80 [00:02:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 80 [00:02:01.000] Files (6) + +Info 80 [00:02:02.000] ----------------------------------------------- +Info 80 [00:02:03.000] Open files: +Info 80 [00:02:04.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 80 [00:02:05.000] Projects: /a/b/tsconfig.json +Info 80 [00:02:06.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 81 [00:02:07.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-return-cascaded-affected-file-list.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-return-cascaded-affected-file-list.js new file mode 100644 index 00000000000..6641823052b --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-return-cascaded-affected-file-list.js @@ -0,0 +1,416 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:22.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 55 [00:01:23.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 56 [00:01:24.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 57 [00:01:25.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 58 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 59 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 60 [00:01:28.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 61 [00:01:33.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 62 [00:01:34.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 63 [00:01:35.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 64 [00:01:36.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 65 [00:01:37.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/file1Consumer1Consumer1.ts] +import {y} from "./file1Consumer1"; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 66 [00:01:39.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 67 [00:01:40.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 68 [00:01:41.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before request + +Info 69 [00:01:42.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;", + "endLine": 1, + "endOffset": 53, + "line": 1, + "offset": 1 + }, + "seq": 2, + "type": "request" + } +Info 70 [00:01:43.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +Info 71 [00:01:44.000] Running: /a/b/tsconfig.json +Info 72 [00:01:45.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer1Consumer1.ts 500 undefined WatchType: Closed Script info +Info 73 [00:01:46.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 74 [00:01:47.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 75 [00:01:48.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 76 [00:01:49.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 77 [00:01:50.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 78 [00:01:51.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 79 [00:01:52.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 80 [00:01:53.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 81 [00:01:54.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 82 [00:01:55.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 83 [00:01:56.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 84 [00:01:57.000] Project '/a/b/tsconfig.json' (Configured) +Info 85 [00:01:58.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-1 "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;;" + /a/b/file1Consumer1Consumer1.ts Text-1 "import {y} from \"./file1Consumer1\";" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + Imported via "./file1Consumer1" from file 'file1Consumer1Consumer1.ts' + file1Consumer1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 86 [00:01:59.000] ----------------------------------------------- +Info 87 [00:02:00.000] Running: *ensureProjectForOpenFiles* +Info 88 [00:02:01.000] Before ensureProjectForOpenFiles: +Info 89 [00:02:02.000] Project '/a/b/tsconfig.json' (Configured) +Info 89 [00:02:03.000] Files (7) + +Info 89 [00:02:04.000] ----------------------------------------------- +Info 89 [00:02:05.000] Open files: +Info 89 [00:02:06.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 89 [00:02:07.000] Projects: /a/b/tsconfig.json +Info 89 [00:02:08.000] After ensureProjectForOpenFiles: +Info 90 [00:02:09.000] Project '/a/b/tsconfig.json' (Configured) +Info 90 [00:02:10.000] Files (7) + +Info 90 [00:02:11.000] ----------------------------------------------- +Info 90 [00:02:12.000] Open files: +Info 90 [00:02:13.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 90 [00:02:14.000] Projects: /a/b/tsconfig.json +Info 90 [00:02:15.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 91 [00:02:16.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer1consumer1.ts: *new* + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 92 [00:02:20.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 93 [00:02:21.000] Scheduled: /a/b/tsconfig.json +Info 94 [00:02:22.000] Scheduled: *ensureProjectForOpenFiles* +Info 95 [00:02:23.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 96 [00:02:24.000] Running: /a/b/tsconfig.json +Info 97 [00:02:25.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 98 [00:02:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 99 [00:02:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 100 [00:02:28.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-2 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-1 "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;;" + /a/b/file1Consumer1Consumer1.ts Text-1 "import {y} from \"./file1Consumer1\";" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 101 [00:02:29.000] ----------------------------------------------- +Info 102 [00:02:30.000] Running: *ensureProjectForOpenFiles* +Info 103 [00:02:31.000] Before ensureProjectForOpenFiles: +Info 104 [00:02:32.000] Project '/a/b/tsconfig.json' (Configured) +Info 104 [00:02:33.000] Files (7) + +Info 104 [00:02:34.000] ----------------------------------------------- +Info 104 [00:02:35.000] Open files: +Info 104 [00:02:36.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 104 [00:02:37.000] Projects: /a/b/tsconfig.json +Info 104 [00:02:38.000] After ensureProjectForOpenFiles: +Info 105 [00:02:39.000] Project '/a/b/tsconfig.json' (Configured) +Info 105 [00:02:40.000] Files (7) + +Info 105 [00:02:41.000] ----------------------------------------------- +Info 105 [00:02:42.000] Open files: +Info 105 [00:02:43.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 105 [00:02:44.000] Projects: /a/b/tsconfig.json +Info 105 [00:02:45.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 106 [00:02:46.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +Before request + +Info 107 [00:02:47.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;export var T2: number;", + "endLine": 1, + "endOffset": 74, + "line": 1, + "offset": 1 + }, + "seq": 3, + "type": "request" + } +Info 108 [00:02:48.000] response: + { + "responseRequired": false + } +After request + +Info 109 [00:02:52.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 110 [00:02:53.000] Scheduled: /a/b/tsconfig.json +Info 111 [00:02:54.000] Scheduled: *ensureProjectForOpenFiles* +Info 112 [00:02:55.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T2: number;export function Foo() { }; + + +Info 113 [00:02:56.000] Running: /a/b/tsconfig.json +Info 114 [00:02:57.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 115 [00:02:58.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 4 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 116 [00:02:59.000] Project '/a/b/tsconfig.json' (Configured) +Info 117 [00:03:00.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-3 "export var T2: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-2 "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;export var T2: number;;;" + /a/b/file1Consumer1Consumer1.ts Text-1 "import {y} from \"./file1Consumer1\";" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 118 [00:03:01.000] ----------------------------------------------- +Info 119 [00:03:02.000] Running: *ensureProjectForOpenFiles* +Info 120 [00:03:03.000] Before ensureProjectForOpenFiles: +Info 121 [00:03:04.000] Project '/a/b/tsconfig.json' (Configured) +Info 121 [00:03:05.000] Files (7) + +Info 121 [00:03:06.000] ----------------------------------------------- +Info 121 [00:03:07.000] Open files: +Info 121 [00:03:08.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 121 [00:03:09.000] Projects: /a/b/tsconfig.json +Info 121 [00:03:10.000] After ensureProjectForOpenFiles: +Info 122 [00:03:11.000] Project '/a/b/tsconfig.json' (Configured) +Info 122 [00:03:12.000] Files (7) + +Info 122 [00:03:13.000] ----------------------------------------------- +Info 122 [00:03:14.000] Open files: +Info 122 [00:03:15.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 122 [00:03:16.000] Projects: /a/b/tsconfig.json +Info 122 [00:03:17.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 123 [00:03:18.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-work-fine-for-files-with-circular-references.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-work-fine-for-files-with-circular-references.js new file mode 100644 index 00000000000..3d2489665a7 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-work-fine-for-files-with-circular-references.js @@ -0,0 +1,197 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1.ts] + + /// + export var t1 = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 17 [00:00:28.000] Files (1) + /a/b/file1.ts SVC-1-0 "\n /// \n export var t1 = 10;" + + + file1.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:29.000] ----------------------------------------------- +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":96,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 22 [00:00:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/b/tsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/file2.ts: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 23 [00:00:45.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 24 [00:00:46.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 25 [00:00:47.000] Scheduled: /a/b/tsconfig.json +Info 26 [00:00:48.000] Scheduled: *ensureProjectForOpenFiles* +Info 27 [00:00:49.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 28 [00:00:52.000] FileWatcher:: Triggered with /a/b/file2.ts 0:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 29 [00:00:53.000] FileWatcher:: Close:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 30 [00:00:54.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 31 [00:00:55.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 32 [00:00:56.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/file2.ts 0:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 33 [00:00:57.000] DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 34 [00:00:58.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 35 [00:00:59.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 36 [00:01:00.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/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; } + +//// [/a/b/file2.ts] + + /// + export var t2 = 10;export var t3 = 10; + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/file2.ts: + {"pollingInterval":500} +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 37 [00:01:05.000] Running: /a/b/tsconfig.json +Info 38 [00:01:06.000] FileWatcher:: Added:: WatchInfo: /a/b/file2.ts 500 undefined WatchType: Closed Script info +Info 39 [00:01:07.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 40 [00:01:08.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 41 [00:01:09.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 42 [00:01:10.000] Project '/a/b/tsconfig.json' (Configured) +Info 43 [00:01:11.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file2.ts Text-1 "\n /// \n export var t2 = 10;export var t3 = 10;" + /a/b/file1.ts SVC-1-0 "\n /// \n export var t1 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file2.ts + Referenced via './file2.ts' from file 'file1.ts' + Matched by default include pattern '**/*' + file1.ts + Matched by default include pattern '**/*' + Referenced via './file1.ts' from file 'file2.ts' + +Info 44 [00:01:12.000] ----------------------------------------------- +Info 45 [00:01:13.000] Running: *ensureProjectForOpenFiles* +Info 46 [00:01:14.000] Before ensureProjectForOpenFiles: +Info 47 [00:01:15.000] Project '/a/b/tsconfig.json' (Configured) +Info 47 [00:01:16.000] Files (3) + +Info 47 [00:01:17.000] ----------------------------------------------- +Info 47 [00:01:18.000] Open files: +Info 47 [00:01:19.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 47 [00:01:20.000] Projects: /a/b/tsconfig.json +Info 47 [00:01:21.000] After ensureProjectForOpenFiles: +Info 48 [00:01:22.000] Project '/a/b/tsconfig.json' (Configured) +Info 48 [00:01:23.000] Files (3) + +Info 48 [00:01:24.000] ----------------------------------------------- +Info 48 [00:01:25.000] Open files: +Info 48 [00:01:26.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 48 [00:01:27.000] Projects: /a/b/tsconfig.json +Info 48 [00:01:28.000] got projects updated in background, updating diagnostics for /a/b/file1.ts +Info 49 [00:01:29.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when---out-is-set.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when---out-is-set.js new file mode 100644 index 00000000000..1ef7d6d97c9 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when---out-is-set.js @@ -0,0 +1,205 @@ +Info 0 [00:00:13.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] +export let x = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{"out":"/a/out.js"}} + +//// [/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; } + + +Info 1 [00:00:14.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:15.000] Search path: /a +Info 3 [00:00:16.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:17.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:19.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:20.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/lib/lib.d.ts" + ], + "options": { + "out": "/a/out.js", + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:21.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:24.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 12 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:27.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:28.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:29.000] Files (2) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:30.000] ----------------------------------------------- +Info 18 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/tsconfig.json"}} +Info 19 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":16,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"out":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/a.ts","configFile":"/a/tsconfig.json","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":26},"text":"Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '\"ignoreDeprecations\": \"5.0\"' to silence this error.\n Use 'outFile' instead.","code":5101,"category":"error","fileName":"/a/tsconfig.json"}]}} +Info 21 [00:00:34.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:35.000] Files (2) + +Info 21 [00:00:36.000] ----------------------------------------------- +Info 21 [00:00:37.000] Open files: +Info 21 [00:00:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:39.000] Projects: /a/tsconfig.json +Info 21 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Info 22 [00:00:43.000] DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:44.000] Scheduled: /a/tsconfig.json +Info 24 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b.ts] +export let y = 1 + + +Info 26 [00:00:47.000] Running: /a/tsconfig.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 29 [00:00:50.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:51.000] Project '/a/tsconfig.json' (Configured) +Info 31 [00:00:52.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-1 "export let y = 1" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:53.000] ----------------------------------------------- +Info 33 [00:00:54.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:55.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 35 [00:00:57.000] Files (3) + +Info 35 [00:00:58.000] ----------------------------------------------- +Info 35 [00:00:59.000] Open files: +Info 35 [00:01:00.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 35 [00:01:01.000] Projects: /a/tsconfig.json +Info 35 [00:01:02.000] After ensureProjectForOpenFiles: +Info 36 [00:01:03.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:01:04.000] Files (3) + +Info 36 [00:01:05.000] ----------------------------------------------- +Info 36 [00:01:06.000] Open files: +Info 36 [00:01:07.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 36 [00:01:08.000] Projects: /a/tsconfig.json +Info 36 [00:01:09.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 37 [00:01:10.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Info 38 [00:01:14.000] FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 39 [00:01:15.000] Scheduled: /a/tsconfig.json +Info 40 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles* +Info 41 [00:01:17.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b.ts] +export let x = 11 + + +Info 42 [00:01:18.000] Running: /a/tsconfig.json +Info 43 [00:01:19.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 44 [00:01:20.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 45 [00:01:21.000] Project '/a/tsconfig.json' (Configured) +Info 46 [00:01:22.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-2 "export let x = 11" + +Info 47 [00:01:23.000] ----------------------------------------------- +Info 48 [00:01:24.000] Running: *ensureProjectForOpenFiles* +Info 49 [00:01:25.000] Before ensureProjectForOpenFiles: +Info 50 [00:01:26.000] Project '/a/tsconfig.json' (Configured) +Info 50 [00:01:27.000] Files (3) + +Info 50 [00:01:28.000] ----------------------------------------------- +Info 50 [00:01:29.000] Open files: +Info 50 [00:01:30.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 50 [00:01:31.000] Projects: /a/tsconfig.json +Info 50 [00:01:32.000] After ensureProjectForOpenFiles: +Info 51 [00:01:33.000] Project '/a/tsconfig.json' (Configured) +Info 51 [00:01:34.000] Files (3) + +Info 51 [00:01:35.000] ----------------------------------------------- +Info 51 [00:01:36.000] Open files: +Info 51 [00:01:37.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 51 [00:01:38.000] Projects: /a/tsconfig.json +Info 51 [00:01:39.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 52 [00:01:40.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when---outFile-is-set.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when---outFile-is-set.js new file mode 100644 index 00000000000..69ba49ef832 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when---outFile-is-set.js @@ -0,0 +1,205 @@ +Info 0 [00:00:13.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] +export let x = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{"outFile":"/a/out.js"}} + +//// [/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; } + + +Info 1 [00:00:14.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:15.000] Search path: /a +Info 3 [00:00:16.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:17.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:19.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:20.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/lib/lib.d.ts" + ], + "options": { + "outFile": "/a/out.js", + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:21.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:24.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 12 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:27.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:28.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:29.000] Files (2) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:30.000] ----------------------------------------------- +Info 18 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/tsconfig.json"}} +Info 19 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":16,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"outFile":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/a.ts","configFile":"/a/tsconfig.json","diagnostics":[]}} +Info 21 [00:00:34.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:35.000] Files (2) + +Info 21 [00:00:36.000] ----------------------------------------------- +Info 21 [00:00:37.000] Open files: +Info 21 [00:00:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:39.000] Projects: /a/tsconfig.json +Info 21 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Info 22 [00:00:43.000] DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:44.000] Scheduled: /a/tsconfig.json +Info 24 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b.ts] +export let y = 1 + + +Info 26 [00:00:47.000] Running: /a/tsconfig.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 29 [00:00:50.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:51.000] Project '/a/tsconfig.json' (Configured) +Info 31 [00:00:52.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-1 "export let y = 1" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:53.000] ----------------------------------------------- +Info 33 [00:00:54.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:55.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 35 [00:00:57.000] Files (3) + +Info 35 [00:00:58.000] ----------------------------------------------- +Info 35 [00:00:59.000] Open files: +Info 35 [00:01:00.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 35 [00:01:01.000] Projects: /a/tsconfig.json +Info 35 [00:01:02.000] After ensureProjectForOpenFiles: +Info 36 [00:01:03.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:01:04.000] Files (3) + +Info 36 [00:01:05.000] ----------------------------------------------- +Info 36 [00:01:06.000] Open files: +Info 36 [00:01:07.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 36 [00:01:08.000] Projects: /a/tsconfig.json +Info 36 [00:01:09.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 37 [00:01:10.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Info 38 [00:01:14.000] FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 39 [00:01:15.000] Scheduled: /a/tsconfig.json +Info 40 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles* +Info 41 [00:01:17.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b.ts] +export let x = 11 + + +Info 42 [00:01:18.000] Running: /a/tsconfig.json +Info 43 [00:01:19.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 44 [00:01:20.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 45 [00:01:21.000] Project '/a/tsconfig.json' (Configured) +Info 46 [00:01:22.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-2 "export let x = 11" + +Info 47 [00:01:23.000] ----------------------------------------------- +Info 48 [00:01:24.000] Running: *ensureProjectForOpenFiles* +Info 49 [00:01:25.000] Before ensureProjectForOpenFiles: +Info 50 [00:01:26.000] Project '/a/tsconfig.json' (Configured) +Info 50 [00:01:27.000] Files (3) + +Info 50 [00:01:28.000] ----------------------------------------------- +Info 50 [00:01:29.000] Open files: +Info 50 [00:01:30.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 50 [00:01:31.000] Projects: /a/tsconfig.json +Info 50 [00:01:32.000] After ensureProjectForOpenFiles: +Info 51 [00:01:33.000] Project '/a/tsconfig.json' (Configured) +Info 51 [00:01:34.000] Files (3) + +Info 51 [00:01:35.000] ----------------------------------------------- +Info 51 [00:01:36.000] Open files: +Info 51 [00:01:37.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 51 [00:01:38.000] Projects: /a/tsconfig.json +Info 51 [00:01:39.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 52 [00:01:40.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when-adding-new-file.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when-adding-new-file.js new file mode 100644 index 00000000000..15fdce321d2 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when-adding-new-file.js @@ -0,0 +1,233 @@ +Info 0 [00:00:15.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1.ts] +export var x = 10; + +//// [/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; } + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:16.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:17.000] Search path: /a/b +Info 3 [00:00:18.000] For info: /a/b/file1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:19.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:20.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:21.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1.ts to open"}} +Info 7 [00:00:22.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:23.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:24.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:25.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 13 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 16 [00:00:31.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1.ts SVC-1-0 "export var x = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:32.000] ----------------------------------------------- +Info 18 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 19 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[]}} +Info 21 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 21 [00:00:37.000] Files (2) + +Info 21 [00:00:38.000] ----------------------------------------------- +Info 21 [00:00:39.000] Open files: +Info 21 [00:00:40.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 21 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 21 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 22 [00:00:45.000] DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:46.000] Scheduled: /a/b/tsconfig.json +Info 24 [00:00:47.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/file2.ts] +export var y = 10; + + +Info 26 [00:00:49.000] Running: /a/b/tsconfig.json +Info 27 [00:00:50.000] FileWatcher:: Added:: WatchInfo: /a/b/file2.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:51.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 29 [00:00:52.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 31 [00:00:54.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1.ts SVC-1-0 "export var x = 10;" + /a/b/file2.ts Text-1 "export var y = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + file2.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:55.000] ----------------------------------------------- +Info 33 [00:00:56.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:57.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:58.000] Project '/a/b/tsconfig.json' (Configured) +Info 35 [00:00:59.000] Files (3) + +Info 35 [00:01:00.000] ----------------------------------------------- +Info 35 [00:01:01.000] Open files: +Info 35 [00:01:02.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 35 [00:01:03.000] Projects: /a/b/tsconfig.json +Info 35 [00:01:04.000] After ensureProjectForOpenFiles: +Info 36 [00:01:05.000] Project '/a/b/tsconfig.json' (Configured) +Info 36 [00:01:06.000] Files (3) + +Info 36 [00:01:07.000] ----------------------------------------------- +Info 36 [00:01:08.000] Open files: +Info 36 [00:01:09.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 36 [00:01:10.000] Projects: /a/b/tsconfig.json +Info 36 [00:01:11.000] got projects updated in background, updating diagnostics for /a/b/file1.ts +Info 37 [00:01:12.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b/file2.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 38 [00:01:15.000] DirectoryWatcher:: Triggered with /a/b/file3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 39 [00:01:16.000] Scheduled: /a/b/tsconfig.json +Info 40 [00:01:17.000] Scheduled: *ensureProjectForOpenFiles* +Info 41 [00:01:18.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/file3.ts] +export var z = 10; + + +Info 42 [00:01:19.000] Running: /a/b/tsconfig.json +Info 43 [00:01:20.000] FileWatcher:: Added:: WatchInfo: /a/b/file3.ts 500 undefined WatchType: Closed Script info +Info 44 [00:01:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 45 [00:01:22.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 46 [00:01:23.000] Project '/a/b/tsconfig.json' (Configured) +Info 47 [00:01:24.000] Files (4) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1.ts SVC-1-0 "export var x = 10;" + /a/b/file2.ts Text-1 "export var y = 10;" + /a/b/file3.ts Text-1 "export var z = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + file2.ts + Matched by default include pattern '**/*' + file3.ts + Matched by default include pattern '**/*' + +Info 48 [00:01:25.000] ----------------------------------------------- +Info 49 [00:01:26.000] Running: *ensureProjectForOpenFiles* +Info 50 [00:01:27.000] Before ensureProjectForOpenFiles: +Info 51 [00:01:28.000] Project '/a/b/tsconfig.json' (Configured) +Info 51 [00:01:29.000] Files (4) + +Info 51 [00:01:30.000] ----------------------------------------------- +Info 51 [00:01:31.000] Open files: +Info 51 [00:01:32.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 51 [00:01:33.000] Projects: /a/b/tsconfig.json +Info 51 [00:01:34.000] After ensureProjectForOpenFiles: +Info 52 [00:01:35.000] Project '/a/b/tsconfig.json' (Configured) +Info 52 [00:01:36.000] Files (4) + +Info 52 [00:01:37.000] ----------------------------------------------- +Info 52 [00:01:38.000] Open files: +Info 52 [00:01:39.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 52 [00:01:40.000] Projects: /a/b/tsconfig.json +Info 52 [00:01:41.000] got projects updated in background, updating diagnostics for /a/b/file1.ts +Info 53 [00:01:42.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b/file2.ts: + {} +/a/b/file3.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when-both-options-are-not-set.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when-both-options-are-not-set.js new file mode 100644 index 00000000000..df578cbb29a --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-when-both-options-are-not-set.js @@ -0,0 +1,204 @@ +Info 0 [00:00:13.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] +export let x = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{}} + +//// [/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; } + + +Info 1 [00:00:14.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:15.000] Search path: /a +Info 3 [00:00:16.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:17.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:19.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:20.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/lib/lib.d.ts" + ], + "options": { + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:21.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:24.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 12 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:27.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:28.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:29.000] Files (2) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:30.000] ----------------------------------------------- +Info 18 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/tsconfig.json"}} +Info 19 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":16,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/a.ts","configFile":"/a/tsconfig.json","diagnostics":[]}} +Info 21 [00:00:34.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:35.000] Files (2) + +Info 21 [00:00:36.000] ----------------------------------------------- +Info 21 [00:00:37.000] Open files: +Info 21 [00:00:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:39.000] Projects: /a/tsconfig.json +Info 21 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Info 22 [00:00:43.000] DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:44.000] Scheduled: /a/tsconfig.json +Info 24 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b.ts] +export let y = 1 + + +Info 26 [00:00:47.000] Running: /a/tsconfig.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 29 [00:00:50.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:51.000] Project '/a/tsconfig.json' (Configured) +Info 31 [00:00:52.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-1 "export let y = 1" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:53.000] ----------------------------------------------- +Info 33 [00:00:54.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:55.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 35 [00:00:57.000] Files (3) + +Info 35 [00:00:58.000] ----------------------------------------------- +Info 35 [00:00:59.000] Open files: +Info 35 [00:01:00.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 35 [00:01:01.000] Projects: /a/tsconfig.json +Info 35 [00:01:02.000] After ensureProjectForOpenFiles: +Info 36 [00:01:03.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:01:04.000] Files (3) + +Info 36 [00:01:05.000] ----------------------------------------------- +Info 36 [00:01:06.000] Open files: +Info 36 [00:01:07.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 36 [00:01:08.000] Projects: /a/tsconfig.json +Info 36 [00:01:09.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 37 [00:01:10.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Info 38 [00:01:14.000] FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 39 [00:01:15.000] Scheduled: /a/tsconfig.json +Info 40 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles* +Info 41 [00:01:17.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b.ts] +export let x = 11 + + +Info 42 [00:01:18.000] Running: /a/tsconfig.json +Info 43 [00:01:19.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 44 [00:01:20.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 45 [00:01:21.000] Project '/a/tsconfig.json' (Configured) +Info 46 [00:01:22.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-2 "export let x = 11" + +Info 47 [00:01:23.000] ----------------------------------------------- +Info 48 [00:01:24.000] Running: *ensureProjectForOpenFiles* +Info 49 [00:01:25.000] Before ensureProjectForOpenFiles: +Info 50 [00:01:26.000] Project '/a/tsconfig.json' (Configured) +Info 50 [00:01:27.000] Files (3) + +Info 50 [00:01:28.000] ----------------------------------------------- +Info 50 [00:01:29.000] Open files: +Info 50 [00:01:30.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 50 [00:01:31.000] Projects: /a/tsconfig.json +Info 50 [00:01:32.000] After ensureProjectForOpenFiles: +Info 51 [00:01:33.000] Project '/a/tsconfig.json' (Configured) +Info 51 [00:01:34.000] Files (3) + +Info 51 [00:01:35.000] ----------------------------------------------- +Info 51 [00:01:36.000] Open files: +Info 51 [00:01:37.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 51 [00:01:38.000] Projects: /a/tsconfig.json +Info 51 [00:01:39.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 52 [00:01:40.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js similarity index 98% rename from tests/baselines/reference/tsserver/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js rename to tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js index d1f195cf980..77307b8a1c4 100644 --- a/tests/baselines/reference/tsserver/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-at-root-level.js @@ -147,8 +147,6 @@ Info 37 [00:01:17.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/project/file1.ts"]}} After checking timeout queue length (2) and running -Checking timeout queue length: 1 - Before running timeout callbacks //// [/a/b/node_modules/file2.d.ts] export class a { } diff --git a/tests/baselines/reference/tsserver/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js similarity index 98% rename from tests/baselines/reference/tsserver/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js rename to tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js index c60b0863e99..6cbd405e4c2 100644 --- a/tests/baselines/reference/tsserver/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-project-is-not-at-root-level.js @@ -159,8 +159,6 @@ Info 43 [00:01:33.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/rootfolder/otherfolder/a/b/project/file1.ts"]}} After checking timeout queue length (2) and running -Checking timeout queue length: 1 - Info 44 [00:01:37.000] DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations Info 45 [00:01:38.000] Scheduled: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.jsonFailedLookupInvalidation Info 46 [00:01:39.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/rootfolder/otherfolder/a/b/node_modules :: WatchInfo: /user/username/rootfolder/otherfolder/a/b/node_modules 1 undefined Project: /user/username/rootfolder/otherfolder/a/b/project/tsconfig.json WatchType: Failed Lookup Locations @@ -279,5 +277,3 @@ Info 69 [00:02:16.000] got projects updated in background, updating diagnostic Info 70 [00:02:17.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/rootfolder/otherfolder/a/b/project/file1.ts"]}} After running timeout callbacks - -Checking timeout queue length: 1 diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js new file mode 100644 index 00000000000..60cd8a5bcab --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---isolatedModules-is-specified.js @@ -0,0 +1,269 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{"compilerOptions":{"isolatedModules":true}} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "isolatedModules": true, + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"isolatedModules":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 62 [00:01:36.000] Running: /a/b/tsconfig.json +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 68 [00:01:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:43.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 70 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 71 [00:01:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 72 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 73 [00:01:47.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 74 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:49.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 76 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Running: *ensureProjectForOpenFiles* +Info 78 [00:01:52.000] Before ensureProjectForOpenFiles: +Info 79 [00:01:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 79 [00:01:54.000] Files (6) + +Info 79 [00:01:55.000] ----------------------------------------------- +Info 79 [00:01:56.000] Open files: +Info 79 [00:01:57.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 79 [00:01:58.000] Projects: /a/b/tsconfig.json +Info 79 [00:01:59.000] After ensureProjectForOpenFiles: +Info 80 [00:02:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 80 [00:02:01.000] Files (6) + +Info 80 [00:02:02.000] ----------------------------------------------- +Info 80 [00:02:03.000] Open files: +Info 80 [00:02:04.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 80 [00:02:05.000] Projects: /a/b/tsconfig.json +Info 80 [00:02:06.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 81 [00:02:07.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js new file mode 100644 index 00000000000..d54a008e545 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-always-return-the-file-itself-if---out-or---outFile-is-specified.js @@ -0,0 +1,258 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{"compilerOptions":{"module":"system","outFile":"/a/b/out.js"}} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "module": 4, + "outFile": "/a/b/out.js", + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 14 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 16 [00:00:27.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 17 [00:00:28.000] Project '/a/b/tsconfig.json' (Configured) +Info 18 [00:00:29.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 19 [00:00:30.000] ----------------------------------------------- +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"module":"system","outFile":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 23 [00:00:34.000] Project '/a/b/tsconfig.json' (Configured) +Info 23 [00:00:35.000] Files (1) + +Info 23 [00:00:36.000] ----------------------------------------------- +Info 23 [00:00:37.000] Open files: +Info 23 [00:00:38.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 23 [00:00:39.000] Projects: /a/b/tsconfig.json +Info 23 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 24 [00:00:44.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 25 [00:00:45.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 26 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 28 [00:00:48.000] Scheduled: /a/b/tsconfig.json +Info 29 [00:00:49.000] Scheduled: *ensureProjectForOpenFiles* +Info 30 [00:00:50.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 31 [00:00:53.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 32 [00:00:54.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 33 [00:00:55.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 35 [00:00:57.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 36 [00:00:58.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 37 [00:00:59.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 38 [00:01:02.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 39 [00:01:03.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 40 [00:01:04.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 42 [00:01:06.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 43 [00:01:07.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 44 [00:01:08.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 45 [00:01:11.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 46 [00:01:12.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 47 [00:01:13.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 49 [00:01:15.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 50 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 51 [00:01:17.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 52 [00:01:22.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 53 [00:01:23.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 54 [00:01:24.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 55 [00:01:25.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 56 [00:01:26.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 57 [00:01:28.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 58 [00:01:29.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 59 [00:01:30.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 60 [00:01:34.000] Running: /a/b/tsconfig.json +Info 61 [00:01:35.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 62 [00:01:36.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 68 [00:01:42.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 69 [00:01:43.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 70 [00:01:44.000] Project '/a/b/tsconfig.json' (Configured) +Info 71 [00:01:45.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 72 [00:01:46.000] ----------------------------------------------- +Info 73 [00:01:47.000] Running: *ensureProjectForOpenFiles* +Info 74 [00:01:48.000] Before ensureProjectForOpenFiles: +Info 75 [00:01:49.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:50.000] Files (6) + +Info 75 [00:01:51.000] ----------------------------------------------- +Info 75 [00:01:52.000] Open files: +Info 75 [00:01:53.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 75 [00:01:54.000] Projects: /a/b/tsconfig.json +Info 75 [00:01:55.000] After ensureProjectForOpenFiles: +Info 76 [00:01:56.000] Project '/a/b/tsconfig.json' (Configured) +Info 76 [00:01:57.000] Files (6) + +Info 76 [00:01:58.000] ----------------------------------------------- +Info 76 [00:01:59.000] Open files: +Info 76 [00:02:00.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 76 [00:02:01.000] Projects: /a/b/tsconfig.json +Info 76 [00:02:02.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 77 [00:02:03.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-deleted-files.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-deleted-files.js new file mode 100644 index 00000000000..30cb1d79be7 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-deleted-files.js @@ -0,0 +1,270 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Info 62 [00:01:37.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 63 [00:01:38.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 64 [00:01:39.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 65 [00:01:40.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 66 [00:01:41.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 67 [00:01:42.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 68 [00:01:43.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] deleted + +Info 69 [00:01:44.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 70 [00:01:45.000] Running: /a/b/tsconfig.json +Info 71 [00:01:46.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 72 [00:01:47.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 73 [00:01:48.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 74 [00:01:49.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 75 [00:01:50.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 76 [00:01:51.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 77 [00:01:52.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 78 [00:01:53.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 79 [00:01:54.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 80 [00:01:55.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 81 [00:01:56.000] Project '/a/b/tsconfig.json' (Configured) +Info 82 [00:01:57.000] Files (5) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 83 [00:01:58.000] ----------------------------------------------- +Info 84 [00:01:59.000] Running: *ensureProjectForOpenFiles* +Info 85 [00:02:00.000] Before ensureProjectForOpenFiles: +Info 86 [00:02:01.000] Project '/a/b/tsconfig.json' (Configured) +Info 86 [00:02:02.000] Files (5) + +Info 86 [00:02:03.000] ----------------------------------------------- +Info 86 [00:02:04.000] Open files: +Info 86 [00:02:05.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 86 [00:02:06.000] Projects: /a/b/tsconfig.json +Info 86 [00:02:07.000] After ensureProjectForOpenFiles: +Info 87 [00:02:08.000] Project '/a/b/tsconfig.json' (Configured) +Info 87 [00:02:09.000] Files (5) + +Info 87 [00:02:10.000] ----------------------------------------------- +Info 87 [00:02:11.000] Open files: +Info 87 [00:02:12.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 87 [00:02:13.000] Projects: /a/b/tsconfig.json +Info 87 [00:02:14.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 88 [00:02:15.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-newly-created-files.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-newly-created-files.js new file mode 100644 index 00000000000..cbe124b156c --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-newly-created-files.js @@ -0,0 +1,286 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Info 62 [00:01:38.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 63 [00:01:39.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 64 [00:01:40.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 65 [00:01:41.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 66 [00:01:42.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 67 [00:01:43.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 68 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer3.ts] +import {Foo} from "./moduleFile1"; let y = Foo(); + + +Info 69 [00:01:45.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 70 [00:01:46.000] Running: /a/b/tsconfig.json +Info 71 [00:01:47.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 72 [00:01:48.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer3.ts 500 undefined WatchType: Closed Script info +Info 73 [00:01:49.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 74 [00:01:50.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 75 [00:01:51.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 76 [00:01:52.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 77 [00:01:53.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 78 [00:01:54.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 79 [00:01:55.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 80 [00:01:56.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 81 [00:01:57.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 82 [00:01:58.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 83 [00:01:59.000] Project '/a/b/tsconfig.json' (Configured) +Info 84 [00:02:00.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/file1Consumer3.ts Text-1 "import {Foo} from \"./moduleFile1\"; let y = Foo();" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Imported via "./moduleFile1" from file 'file1Consumer3.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + file1Consumer3.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 85 [00:02:01.000] ----------------------------------------------- +Info 86 [00:02:02.000] Running: *ensureProjectForOpenFiles* +Info 87 [00:02:03.000] Before ensureProjectForOpenFiles: +Info 88 [00:02:04.000] Project '/a/b/tsconfig.json' (Configured) +Info 88 [00:02:05.000] Files (7) + +Info 88 [00:02:06.000] ----------------------------------------------- +Info 88 [00:02:07.000] Open files: +Info 88 [00:02:08.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 88 [00:02:09.000] Projects: /a/b/tsconfig.json +Info 88 [00:02:10.000] After ensureProjectForOpenFiles: +Info 89 [00:02:11.000] Project '/a/b/tsconfig.json' (Configured) +Info 89 [00:02:12.000] Files (7) + +Info 89 [00:02:13.000] ----------------------------------------------- +Info 89 [00:02:14.000] Open files: +Info 89 [00:02:15.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 89 [00:02:16.000] Projects: /a/b/tsconfig.json +Info 89 [00:02:17.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 90 [00:02:18.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/file1consumer3.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js new file mode 100644 index 00000000000..58ca61c1172 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js @@ -0,0 +1,494 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before request + +Info 62 [00:01:33.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "export let y = Foo();", + "endLine": 1, + "endOffset": 53, + "line": 1, + "offset": 1 + }, + "seq": 2, + "type": "request" + } +Info 63 [00:01:34.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +Info 64 [00:01:35.000] Running: /a/b/tsconfig.json +Info 65 [00:01:36.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 68 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:40.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 70 [00:01:41.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 71 [00:01:42.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 72 [00:01:43.000] Project '/a/b/tsconfig.json' (Configured) +Info 73 [00:01:44.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1Consumer1.ts SVC-1-1 "export let y = Foo();;" + /a/b/moduleFile1.ts Text-1 "export function Foo() { };" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1Consumer1.ts + Matched by default include pattern '**/*' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 74 [00:01:45.000] ----------------------------------------------- +Info 75 [00:01:46.000] Running: *ensureProjectForOpenFiles* +Info 76 [00:01:47.000] Before ensureProjectForOpenFiles: +Info 77 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 77 [00:01:49.000] Files (6) + +Info 77 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Open files: +Info 77 [00:01:52.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 77 [00:01:53.000] Projects: /a/b/tsconfig.json +Info 77 [00:01:54.000] After ensureProjectForOpenFiles: +Info 78 [00:01:55.000] Project '/a/b/tsconfig.json' (Configured) +Info 78 [00:01:56.000] Files (6) + +Info 78 [00:01:57.000] ----------------------------------------------- +Info 78 [00:01:58.000] Open files: +Info 78 [00:01:59.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 78 [00:02:00.000] Projects: /a/b/tsconfig.json +Info 78 [00:02:01.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 79 [00:02:02.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 80 [00:02:06.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 81 [00:02:07.000] Scheduled: /a/b/tsconfig.json +Info 82 [00:02:08.000] Scheduled: *ensureProjectForOpenFiles* +Info 83 [00:02:09.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 84 [00:02:10.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 85 [00:02:11.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 86 [00:02:12.000] Project '/a/b/tsconfig.json' (Configured) +Info 87 [00:02:13.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1Consumer1.ts SVC-1-1 "export let y = Foo();;" + /a/b/moduleFile1.ts Text-2 "export var T: number;export function Foo() { };" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 88 [00:02:14.000] ----------------------------------------------- +Info 89 [00:02:15.000] event: + {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/a/b/file1Consumer1.ts","diagnostics":[]}} +Info 90 [00:02:16.000] Running: /a/b/tsconfig.json +Info 91 [00:02:17.000] Running: *ensureProjectForOpenFiles* +Info 92 [00:02:18.000] Before ensureProjectForOpenFiles: +Info 93 [00:02:19.000] Project '/a/b/tsconfig.json' (Configured) +Info 93 [00:02:20.000] Files (6) + +Info 93 [00:02:21.000] ----------------------------------------------- +Info 93 [00:02:22.000] Open files: +Info 93 [00:02:23.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 93 [00:02:24.000] Projects: /a/b/tsconfig.json +Info 93 [00:02:25.000] After ensureProjectForOpenFiles: +Info 94 [00:02:26.000] Project '/a/b/tsconfig.json' (Configured) +Info 94 [00:02:27.000] Files (6) + +Info 94 [00:02:28.000] ----------------------------------------------- +Info 94 [00:02:29.000] Open files: +Info 94 [00:02:30.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 94 [00:02:31.000] Projects: /a/b/tsconfig.json +Info 94 [00:02:32.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 95 [00:02:33.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +Before request + +Info 96 [00:02:34.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "import {Foo} from \"./moduleFile1\";let y = Foo();", + "endLine": 1, + "endOffset": 21, + "line": 1, + "offset": 1 + }, + "seq": 3, + "type": "request" + } +Info 97 [00:02:35.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +After running timeout callbacks + +Info 98 [00:02:39.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 99 [00:02:40.000] Scheduled: /a/b/tsconfig.json +Info 100 [00:02:41.000] Scheduled: *ensureProjectForOpenFiles* +Info 101 [00:02:42.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export var T2: string;export function Foo() { }; + + +Info 102 [00:02:43.000] Running: /a/b/tsconfig.json +Info 103 [00:02:44.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 104 [00:02:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 105 [00:02:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 106 [00:02:47.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 107 [00:02:48.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 108 [00:02:49.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 109 [00:02:50.000] Project '/a/b/tsconfig.json' (Configured) +Info 110 [00:02:51.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-3 "export var T: number;export var T2: string;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-2 "import {Foo} from \"./moduleFile1\";let y = Foo();;;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 111 [00:02:52.000] ----------------------------------------------- +Info 112 [00:02:53.000] Running: *ensureProjectForOpenFiles* +Info 113 [00:02:54.000] Before ensureProjectForOpenFiles: +Info 114 [00:02:55.000] Project '/a/b/tsconfig.json' (Configured) +Info 114 [00:02:56.000] Files (6) + +Info 114 [00:02:57.000] ----------------------------------------------- +Info 114 [00:02:58.000] Open files: +Info 114 [00:02:59.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 114 [00:03:00.000] Projects: /a/b/tsconfig.json +Info 114 [00:03:01.000] After ensureProjectForOpenFiles: +Info 115 [00:03:02.000] Project '/a/b/tsconfig.json' (Configured) +Info 115 [00:03:03.000] Files (6) + +Info 115 [00:03:04.000] ----------------------------------------------- +Info 115 [00:03:05.000] Open files: +Info 115 [00:03:06.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 115 [00:03:07.000] Projects: /a/b/tsconfig.json +Info 115 [00:03:08.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 116 [00:03:09.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: + {} +/a/b/globalfile3.ts: + {} +/a/b/modulefile1.ts: + {} +/a/b/modulefile2.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Before request + +Info 117 [00:03:10.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "export let y = Foo();", + "endLine": 1, + "endOffset": 48, + "line": 1, + "offset": 1 + }, + "seq": 4, + "type": "request" + } +Info 118 [00:03:11.000] response: + { + "responseRequired": false + } +After request + +Info 119 [00:03:15.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 120 [00:03:16.000] Scheduled: /a/b/tsconfig.json +Info 121 [00:03:17.000] Scheduled: *ensureProjectForOpenFiles* +Info 122 [00:03:18.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 123 [00:03:19.000] Running: /a/b/tsconfig.json +Info 124 [00:03:20.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 125 [00:03:21.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 5 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 126 [00:03:22.000] Project '/a/b/tsconfig.json' (Configured) +Info 127 [00:03:23.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1Consumer1.ts SVC-1-3 "export let y = Foo();;;;" + /a/b/moduleFile1.ts Text-4 "export var T: number;export function Foo() { };" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 128 [00:03:24.000] ----------------------------------------------- +Info 129 [00:03:25.000] Running: *ensureProjectForOpenFiles* +Info 130 [00:03:26.000] Before ensureProjectForOpenFiles: +Info 131 [00:03:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 131 [00:03:28.000] Files (6) + +Info 131 [00:03:29.000] ----------------------------------------------- +Info 131 [00:03:30.000] Open files: +Info 131 [00:03:31.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 131 [00:03:32.000] Projects: /a/b/tsconfig.json +Info 131 [00:03:33.000] After ensureProjectForOpenFiles: +Info 132 [00:03:34.000] Project '/a/b/tsconfig.json' (Configured) +Info 132 [00:03:35.000] Files (6) + +Info 132 [00:03:36.000] ----------------------------------------------- +Info 132 [00:03:37.000] Open files: +Info 132 [00:03:38.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 132 [00:03:39.000] Projects: /a/b/tsconfig.json +Info 132 [00:03:40.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 133 [00:03:41.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-contains-only-itself.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-contains-only-itself.js new file mode 100644 index 00000000000..fddf8b02bff --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-contains-only-itself.js @@ -0,0 +1,314 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 62 [00:01:36.000] Running: /a/b/tsconfig.json +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 68 [00:01:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:43.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 70 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 71 [00:01:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 72 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 73 [00:01:47.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 74 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:49.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 76 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Running: *ensureProjectForOpenFiles* +Info 78 [00:01:52.000] Before ensureProjectForOpenFiles: +Info 79 [00:01:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 79 [00:01:54.000] Files (6) + +Info 79 [00:01:55.000] ----------------------------------------------- +Info 79 [00:01:56.000] Open files: +Info 79 [00:01:57.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 79 [00:01:58.000] Projects: /a/b/tsconfig.json +Info 79 [00:01:59.000] After ensureProjectForOpenFiles: +Info 80 [00:02:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 80 [00:02:01.000] Files (6) + +Info 80 [00:02:02.000] ----------------------------------------------- +Info 80 [00:02:03.000] Open files: +Info 80 [00:02:04.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 80 [00:02:05.000] Projects: /a/b/tsconfig.json +Info 80 [00:02:06.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 81 [00:02:07.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 82 [00:02:11.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 83 [00:02:12.000] Scheduled: /a/b/tsconfig.json +Info 84 [00:02:13.000] Scheduled: *ensureProjectForOpenFiles* +Info 85 [00:02:14.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { console.log('hi'); }; + + +Info 86 [00:02:15.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 87 [00:02:16.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 88 [00:02:17.000] Project '/a/b/tsconfig.json' (Configured) +Info 89 [00:02:18.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-2 "export var T: number;export function Foo() { console.log('hi'); };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 90 [00:02:19.000] ----------------------------------------------- +Info 91 [00:02:20.000] event: + {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/a/b/file1Consumer1.ts","diagnostics":[]}} +Info 92 [00:02:21.000] Running: /a/b/tsconfig.json +Info 93 [00:02:22.000] Running: *ensureProjectForOpenFiles* +Info 94 [00:02:23.000] Before ensureProjectForOpenFiles: +Info 95 [00:02:24.000] Project '/a/b/tsconfig.json' (Configured) +Info 95 [00:02:25.000] Files (6) + +Info 95 [00:02:26.000] ----------------------------------------------- +Info 95 [00:02:27.000] Open files: +Info 95 [00:02:28.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 95 [00:02:29.000] Projects: /a/b/tsconfig.json +Info 95 [00:02:30.000] After ensureProjectForOpenFiles: +Info 96 [00:02:31.000] Project '/a/b/tsconfig.json' (Configured) +Info 96 [00:02:32.000] Files (6) + +Info 96 [00:02:33.000] ----------------------------------------------- +Info 96 [00:02:34.000] Open files: +Info 96 [00:02:35.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 96 [00:02:36.000] Projects: /a/b/tsconfig.json +Info 96 [00:02:37.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 97 [00:02:38.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-changes-in-non-root-files.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-changes-in-non-root-files.js new file mode 100644 index 00000000000..861f71403cf --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-changes-in-non-root-files.js @@ -0,0 +1,261 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{"files":["/a/b/file1Consumer1.ts"]} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 9 [00:00:20.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 10 [00:00:21.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 14 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 16 [00:00:27.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 17 [00:00:28.000] Project '/a/b/tsconfig.json' (Configured) +Info 18 [00:00:29.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Part of 'files' list in tsconfig.json + +Info 19 [00:00:30.000] ----------------------------------------------- +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":true,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 23 [00:00:34.000] Project '/a/b/tsconfig.json' (Configured) +Info 23 [00:00:35.000] Files (1) + +Info 23 [00:00:36.000] ----------------------------------------------- +Info 23 [00:00:37.000] Open files: +Info 23 [00:00:38.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 23 [00:00:39.000] Projects: /a/b/tsconfig.json +Info 23 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +Info 24 [00:00:44.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 25 [00:00:45.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 26 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 28 [00:00:50.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 29 [00:00:51.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 30 [00:00:54.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 31 [00:00:55.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 32 [00:00:56.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 33 [00:00:59.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:01:00.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:01:06.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 37 [00:01:07.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 38 [00:01:08.000] Scheduled: /a/b/tsconfig.json +Info 39 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles* +Info 40 [00:01:10.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +Info 41 [00:01:12.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 42 [00:01:13.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 43 [00:01:14.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 44 [00:01:18.000] Running: /a/b/tsconfig.json +Info 45 [00:01:19.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 46 [00:01:20.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 47 [00:01:21.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 48 [00:01:22.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 49 [00:01:23.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:24.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 51 [00:01:25.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 52 [00:01:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 53 [00:01:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 54 [00:01:28.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + file1Consumer1.ts + Part of 'files' list in tsconfig.json + +Info 55 [00:01:29.000] ----------------------------------------------- +Info 56 [00:01:30.000] Running: *ensureProjectForOpenFiles* +Info 57 [00:01:31.000] Before ensureProjectForOpenFiles: +Info 58 [00:01:32.000] Project '/a/b/tsconfig.json' (Configured) +Info 58 [00:01:33.000] Files (3) + +Info 58 [00:01:34.000] ----------------------------------------------- +Info 58 [00:01:35.000] Open files: +Info 58 [00:01:36.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 58 [00:01:37.000] Projects: /a/b/tsconfig.json +Info 58 [00:01:38.000] After ensureProjectForOpenFiles: +Info 59 [00:01:39.000] Project '/a/b/tsconfig.json' (Configured) +Info 59 [00:01:40.000] Files (3) + +Info 59 [00:01:41.000] ----------------------------------------------- +Info 59 [00:01:42.000] Open files: +Info 59 [00:01:43.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 59 [00:01:44.000] Projects: /a/b/tsconfig.json +Info 59 [00:01:45.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 60 [00:01:46.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/modulefile1.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +Info 61 [00:01:50.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 62 [00:01:51.000] Scheduled: /a/b/tsconfig.json +Info 63 [00:01:52.000] Scheduled: *ensureProjectForOpenFiles* +Info 64 [00:01:53.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { };var T1: number; + + +Info 65 [00:01:54.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 66 [00:01:55.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 67 [00:01:56.000] Project '/a/b/tsconfig.json' (Configured) +Info 68 [00:01:57.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-2 "export function Foo() { };var T1: number;" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + +Info 69 [00:01:58.000] ----------------------------------------------- +Info 70 [00:01:59.000] event: + {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/a/b/file1Consumer1.ts","diagnostics":[]}} +Info 71 [00:02:00.000] Running: /a/b/tsconfig.json +Info 72 [00:02:01.000] Running: *ensureProjectForOpenFiles* +Info 73 [00:02:02.000] Before ensureProjectForOpenFiles: +Info 74 [00:02:03.000] Project '/a/b/tsconfig.json' (Configured) +Info 74 [00:02:04.000] Files (3) + +Info 74 [00:02:05.000] ----------------------------------------------- +Info 74 [00:02:06.000] Open files: +Info 74 [00:02:07.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 74 [00:02:08.000] Projects: /a/b/tsconfig.json +Info 74 [00:02:09.000] After ensureProjectForOpenFiles: +Info 75 [00:02:10.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:02:11.000] Files (3) + +Info 75 [00:02:12.000] ----------------------------------------------- +Info 75 [00:02:13.000] Open files: +Info 75 [00:02:14.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 75 [00:02:15.000] Projects: /a/b/tsconfig.json +Info 75 [00:02:16.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 76 [00:02:17.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-non-existing-code-file.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-non-existing-code-file.js new file mode 100644 index 00000000000..2c40fba8e86 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-non-existing-code-file.js @@ -0,0 +1,291 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/referenceFile1.ts] + + /// + export var x = Foo(); + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/referenceFile1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/referenceFile1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/referenceFile1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/referenceFile1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 17 [00:00:28.000] Files (1) + /a/b/referenceFile1.ts SVC-1-0 "\n /// \n export var x = Foo();" + + + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:29.000] ----------------------------------------------- +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":104,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/referenceFile1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 22 [00:00:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/b/tsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile2.ts: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 23 [00:00:45.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 24 [00:00:46.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 25 [00:00:47.000] Scheduled: /a/b/tsconfig.json +Info 26 [00:00:48.000] Scheduled: *ensureProjectForOpenFiles* +Info 27 [00:00:49.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +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; } + + +PolledWatches:: +/a/b/modulefile2.ts: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 28 [00:00:51.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/referenceFile1.ts", + "insertString": "\n /// \n export var x = Foo();export var yy = Foo();", + "endLine": 1, + "endOffset": 104, + "line": 1, + "offset": 1 + }, + "seq": 2, + "type": "request" + } +Info 29 [00:00:52.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +Info 30 [00:00:53.000] Running: /a/b/tsconfig.json +Info 31 [00:00:54.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 32 [00:00:55.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 33 [00:00:56.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 34 [00:00:57.000] Project '/a/b/tsconfig.json' (Configured) +Info 35 [00:00:58.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/referenceFile1.ts SVC-1-1 "\n /// \n export var x = Foo();export var yy = Foo();;" + + + ../lib/lib.d.ts + Default library for target 'es5' + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 36 [00:00:59.000] ----------------------------------------------- +Info 37 [00:01:00.000] Running: *ensureProjectForOpenFiles* +Info 38 [00:01:01.000] Before ensureProjectForOpenFiles: +Info 39 [00:01:02.000] Project '/a/b/tsconfig.json' (Configured) +Info 39 [00:01:03.000] Files (2) + +Info 39 [00:01:04.000] ----------------------------------------------- +Info 39 [00:01:05.000] Open files: +Info 39 [00:01:06.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 39 [00:01:07.000] Projects: /a/b/tsconfig.json +Info 39 [00:01:08.000] After ensureProjectForOpenFiles: +Info 40 [00:01:09.000] Project '/a/b/tsconfig.json' (Configured) +Info 40 [00:01:10.000] Files (2) + +Info 40 [00:01:11.000] ----------------------------------------------- +Info 40 [00:01:12.000] Open files: +Info 40 [00:01:13.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 40 [00:01:14.000] Projects: /a/b/tsconfig.json +Info 40 [00:01:15.000] got projects updated in background, updating diagnostics for /a/b/referenceFile1.ts +Info 41 [00:01:16.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/referenceFile1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/modulefile2.ts: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 42 [00:01:19.000] FileWatcher:: Triggered with /a/b/modulefile2.ts 0:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 43 [00:01:20.000] FileWatcher:: Close:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 44 [00:01:21.000] Scheduled: /a/b/tsconfig.json +Info 45 [00:01:22.000] Scheduled: *ensureProjectForOpenFiles* +Info 46 [00:01:23.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/modulefile2.ts 0:: WatchInfo: /a/b/modulefile2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 47 [00:01:24.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 48 [00:01:25.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 49 [00:01:26.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 50 [00:01:27.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile2.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 51 [00:01:28.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile2.ts 500 undefined WatchType: Closed Script info +Info 52 [00:01:29.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 53 [00:01:30.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 54 [00:01:31.000] Project '/a/b/tsconfig.json' (Configured) +Info 55 [00:01:32.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + /a/b/referenceFile1.ts SVC-1-1 "\n /// \n export var x = Foo();export var yy = Foo();;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile2.ts + Referenced via './moduleFile2.ts' from file 'referenceFile1.ts' + Matched by default include pattern '**/*' + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 56 [00:01:33.000] ----------------------------------------------- +Info 57 [00:01:34.000] event: + {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/a/b/referenceFile1.ts","diagnostics":[]}} +Info 58 [00:01:35.000] Running: /a/b/tsconfig.json +Info 59 [00:01:36.000] Running: *ensureProjectForOpenFiles* +Info 60 [00:01:37.000] Before ensureProjectForOpenFiles: +Info 61 [00:01:38.000] Project '/a/b/tsconfig.json' (Configured) +Info 61 [00:01:39.000] Files (3) + +Info 61 [00:01:40.000] ----------------------------------------------- +Info 61 [00:01:41.000] Open files: +Info 61 [00:01:42.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 61 [00:01:43.000] Projects: /a/b/tsconfig.json +Info 61 [00:01:44.000] After ensureProjectForOpenFiles: +Info 62 [00:01:45.000] Project '/a/b/tsconfig.json' (Configured) +Info 62 [00:01:46.000] Files (3) + +Info 62 [00:01:47.000] ----------------------------------------------- +Info 62 [00:01:48.000] Open files: +Info 62 [00:01:49.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 62 [00:01:50.000] Projects: /a/b/tsconfig.json +Info 62 [00:01:51.000] got projects updated in background, updating diagnostics for /a/b/referenceFile1.ts +Info 63 [00:01:52.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/referenceFile1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b/modulefile2.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-removed-code-file.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-removed-code-file.js new file mode 100644 index 00000000000..7f319b42b3b --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-detect-removed-code-file.js @@ -0,0 +1,191 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/referenceFile1.ts] + + /// + export var x = Foo(); + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/referenceFile1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/referenceFile1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/referenceFile1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/referenceFile1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 17 [00:00:28.000] Files (1) + /a/b/referenceFile1.ts SVC-1-0 "\n /// \n export var x = Foo();" + + + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:29.000] ----------------------------------------------- +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":104,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/referenceFile1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 22 [00:00:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/b/tsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1.ts: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 23 [00:00:45.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 24 [00:00:46.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 25 [00:00:47.000] Scheduled: /a/b/tsconfig.json +Info 26 [00:00:48.000] Scheduled: *ensureProjectForOpenFiles* +Info 27 [00:00:49.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 28 [00:00:52.000] FileWatcher:: Triggered with /a/b/modulefile1.ts 0:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 29 [00:00:53.000] FileWatcher:: Close:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 30 [00:00:54.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 31 [00:00:55.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 32 [00:00:56.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/modulefile1.ts 0:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 33 [00:00:57.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 34 [00:00:58.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 35 [00:00:59.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 36 [00:01:00.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:01:03.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 38 [00:01:04.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 39 [00:01:05.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 40 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/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; } + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1.ts: + {"pollingInterval":500} +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 41 [00:01:07.000] Running: /a/b/tsconfig.json +Info 42 [00:01:08.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 43 [00:01:09.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 44 [00:01:10.000] FileWatcher:: Added:: WatchInfo: /a/b/modulefile1.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 45 [00:01:11.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 46 [00:01:12.000] Project '/a/b/tsconfig.json' (Configured) +Info 47 [00:01:13.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/referenceFile1.ts SVC-1-0 "\n /// \n export var x = Foo();" + + + ../lib/lib.d.ts + Default library for target 'es5' + referenceFile1.ts + Matched by default include pattern '**/*' + +Info 48 [00:01:14.000] ----------------------------------------------- +Info 49 [00:01:15.000] Running: *ensureProjectForOpenFiles* +Info 50 [00:01:16.000] Before ensureProjectForOpenFiles: +Info 51 [00:01:17.000] Project '/a/b/tsconfig.json' (Configured) +Info 51 [00:01:18.000] Files (2) + +Info 51 [00:01:19.000] ----------------------------------------------- +Info 51 [00:01:20.000] Open files: +Info 51 [00:01:21.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 51 [00:01:22.000] Projects: /a/b/tsconfig.json +Info 51 [00:01:23.000] After ensureProjectForOpenFiles: +Info 52 [00:01:24.000] Project '/a/b/tsconfig.json' (Configured) +Info 52 [00:01:25.000] Files (2) + +Info 52 [00:01:26.000] ----------------------------------------------- +Info 52 [00:01:27.000] Open files: +Info 52 [00:01:28.000] FileName: /a/b/referenceFile1.ts ProjectRootPath: undefined +Info 52 [00:01:29.000] Projects: /a/b/tsconfig.json +Info 52 [00:01:30.000] got projects updated in background, updating diagnostics for /a/b/referenceFile1.ts +Info 53 [00:01:31.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/referenceFile1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} +/a/b/modulefile1.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-return-all-files-if-a-global-file-changed-shape.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-return-all-files-if-a-global-file-changed-shape.js new file mode 100644 index 00000000000..150b2c9cad9 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-return-all-files-if-a-global-file-changed-shape.js @@ -0,0 +1,268 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:24.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 55 [00:01:25.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 56 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 57 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 58 [00:01:28.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 59 [00:01:30.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 60 [00:01:31.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 61 [00:01:32.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before running timeout callbacks +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number }var T2: string; + + +Info 62 [00:01:36.000] Running: /a/b/tsconfig.json +Info 63 [00:01:37.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 64 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 65 [00:01:39.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 66 [00:01:40.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 67 [00:01:41.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 68 [00:01:42.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 69 [00:01:43.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 70 [00:01:44.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 71 [00:01:45.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 72 [00:01:46.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 73 [00:01:47.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 74 [00:01:48.000] Project '/a/b/tsconfig.json' (Configured) +Info 75 [00:01:49.000] Files (6) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }var T2: string;" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 76 [00:01:50.000] ----------------------------------------------- +Info 77 [00:01:51.000] Running: *ensureProjectForOpenFiles* +Info 78 [00:01:52.000] Before ensureProjectForOpenFiles: +Info 79 [00:01:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 79 [00:01:54.000] Files (6) + +Info 79 [00:01:55.000] ----------------------------------------------- +Info 79 [00:01:56.000] Open files: +Info 79 [00:01:57.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 79 [00:01:58.000] Projects: /a/b/tsconfig.json +Info 79 [00:01:59.000] After ensureProjectForOpenFiles: +Info 80 [00:02:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 80 [00:02:01.000] Files (6) + +Info 80 [00:02:02.000] ----------------------------------------------- +Info 80 [00:02:03.000] Open files: +Info 80 [00:02:04.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 80 [00:02:05.000] Projects: /a/b/tsconfig.json +Info 80 [00:02:06.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 81 [00:02:07.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-return-cascaded-affected-file-list.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-return-cascaded-affected-file-list.js new file mode 100644 index 00000000000..524c821eb2a --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-return-cascaded-affected-file-list.js @@ -0,0 +1,418 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1Consumer1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1Consumer1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1Consumer1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1Consumer1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 12 [00:00:23.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 15 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 16 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 17 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 18 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 19 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 20 [00:00:31.000] Files (1) + /a/b/file1Consumer1.ts SVC-1-0 "import {Foo} from \"./moduleFile1\"; export var y = 10;" + + + file1Consumer1.ts + Matched by default include pattern '**/*' + +Info 21 [00:00:32.000] ----------------------------------------------- +Info 22 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 23 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":53,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 24 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1Consumer1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 25 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 25 [00:00:37.000] Files (1) + +Info 25 [00:00:38.000] ----------------------------------------------- +Info 25 [00:00:39.000] Open files: +Info 25 [00:00:40.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 25 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 25 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/modulefile1: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/b: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 26 [00:00:46.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 27 [00:00:47.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 28 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 29 [00:00:49.000] DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 30 [00:00:50.000] Scheduled: /a/b/tsconfig.json +Info 31 [00:00:51.000] Scheduled: *ensureProjectForOpenFiles* +Info 32 [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 33 [00:00:55.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 34 [00:00:56.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 35 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 36 [00:00:58.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 37 [00:00:59.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 38 [00:01:00.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 39 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:04.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 41 [00:01:05.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 42 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 43 [00:01:07.000] DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 44 [00:01:08.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 45 [00:01:09.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 46 [00:01:10.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/moduleFile2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 47 [00:01:13.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 48 [00:01:14.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 49 [00:01:15.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 50 [00:01:16.000] DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 51 [00:01:17.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 52 [00:01:18.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 53 [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file1Consumer1Consumer1.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:22.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 55 [00:01:23.000] Scheduled: /a/b/tsconfig.jsonFailedLookupInvalidation, Cancelled earlier one +Info 56 [00:01:24.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 57 [00:01:25.000] DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 58 [00:01:26.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 59 [00:01:27.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 60 [00:01:28.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/globalFile3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 61 [00:01:33.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 62 [00:01:34.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 63 [00:01:35.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 64 [00:01:36.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 65 [00:01:37.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export function Foo() { }; + +//// [/a/b/file1Consumer2.ts] +import {Foo} from "./moduleFile1"; let z = 10; + +//// [/a/b/moduleFile2.ts] +export var Foo4 = 10; + +//// [/a/b/file1Consumer1Consumer1.ts] +import {y} from "./file1Consumer1"; + +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number } + +//// [/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; } + + +PolledWatches:: +/a/b/modulefile1: + {"pollingInterval":500} +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 66 [00:01:39.000] Running: /a/b/tsconfig.jsonFailedLookupInvalidation +Info 67 [00:01:40.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 68 [00:01:41.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +After running timeout callbacks + +Before request + +Info 69 [00:01:42.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;", + "endLine": 1, + "endOffset": 53, + "line": 1, + "offset": 1 + }, + "seq": 2, + "type": "request" + } +Info 70 [00:01:43.000] response: + { + "responseRequired": false + } +After request + +Before running timeout callbacks + +Info 71 [00:01:44.000] Running: /a/b/tsconfig.json +Info 72 [00:01:45.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer1Consumer1.ts 500 undefined WatchType: Closed Script info +Info 73 [00:01:46.000] FileWatcher:: Added:: WatchInfo: /a/b/file1Consumer2.ts 500 undefined WatchType: Closed Script info +Info 74 [00:01:47.000] FileWatcher:: Added:: WatchInfo: /a/b/globalFile3.ts 500 undefined WatchType: Closed Script info +Info 75 [00:01:48.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 76 [00:01:49.000] FileWatcher:: Added:: WatchInfo: /a/b/moduleFile2.ts 500 undefined WatchType: Closed Script info +Info 77 [00:01:50.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 78 [00:01:51.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 79 [00:01:52.000] DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 80 [00:01:53.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/moduleFile1 1 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 81 [00:01:54.000] DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 82 [00:01:55.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b 0 undefined Project: /a/b/tsconfig.json WatchType: Failed Lookup Locations +Info 83 [00:01:56.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 84 [00:01:57.000] Project '/a/b/tsconfig.json' (Configured) +Info 85 [00:01:58.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-1 "export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-1 "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;;" + /a/b/file1Consumer1Consumer1.ts Text-1 "import {y} from \"./file1Consumer1\";" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + moduleFile1.ts + Imported via "./moduleFile1" from file 'file1Consumer1.ts' + Imported via "./moduleFile1" from file 'file1Consumer2.ts' + Matched by default include pattern '**/*' + file1Consumer1.ts + Matched by default include pattern '**/*' + Imported via "./file1Consumer1" from file 'file1Consumer1Consumer1.ts' + file1Consumer1Consumer1.ts + Matched by default include pattern '**/*' + file1Consumer2.ts + Matched by default include pattern '**/*' + globalFile3.ts + Matched by default include pattern '**/*' + moduleFile2.ts + Matched by default include pattern '**/*' + +Info 86 [00:01:59.000] ----------------------------------------------- +Info 87 [00:02:00.000] Running: *ensureProjectForOpenFiles* +Info 88 [00:02:01.000] Before ensureProjectForOpenFiles: +Info 89 [00:02:02.000] Project '/a/b/tsconfig.json' (Configured) +Info 89 [00:02:03.000] Files (7) + +Info 89 [00:02:04.000] ----------------------------------------------- +Info 89 [00:02:05.000] Open files: +Info 89 [00:02:06.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 89 [00:02:07.000] Projects: /a/b/tsconfig.json +Info 89 [00:02:08.000] After ensureProjectForOpenFiles: +Info 90 [00:02:09.000] Project '/a/b/tsconfig.json' (Configured) +Info 90 [00:02:10.000] Files (7) + +Info 90 [00:02:11.000] ----------------------------------------------- +Info 90 [00:02:12.000] Open files: +Info 90 [00:02:13.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 90 [00:02:14.000] Projects: /a/b/tsconfig.json +Info 90 [00:02:15.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 91 [00:02:16.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/modulefile1: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file1consumer1consumer1.ts: *new* + {} +/a/b/file1consumer2.ts: *new* + {} +/a/b/globalfile3.ts: *new* + {} +/a/b/modulefile1.ts: *new* + {} +/a/b/modulefile2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatches *deleted*:: +/a/b: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 92 [00:02:20.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 93 [00:02:21.000] Scheduled: /a/b/tsconfig.json +Info 94 [00:02:22.000] Scheduled: *ensureProjectForOpenFiles* +Info 95 [00:02:23.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + +Info 96 [00:02:24.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 97 [00:02:25.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 98 [00:02:26.000] Project '/a/b/tsconfig.json' (Configured) +Info 99 [00:02:27.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-2 "export var T: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-1 "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;;" + /a/b/file1Consumer1Consumer1.ts Text-1 "import {y} from \"./file1Consumer1\";" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 100 [00:02:28.000] ----------------------------------------------- +Info 101 [00:02:29.000] event: + {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/a/b/file1Consumer1.ts","diagnostics":[]}} +Info 102 [00:02:30.000] Running: /a/b/tsconfig.json +Info 103 [00:02:31.000] Running: *ensureProjectForOpenFiles* +Info 104 [00:02:32.000] Before ensureProjectForOpenFiles: +Info 105 [00:02:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 105 [00:02:34.000] Files (7) + +Info 105 [00:02:35.000] ----------------------------------------------- +Info 105 [00:02:36.000] Open files: +Info 105 [00:02:37.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 105 [00:02:38.000] Projects: /a/b/tsconfig.json +Info 105 [00:02:39.000] After ensureProjectForOpenFiles: +Info 106 [00:02:40.000] Project '/a/b/tsconfig.json' (Configured) +Info 106 [00:02:41.000] Files (7) + +Info 106 [00:02:42.000] ----------------------------------------------- +Info 106 [00:02:43.000] Open files: +Info 106 [00:02:44.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 106 [00:02:45.000] Projects: /a/b/tsconfig.json +Info 106 [00:02:46.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 107 [00:02:47.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks + +Before request + +Info 108 [00:02:48.000] request: + { + "command": "change", + "arguments": { + "file": "/a/b/file1Consumer1.ts", + "insertString": "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;export var T2: number;", + "endLine": 1, + "endOffset": 74, + "line": 1, + "offset": 1 + }, + "seq": 3, + "type": "request" + } +Info 109 [00:02:49.000] response: + { + "responseRequired": false + } +After request + +Info 110 [00:02:53.000] FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Info 111 [00:02:54.000] Scheduled: /a/b/tsconfig.json +Info 112 [00:02:55.000] Scheduled: *ensureProjectForOpenFiles* +Info 113 [00:02:56.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/moduleFile1.ts 1:: WatchInfo: /a/b/moduleFile1.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b/moduleFile1.ts] +export var T2: number;export function Foo() { }; + + +Info 114 [00:02:57.000] Running: /a/b/tsconfig.json +Info 115 [00:02:58.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 116 [00:02:59.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 4 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 117 [00:03:00.000] Project '/a/b/tsconfig.json' (Configured) +Info 118 [00:03:01.000] Files (7) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/moduleFile1.ts Text-3 "export var T2: number;export function Foo() { };" + /a/b/file1Consumer1.ts SVC-1-2 "import {Foo} from \"./moduleFile1\"; export var y = 10;export var T: number;export var T2: number;;;" + /a/b/file1Consumer1Consumer1.ts Text-1 "import {y} from \"./file1Consumer1\";" + /a/b/file1Consumer2.ts Text-1 "import {Foo} from \"./moduleFile1\"; let z = 10;" + /a/b/globalFile3.ts Text-1 "interface GlobalFoo { age: number }" + /a/b/moduleFile2.ts Text-1 "export var Foo4 = 10;" + +Info 119 [00:03:02.000] ----------------------------------------------- +Info 120 [00:03:03.000] Running: *ensureProjectForOpenFiles* +Info 121 [00:03:04.000] Before ensureProjectForOpenFiles: +Info 122 [00:03:05.000] Project '/a/b/tsconfig.json' (Configured) +Info 122 [00:03:06.000] Files (7) + +Info 122 [00:03:07.000] ----------------------------------------------- +Info 122 [00:03:08.000] Open files: +Info 122 [00:03:09.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 122 [00:03:10.000] Projects: /a/b/tsconfig.json +Info 122 [00:03:11.000] After ensureProjectForOpenFiles: +Info 123 [00:03:12.000] Project '/a/b/tsconfig.json' (Configured) +Info 123 [00:03:13.000] Files (7) + +Info 123 [00:03:14.000] ----------------------------------------------- +Info 123 [00:03:15.000] Open files: +Info 123 [00:03:16.000] FileName: /a/b/file1Consumer1.ts ProjectRootPath: undefined +Info 123 [00:03:17.000] Projects: /a/b/tsconfig.json +Info 123 [00:03:18.000] got projects updated in background, updating diagnostics for /a/b/file1Consumer1.ts +Info 124 [00:03:19.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1Consumer1.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-work-fine-for-files-with-circular-references.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-work-fine-for-files-with-circular-references.js new file mode 100644 index 00000000000..3d2489665a7 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-work-fine-for-files-with-circular-references.js @@ -0,0 +1,197 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1.ts] + + /// + export var t1 = 10; + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:13.000] Search path: /a/b +Info 3 [00:00:14.000] For info: /a/b/file1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:15.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:16.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:17.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1.ts to open"}} +Info 7 [00:00:18.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:21.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:22.000] FileWatcher:: Added:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 12 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 13 [00:00:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 15 [00:00:26.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 16 [00:00:27.000] Project '/a/b/tsconfig.json' (Configured) +Info 17 [00:00:28.000] Files (1) + /a/b/file1.ts SVC-1-0 "\n /// \n export var t1 = 10;" + + + file1.ts + Matched by default include pattern '**/*' + +Info 18 [00:00:29.000] ----------------------------------------------- +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":96,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 21 [00:00:32.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 22 [00:00:33.000] Project '/a/b/tsconfig.json' (Configured) +Info 22 [00:00:34.000] Files (1) + +Info 22 [00:00:35.000] ----------------------------------------------- +Info 22 [00:00:36.000] Open files: +Info 22 [00:00:37.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 22 [00:00:38.000] Projects: /a/b/tsconfig.json +Info 22 [00:00:39.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/file2.ts: *new* + {"pollingInterval":500} +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 23 [00:00:45.000] FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 24 [00:00:46.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 25 [00:00:47.000] Scheduled: /a/b/tsconfig.json +Info 26 [00:00:48.000] Scheduled: *ensureProjectForOpenFiles* +Info 27 [00:00:49.000] Elapsed:: *ms FileWatcher:: Triggered with /a/lib/lib.d.ts 0:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 28 [00:00:52.000] FileWatcher:: Triggered with /a/b/file2.ts 0:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 29 [00:00:53.000] FileWatcher:: Close:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 30 [00:00:54.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 31 [00:00:55.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 32 [00:00:56.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b/file2.ts 0:: WatchInfo: /a/b/file2.ts 500 undefined Project: /a/b/tsconfig.json WatchType: Missing file +Info 33 [00:00:57.000] DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 34 [00:00:58.000] Scheduled: /a/b/tsconfig.json, Cancelled earlier one +Info 35 [00:00:59.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 36 [00:01:00.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/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; } + +//// [/a/b/file2.ts] + + /// + export var t2 = 10;export var t3 = 10; + + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/b/file2.ts: + {"pollingInterval":500} +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 37 [00:01:05.000] Running: /a/b/tsconfig.json +Info 38 [00:01:06.000] FileWatcher:: Added:: WatchInfo: /a/b/file2.ts 500 undefined WatchType: Closed Script info +Info 39 [00:01:07.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 40 [00:01:08.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 41 [00:01:09.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 42 [00:01:10.000] Project '/a/b/tsconfig.json' (Configured) +Info 43 [00:01:11.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file2.ts Text-1 "\n /// \n export var t2 = 10;export var t3 = 10;" + /a/b/file1.ts SVC-1-0 "\n /// \n export var t1 = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file2.ts + Referenced via './file2.ts' from file 'file1.ts' + Matched by default include pattern '**/*' + file1.ts + Matched by default include pattern '**/*' + Referenced via './file1.ts' from file 'file2.ts' + +Info 44 [00:01:12.000] ----------------------------------------------- +Info 45 [00:01:13.000] Running: *ensureProjectForOpenFiles* +Info 46 [00:01:14.000] Before ensureProjectForOpenFiles: +Info 47 [00:01:15.000] Project '/a/b/tsconfig.json' (Configured) +Info 47 [00:01:16.000] Files (3) + +Info 47 [00:01:17.000] ----------------------------------------------- +Info 47 [00:01:18.000] Open files: +Info 47 [00:01:19.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 47 [00:01:20.000] Projects: /a/b/tsconfig.json +Info 47 [00:01:21.000] After ensureProjectForOpenFiles: +Info 48 [00:01:22.000] Project '/a/b/tsconfig.json' (Configured) +Info 48 [00:01:23.000] Files (3) + +Info 48 [00:01:24.000] ----------------------------------------------- +Info 48 [00:01:25.000] Open files: +Info 48 [00:01:26.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 48 [00:01:27.000] Projects: /a/b/tsconfig.json +Info 48 [00:01:28.000] got projects updated in background, updating diagnostics for /a/b/file1.ts +Info 49 [00:01:29.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/b/file2.ts: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when---out-is-set.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when---out-is-set.js new file mode 100644 index 00000000000..b9d0a831df2 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when---out-is-set.js @@ -0,0 +1,207 @@ +Info 0 [00:00:13.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] +export let x = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{"out":"/a/out.js"}} + +//// [/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; } + + +Info 1 [00:00:14.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:15.000] Search path: /a +Info 3 [00:00:16.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:17.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:19.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:20.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/lib/lib.d.ts" + ], + "options": { + "out": "/a/out.js", + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:21.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:24.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 12 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:27.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:28.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:29.000] Files (2) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:30.000] ----------------------------------------------- +Info 18 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/tsconfig.json"}} +Info 19 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":16,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"out":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/a.ts","configFile":"/a/tsconfig.json","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":26},"text":"Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '\"ignoreDeprecations\": \"5.0\"' to silence this error.\n Use 'outFile' instead.","code":5101,"category":"error","fileName":"/a/tsconfig.json"}]}} +Info 21 [00:00:34.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:35.000] Files (2) + +Info 21 [00:00:36.000] ----------------------------------------------- +Info 21 [00:00:37.000] Open files: +Info 21 [00:00:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:39.000] Projects: /a/tsconfig.json +Info 21 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Info 22 [00:00:43.000] DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:44.000] Scheduled: /a/tsconfig.json +Info 24 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b.ts] +export let y = 1 + + +Info 26 [00:00:47.000] Running: /a/tsconfig.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 29 [00:00:50.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:51.000] Project '/a/tsconfig.json' (Configured) +Info 31 [00:00:52.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-1 "export let y = 1" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:53.000] ----------------------------------------------- +Info 33 [00:00:54.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:55.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 35 [00:00:57.000] Files (3) + +Info 35 [00:00:58.000] ----------------------------------------------- +Info 35 [00:00:59.000] Open files: +Info 35 [00:01:00.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 35 [00:01:01.000] Projects: /a/tsconfig.json +Info 35 [00:01:02.000] After ensureProjectForOpenFiles: +Info 36 [00:01:03.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:01:04.000] Files (3) + +Info 36 [00:01:05.000] ----------------------------------------------- +Info 36 [00:01:06.000] Open files: +Info 36 [00:01:07.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 36 [00:01:08.000] Projects: /a/tsconfig.json +Info 36 [00:01:09.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 37 [00:01:10.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Info 38 [00:01:14.000] FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 39 [00:01:15.000] Scheduled: /a/tsconfig.json +Info 40 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles* +Info 41 [00:01:17.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b.ts] +export let x = 11 + + +Info 42 [00:01:18.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 43 [00:01:19.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 44 [00:01:20.000] Project '/a/tsconfig.json' (Configured) +Info 45 [00:01:21.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-2 "export let x = 11" + +Info 46 [00:01:22.000] ----------------------------------------------- +Info 47 [00:01:23.000] event: + {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/a/a.ts","diagnostics":[]}} +Info 48 [00:01:24.000] Running: /a/tsconfig.json +Info 49 [00:01:25.000] Running: *ensureProjectForOpenFiles* +Info 50 [00:01:26.000] Before ensureProjectForOpenFiles: +Info 51 [00:01:27.000] Project '/a/tsconfig.json' (Configured) +Info 51 [00:01:28.000] Files (3) + +Info 51 [00:01:29.000] ----------------------------------------------- +Info 51 [00:01:30.000] Open files: +Info 51 [00:01:31.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 51 [00:01:32.000] Projects: /a/tsconfig.json +Info 51 [00:01:33.000] After ensureProjectForOpenFiles: +Info 52 [00:01:34.000] Project '/a/tsconfig.json' (Configured) +Info 52 [00:01:35.000] Files (3) + +Info 52 [00:01:36.000] ----------------------------------------------- +Info 52 [00:01:37.000] Open files: +Info 52 [00:01:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 52 [00:01:39.000] Projects: /a/tsconfig.json +Info 52 [00:01:40.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 53 [00:01:41.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when---outFile-is-set.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when---outFile-is-set.js new file mode 100644 index 00000000000..31e3fe8b7bb --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when---outFile-is-set.js @@ -0,0 +1,207 @@ +Info 0 [00:00:13.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] +export let x = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{"outFile":"/a/out.js"}} + +//// [/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; } + + +Info 1 [00:00:14.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:15.000] Search path: /a +Info 3 [00:00:16.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:17.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:19.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:20.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/lib/lib.d.ts" + ], + "options": { + "outFile": "/a/out.js", + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:21.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:24.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 12 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:27.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:28.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:29.000] Files (2) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:30.000] ----------------------------------------------- +Info 18 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/tsconfig.json"}} +Info 19 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":16,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"outFile":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/a.ts","configFile":"/a/tsconfig.json","diagnostics":[]}} +Info 21 [00:00:34.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:35.000] Files (2) + +Info 21 [00:00:36.000] ----------------------------------------------- +Info 21 [00:00:37.000] Open files: +Info 21 [00:00:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:39.000] Projects: /a/tsconfig.json +Info 21 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Info 22 [00:00:43.000] DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:44.000] Scheduled: /a/tsconfig.json +Info 24 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b.ts] +export let y = 1 + + +Info 26 [00:00:47.000] Running: /a/tsconfig.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 29 [00:00:50.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:51.000] Project '/a/tsconfig.json' (Configured) +Info 31 [00:00:52.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-1 "export let y = 1" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:53.000] ----------------------------------------------- +Info 33 [00:00:54.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:55.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 35 [00:00:57.000] Files (3) + +Info 35 [00:00:58.000] ----------------------------------------------- +Info 35 [00:00:59.000] Open files: +Info 35 [00:01:00.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 35 [00:01:01.000] Projects: /a/tsconfig.json +Info 35 [00:01:02.000] After ensureProjectForOpenFiles: +Info 36 [00:01:03.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:01:04.000] Files (3) + +Info 36 [00:01:05.000] ----------------------------------------------- +Info 36 [00:01:06.000] Open files: +Info 36 [00:01:07.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 36 [00:01:08.000] Projects: /a/tsconfig.json +Info 36 [00:01:09.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 37 [00:01:10.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Info 38 [00:01:14.000] FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 39 [00:01:15.000] Scheduled: /a/tsconfig.json +Info 40 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles* +Info 41 [00:01:17.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b.ts] +export let x = 11 + + +Info 42 [00:01:18.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 43 [00:01:19.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 44 [00:01:20.000] Project '/a/tsconfig.json' (Configured) +Info 45 [00:01:21.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-2 "export let x = 11" + +Info 46 [00:01:22.000] ----------------------------------------------- +Info 47 [00:01:23.000] event: + {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/a/a.ts","diagnostics":[]}} +Info 48 [00:01:24.000] Running: /a/tsconfig.json +Info 49 [00:01:25.000] Running: *ensureProjectForOpenFiles* +Info 50 [00:01:26.000] Before ensureProjectForOpenFiles: +Info 51 [00:01:27.000] Project '/a/tsconfig.json' (Configured) +Info 51 [00:01:28.000] Files (3) + +Info 51 [00:01:29.000] ----------------------------------------------- +Info 51 [00:01:30.000] Open files: +Info 51 [00:01:31.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 51 [00:01:32.000] Projects: /a/tsconfig.json +Info 51 [00:01:33.000] After ensureProjectForOpenFiles: +Info 52 [00:01:34.000] Project '/a/tsconfig.json' (Configured) +Info 52 [00:01:35.000] Files (3) + +Info 52 [00:01:36.000] ----------------------------------------------- +Info 52 [00:01:37.000] Open files: +Info 52 [00:01:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 52 [00:01:39.000] Projects: /a/tsconfig.json +Info 52 [00:01:40.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 53 [00:01:41.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when-adding-new-file.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when-adding-new-file.js new file mode 100644 index 00000000000..b06cbbef5fb --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when-adding-new-file.js @@ -0,0 +1,235 @@ +Info 0 [00:00:15.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/b/file1.ts] +export var x = 10; + +//// [/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; } + +//// [/a/b/tsconfig.json] +{} + + +Info 1 [00:00:16.000] request: + { + "command": "open", + "arguments": { + "file": "/a/b/file1.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:17.000] Search path: /a/b +Info 3 [00:00:18.000] For info: /a/b/file1.ts :: Config file name: /a/b/tsconfig.json +Info 4 [00:00:19.000] Creating configuration project /a/b/tsconfig.json +Info 5 [00:00:20.000] FileWatcher:: Added:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file +Info 6 [00:00:21.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/b/tsconfig.json","reason":"Creating possible configured project for /a/b/file1.ts to open"}} +Info 7 [00:00:22.000] Config: /a/b/tsconfig.json : { + "rootNames": [ + "/a/b/file1.ts" + ], + "options": { + "configFilePath": "/a/b/tsconfig.json" + } +} +Info 8 [00:00:23.000] DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:24.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:25.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 11 [00:00:26.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 12 [00:00:27.000] DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 13 [00:00:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/node_modules/@types 1 undefined Project: /a/b/tsconfig.json WatchType: Type roots +Info 14 [00:00:29.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:30.000] Project '/a/b/tsconfig.json' (Configured) +Info 16 [00:00:31.000] Files (2) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1.ts SVC-1-0 "export var x = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:32.000] ----------------------------------------------- +Info 18 [00:00:33.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/b/tsconfig.json"}} +Info 19 [00:00:34.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e10a1dc99ee63f16cb9b69bcee75540cdf41a1137371d3afbd4e7de507be5207","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":18,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:35.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/b/file1.ts","configFile":"/a/b/tsconfig.json","diagnostics":[]}} +Info 21 [00:00:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 21 [00:00:37.000] Files (2) + +Info 21 [00:00:38.000] ----------------------------------------------- +Info 21 [00:00:39.000] Open files: +Info 21 [00:00:40.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 21 [00:00:41.000] Projects: /a/b/tsconfig.json +Info 21 [00:00:42.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/b/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: *new* + {} + +Info 22 [00:00:45.000] DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:46.000] Scheduled: /a/b/tsconfig.json +Info 24 [00:00:47.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:48.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file2.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/file2.ts] +export var y = 10; + + +Info 26 [00:00:49.000] Running: /a/b/tsconfig.json +Info 27 [00:00:50.000] FileWatcher:: Added:: WatchInfo: /a/b/file2.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:51.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 29 [00:00:52.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:53.000] Project '/a/b/tsconfig.json' (Configured) +Info 31 [00:00:54.000] Files (3) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1.ts SVC-1-0 "export var x = 10;" + /a/b/file2.ts Text-1 "export var y = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + file2.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:55.000] ----------------------------------------------- +Info 33 [00:00:56.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:57.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:58.000] Project '/a/b/tsconfig.json' (Configured) +Info 35 [00:00:59.000] Files (3) + +Info 35 [00:01:00.000] ----------------------------------------------- +Info 35 [00:01:01.000] Open files: +Info 35 [00:01:02.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 35 [00:01:03.000] Projects: /a/b/tsconfig.json +Info 35 [00:01:04.000] After ensureProjectForOpenFiles: +Info 36 [00:01:05.000] Project '/a/b/tsconfig.json' (Configured) +Info 36 [00:01:06.000] Files (3) + +Info 36 [00:01:07.000] ----------------------------------------------- +Info 36 [00:01:08.000] Open files: +Info 36 [00:01:09.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 36 [00:01:10.000] Projects: /a/b/tsconfig.json +Info 36 [00:01:11.000] got projects updated in background, updating diagnostics for /a/b/file1.ts +Info 37 [00:01:12.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b/file2.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} + +Info 38 [00:01:15.000] DirectoryWatcher:: Triggered with /a/b/file3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Info 39 [00:01:16.000] Scheduled: /a/b/tsconfig.json +Info 40 [00:01:17.000] Scheduled: *ensureProjectForOpenFiles* +Info 41 [00:01:18.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b/file3.ts :: WatchInfo: /a/b 1 undefined Config: /a/b/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b/file3.ts] +export var z = 10; + + +Info 42 [00:01:19.000] FileWatcher:: Added:: WatchInfo: /a/b/file3.ts 500 undefined WatchType: Closed Script info +Info 43 [00:01:20.000] Starting updateGraphWorker: Project: /a/b/tsconfig.json +Info 44 [00:01:21.000] Finishing updateGraphWorker: Project: /a/b/tsconfig.json Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 45 [00:01:22.000] Project '/a/b/tsconfig.json' (Configured) +Info 46 [00:01:23.000] Files (4) + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b/file1.ts SVC-1-0 "export var x = 10;" + /a/b/file2.ts Text-1 "export var y = 10;" + /a/b/file3.ts Text-1 "export var z = 10;" + + + ../lib/lib.d.ts + Default library for target 'es5' + file1.ts + Matched by default include pattern '**/*' + file2.ts + Matched by default include pattern '**/*' + file3.ts + Matched by default include pattern '**/*' + +Info 47 [00:01:24.000] ----------------------------------------------- +Info 48 [00:01:25.000] event: + {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/a/b/file1.ts","diagnostics":[]}} +Info 49 [00:01:26.000] Running: /a/b/tsconfig.json +Info 50 [00:01:27.000] Running: *ensureProjectForOpenFiles* +Info 51 [00:01:28.000] Before ensureProjectForOpenFiles: +Info 52 [00:01:29.000] Project '/a/b/tsconfig.json' (Configured) +Info 52 [00:01:30.000] Files (4) + +Info 52 [00:01:31.000] ----------------------------------------------- +Info 52 [00:01:32.000] Open files: +Info 52 [00:01:33.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 52 [00:01:34.000] Projects: /a/b/tsconfig.json +Info 52 [00:01:35.000] After ensureProjectForOpenFiles: +Info 53 [00:01:36.000] Project '/a/b/tsconfig.json' (Configured) +Info 53 [00:01:37.000] Files (4) + +Info 53 [00:01:38.000] ----------------------------------------------- +Info 53 [00:01:39.000] Open files: +Info 53 [00:01:40.000] FileName: /a/b/file1.ts ProjectRootPath: undefined +Info 53 [00:01:41.000] Projects: /a/b/tsconfig.json +Info 53 [00:01:42.000] got projects updated in background, updating diagnostics for /a/b/file1.ts +Info 54 [00:01:43.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/b/file1.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/b/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/b/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b/file2.ts: + {} +/a/b/file3.ts: *new* + {} + +FsWatchesRecursive:: +/a/b: + {} diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when-both-options-are-not-set.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when-both-options-are-not-set.js new file mode 100644 index 00000000000..81c301879c4 --- /dev/null +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-when-both-options-are-not-set.js @@ -0,0 +1,206 @@ +Info 0 [00:00:13.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] +export let x = 1 + +//// [/a/tsconfig.json] +{"compilerOptions":{}} + +//// [/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; } + + +Info 1 [00:00:14.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:15.000] Search path: /a +Info 3 [00:00:16.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 4 [00:00:17.000] Creating configuration project /a/tsconfig.json +Info 5 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 6 [00:00:19.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:20.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts", + "/a/lib/lib.d.ts" + ], + "options": { + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:21.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 10 [00:00:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:24.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 12 [00:00:25.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 13 [00:00:26.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 14 [00:00:27.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:28.000] Project '/a/tsconfig.json' (Configured) +Info 16 [00:00:29.000] Files (2) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:30.000] ----------------------------------------------- +Info 18 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/tsconfig.json"}} +Info 19 [00:00:32.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":16,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/a.ts","configFile":"/a/tsconfig.json","diagnostics":[]}} +Info 21 [00:00:34.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:35.000] Files (2) + +Info 21 [00:00:36.000] ----------------------------------------------- +Info 21 [00:00:37.000] Open files: +Info 21 [00:00:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:39.000] Projects: /a/tsconfig.json +Info 21 [00:00:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} +/a/lib/lib.d.ts: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Info 22 [00:00:43.000] DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 23 [00:00:44.000] Scheduled: /a/tsconfig.json +Info 24 [00:00:45.000] Scheduled: *ensureProjectForOpenFiles* +Info 25 [00:00:46.000] Elapsed:: *ms DirectoryWatcher:: Triggered with /a/b.ts :: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Before running timeout callbacks +//// [/a/b.ts] +export let y = 1 + + +Info 26 [00:00:47.000] Running: /a/tsconfig.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 29 [00:00:50.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 2 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 30 [00:00:51.000] Project '/a/tsconfig.json' (Configured) +Info 31 [00:00:52.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-1 "export let y = 1" + + + a.ts + Matched by default include pattern '**/*' + lib/lib.d.ts + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 32 [00:00:53.000] ----------------------------------------------- +Info 33 [00:00:54.000] Running: *ensureProjectForOpenFiles* +Info 34 [00:00:55.000] Before ensureProjectForOpenFiles: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 35 [00:00:57.000] Files (3) + +Info 35 [00:00:58.000] ----------------------------------------------- +Info 35 [00:00:59.000] Open files: +Info 35 [00:01:00.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 35 [00:01:01.000] Projects: /a/tsconfig.json +Info 35 [00:01:02.000] After ensureProjectForOpenFiles: +Info 36 [00:01:03.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:01:04.000] Files (3) + +Info 36 [00:01:05.000] ----------------------------------------------- +Info 36 [00:01:06.000] Open files: +Info 36 [00:01:07.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 36 [00:01:08.000] Projects: /a/tsconfig.json +Info 36 [00:01:09.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 37 [00:01:10.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks + +PolledWatches:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/lib/lib.d.ts: + {} +/a/b.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Info 38 [00:01:14.000] FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Info 39 [00:01:15.000] Scheduled: /a/tsconfig.json +Info 40 [00:01:16.000] Scheduled: *ensureProjectForOpenFiles* +Info 41 [00:01:17.000] Elapsed:: *ms FileWatcher:: Triggered with /a/b.ts 1:: WatchInfo: /a/b.ts 500 undefined WatchType: Closed Script info +Before running timeout callbacks +//// [/a/b.ts] +export let x = 11 + + +Info 42 [00:01:18.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 43 [00:01:19.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info 44 [00:01:20.000] Project '/a/tsconfig.json' (Configured) +Info 45 [00:01:21.000] Files (3) + /a/a.ts SVC-1-0 "export let x = 1" + /a/lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }" + /a/b.ts Text-2 "export let x = 11" + +Info 46 [00:01:22.000] ----------------------------------------------- +Info 47 [00:01:23.000] event: + {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/a/a.ts","diagnostics":[]}} +Info 48 [00:01:24.000] Running: /a/tsconfig.json +Info 49 [00:01:25.000] Running: *ensureProjectForOpenFiles* +Info 50 [00:01:26.000] Before ensureProjectForOpenFiles: +Info 51 [00:01:27.000] Project '/a/tsconfig.json' (Configured) +Info 51 [00:01:28.000] Files (3) + +Info 51 [00:01:29.000] ----------------------------------------------- +Info 51 [00:01:30.000] Open files: +Info 51 [00:01:31.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 51 [00:01:32.000] Projects: /a/tsconfig.json +Info 51 [00:01:33.000] After ensureProjectForOpenFiles: +Info 52 [00:01:34.000] Project '/a/tsconfig.json' (Configured) +Info 52 [00:01:35.000] Files (3) + +Info 52 [00:01:36.000] ----------------------------------------------- +Info 52 [00:01:37.000] Open files: +Info 52 [00:01:38.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 52 [00:01:39.000] Projects: /a/tsconfig.json +Info 52 [00:01:40.000] got projects updated in background, updating diagnostics for /a/a.ts +Info 53 [00:01:41.000] event: + {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/a/a.ts"]}} +After running timeout callbacks diff --git a/tests/baselines/reference/tsserver/telemetry/counts-files-by-extension.js b/tests/baselines/reference/tsserver/telemetry/counts-files-by-extension.js new file mode 100644 index 00000000000..c7e71e0d1c3 --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/counts-files-by-extension.js @@ -0,0 +1,133 @@ +Info 0 [00:00:25.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/src/ts.ts] + + +//// [/src/tsx.tsx] + + +//// [/src/moo.ts] + + +//// [/src/dts.d.ts] + + +//// [/src/jsx.jsx] + + +//// [/src/js.js] + + +//// [/src/badExtension.badExtension] + + +//// [/bin/ts.js] + + +//// [/tsconfig.json] +{"compilerOptions":{"allowJs":true},"include":["src"]} + + +Info 1 [00:00:26.000] request: + { + "command": "open", + "arguments": { + "file": "/src/ts.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:27.000] Search path: /src +Info 3 [00:00:28.000] For info: /src/ts.ts :: Config file name: /tsconfig.json +Info 4 [00:00:29.000] Creating configuration project /tsconfig.json +Info 5 [00:00:30.000] FileWatcher:: Added:: WatchInfo: /tsconfig.json 2000 undefined Project: /tsconfig.json WatchType: Config file +Info 6 [00:00:31.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/tsconfig.json","reason":"Creating possible configured project for /src/ts.ts to open"}} +Info 7 [00:00:32.000] Config: /tsconfig.json : { + "rootNames": [ + "/src/dts.d.ts", + "/src/js.js", + "/src/jsx.jsx", + "/src/moo.ts", + "/src/ts.ts", + "/src/tsx.tsx" + ], + "options": { + "allowJs": true, + "configFilePath": "/tsconfig.json" + } +} +Info 8 [00:00:33.000] DirectoryWatcher:: Added:: WatchInfo: /src 1 undefined Config: /tsconfig.json WatchType: Wild card directory +Info 9 [00:00:34.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /src 1 undefined Config: /tsconfig.json WatchType: Wild card directory +Info 10 [00:00:35.000] FileWatcher:: Added:: WatchInfo: /src/dts.d.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:36.000] FileWatcher:: Added:: WatchInfo: /src/js.js 500 undefined WatchType: Closed Script info +Info 12 [00:00:37.000] FileWatcher:: Added:: WatchInfo: /src/jsx.jsx 500 undefined WatchType: Closed Script info +Info 13 [00:00:38.000] FileWatcher:: Added:: WatchInfo: /src/moo.ts 500 undefined WatchType: Closed Script info +Info 14 [00:00:39.000] FileWatcher:: Added:: WatchInfo: /src/tsx.tsx 500 undefined WatchType: Closed Script info +Info 15 [00:00:40.000] Starting updateGraphWorker: Project: /tsconfig.json +Info 16 [00:00:41.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /tsconfig.json WatchType: Missing file +Info 17 [00:00:42.000] Finishing updateGraphWorker: Project: /tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 18 [00:00:43.000] Project '/tsconfig.json' (Configured) +Info 19 [00:00:44.000] Files (6) + /src/dts.d.ts Text-1 "" + /src/js.js Text-1 "" + /src/jsx.jsx Text-1 "" + /src/moo.ts Text-1 "" + /src/ts.ts SVC-1-0 "" + /src/tsx.tsx Text-1 "" + + + src/dts.d.ts + Matched by include pattern 'src' in 'tsconfig.json' + src/js.js + Matched by include pattern 'src' in 'tsconfig.json' + src/jsx.jsx + Matched by include pattern 'src' in 'tsconfig.json' + src/moo.ts + Matched by include pattern 'src' in 'tsconfig.json' + src/ts.ts + Matched by include pattern 'src' in 'tsconfig.json' + src/tsx.tsx + Matched by include pattern 'src' in 'tsconfig.json' + +Info 20 [00:00:45.000] ----------------------------------------------- +Info 21 [00:00:46.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/tsconfig.json"}} +Info 22 [00:00:47.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"aace87d7c1572ff43c6978074161b586788b4518c7a9d06c79c03e613b6ce5a3","fileStats":{"js":1,"jsSize":0,"jsx":1,"jsxSize":0,"ts":2,"tsSize":0,"tsx":1,"tsxSize":0,"dts":1,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":true,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 23 [00:00:48.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/src/ts.ts","configFile":"/tsconfig.json","diagnostics":[{"text":"Cannot write file '/src/js.js' because it would overwrite input file.","code":5055,"category":"error"},{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 24 [00:00:49.000] Project '/tsconfig.json' (Configured) +Info 24 [00:00:50.000] Files (6) + +Info 24 [00:00:51.000] ----------------------------------------------- +Info 24 [00:00:52.000] Open files: +Info 24 [00:00:53.000] FileName: /src/ts.ts ProjectRootPath: undefined +Info 24 [00:00:54.000] Projects: /tsconfig.json +Info 24 [00:00:55.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/tsconfig.json: *new* + {} +/src/dts.d.ts: *new* + {} +/src/js.js: *new* + {} +/src/jsx.jsx: *new* + {} +/src/moo.ts: *new* + {} +/src/tsx.tsx: *new* + {} + +FsWatchesRecursive:: +/src: *new* + {} diff --git a/tests/baselines/reference/tsserver/telemetry/detects-whether-language-service-was-disabled.js b/tests/baselines/reference/tsserver/telemetry/detects-whether-language-service-was-disabled.js new file mode 100644 index 00000000000..7f5ed754b03 --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/detects-whether-language-service-was-disabled.js @@ -0,0 +1,81 @@ +Info 0 [00:00:07.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/jsconfig.json] +{} + +//// [/a.js] + + + +Info 1 [00:00:08.000] request: + { + "command": "open", + "arguments": { + "file": "/a.js" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:09.000] Search path: / +Info 3 [00:00:10.000] For info: /a.js :: Config file name: /jsconfig.json +Info 4 [00:00:11.000] Creating configuration project /jsconfig.json +Info 5 [00:00:12.000] FileWatcher:: Added:: WatchInfo: /jsconfig.json 2000 undefined Project: /jsconfig.json WatchType: Config file +Info 6 [00:00:13.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/jsconfig.json","reason":"Creating possible configured project for /a.js to open"}} +Info 7 [00:00:14.000] Config: /jsconfig.json : { + "rootNames": [ + "/a.js" + ], + "options": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "/jsconfig.json" + } +} +Info 8 [00:00:15.000] Non TS file size exceeded limit (20971521). Largest files: /a.js:20971521 +Info 9 [00:00:16.000] event: + {"seq":0,"type":"event","event":"projectLanguageServiceState","body":{"projectName":"/jsconfig.json","languageServiceEnabled":false}} +Info 10 [00:00:17.000] Starting updateGraphWorker: Project: /jsconfig.json +Info 11 [00:00:18.000] Skipped loading contents of large file /a.js for info /a.js: fileSize: 20971521 +Info 12 [00:00:19.000] event: + {"seq":0,"type":"event","event":"largeFileReferenced","body":{"file":"/a.js","fileSize":20971521,"maxFileSize":4194304}} +Info 13 [00:00:20.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /jsconfig.json WatchType: Missing file +Info 14 [00:00:21.000] Finishing updateGraphWorker: Project: /jsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 15 [00:00:22.000] Project '/jsconfig.json' (Configured) +Info 16 [00:00:23.000] Files (1) + /a.js SVC-1-0 "" + + + a.js + Matched by default include pattern '**/*' + +Info 17 [00:00:24.000] ----------------------------------------------- +Info 18 [00:00:25.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/jsconfig.json"}} +Info 19 [00:00:26.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"d3f7418c3d4888d0a51e42716b5a330dab4da64c452eebe918c1e0e634d8ede1","fileStats":{"js":1,"jsSize":20971521,"jsx":0,"jsxSize":0,"ts":0,"tsSize":0,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true},"typeAcquisition":{"enable":true,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"jsconfig.json","projectType":"configured","languageServiceEnabled":false,"version":"FakeVersion"}}} +Info 20 [00:00:27.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a.js","configFile":"/jsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 21 [00:00:28.000] Project '/jsconfig.json' (Configured) +Info 21 [00:00:29.000] Files (1) + +Info 21 [00:00:30.000] ----------------------------------------------- +Info 21 [00:00:31.000] Open files: +Info 21 [00:00:32.000] FileName: /a.js ProjectRootPath: undefined +Info 21 [00:00:33.000] Projects: /jsconfig.json +Info 21 [00:00:34.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: *new* + {} diff --git a/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js new file mode 100644 index 00000000000..4e0263546cd --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js @@ -0,0 +1,110 @@ +Info 0 [00:00:07.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a.ts] + + +//// [/tsconfig.json] +{"compilerOptions":{"project":"","outFile":"hunter2.js","outDir":"hunter2","rootDir":"hunter2","baseUrl":"hunter2","rootDirs":["hunter2"],"typeRoots":["hunter2"],"types":["hunter2"],"sourceRoot":"hunter2","mapRoot":"hunter2","jsxFactory":"hunter2","out":"hunter2","reactNamespace":"hunter2","charset":"hunter2","locale":"hunter2","declarationDir":"hunter2","paths":{"*":["hunter2"]},"declaration":true,"lib":["es6","dom","hunter2"],"checkJs":"hunter2","unknownCompilerOption":"hunter2"},"files":["/a.ts"]} + + +Info 1 [00:00:08.000] request: + { + "command": "open", + "arguments": { + "file": "/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:09.000] Search path: / +Info 3 [00:00:10.000] For info: /a.ts :: Config file name: /tsconfig.json +Info 4 [00:00:11.000] Creating configuration project /tsconfig.json +Info 5 [00:00:12.000] FileWatcher:: Added:: WatchInfo: /tsconfig.json 2000 undefined Project: /tsconfig.json WatchType: Config file +Info 6 [00:00:13.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/tsconfig.json","reason":"Creating possible configured project for /a.ts to open"}} +Info 7 [00:00:14.000] Config: /tsconfig.json : { + "rootNames": [ + "/a.ts" + ], + "options": { + "project": "/", + "outFile": "/hunter2.js", + "outDir": "/hunter2", + "rootDir": "/hunter2", + "baseUrl": "/hunter2", + "rootDirs": [ + "/hunter2" + ], + "typeRoots": [ + "/hunter2" + ], + "types": [ + "hunter2" + ], + "sourceRoot": "hunter2", + "mapRoot": "hunter2", + "jsxFactory": "hunter2", + "out": "hunter2", + "reactNamespace": "hunter2", + "charset": "hunter2", + "locale": "hunter2", + "declarationDir": "/hunter2", + "paths": { + "*": [ + "hunter2" + ] + }, + "declaration": true, + "lib": [ + "lib.es2015.d.ts", + "lib.dom.d.ts" + ], + "pathsBasePath": "/", + "configFilePath": "/tsconfig.json" + } +} +Info 8 [00:00:15.000] Starting updateGraphWorker: Project: /tsconfig.json +Info 9 [00:00:16.000] DirectoryWatcher:: Added:: WatchInfo: /hunter2 1 undefined Project: /tsconfig.json WatchType: Failed Lookup Locations +Info 10 [00:00:17.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /hunter2 1 undefined Project: /tsconfig.json WatchType: Failed Lookup Locations +Info 11 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.es2015.d.ts 500 undefined Project: /tsconfig.json WatchType: Missing file +Info 12 [00:00:19.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.dom.d.ts 500 undefined Project: /tsconfig.json WatchType: Missing file +Info 13 [00:00:20.000] Finishing updateGraphWorker: Project: /tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 14 [00:00:21.000] Project '/tsconfig.json' (Configured) +Info 15 [00:00:22.000] Files (1) + /a.ts SVC-1-0 "" + + + a.ts + Part of 'files' list in tsconfig.json + +Info 16 [00:00:23.000] ----------------------------------------------- +Info 17 [00:00:24.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/tsconfig.json"}} +Info 18 [00:00:25.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"aace87d7c1572ff43c6978074161b586788b4518c7a9d06c79c03e613b6ce5a3","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":0,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"project":"","outFile":"","outDir":"","rootDir":"","baseUrl":"","rootDirs":[""],"typeRoots":[""],"types":[""],"sourceRoot":"","mapRoot":"","jsxFactory":"","out":"","reactNamespace":"","charset":"","locale":"","declarationDir":"","paths":"","declaration":true,"lib":["es6","dom"]},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":true,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 19 [00:00:26.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a.ts","configFile":"/tsconfig.json","diagnostics":[{"text":"Cannot find type definition file for 'hunter2'.\n The file is in the program because:\n Entry point of type library 'hunter2' specified in compilerOptions","code":2688,"category":"error","relatedInformation":[{"span":{"start":{"line":1,"offset":172},"end":{"line":1,"offset":181},"file":"/tsconfig.json"},"message":"File is entry point of type library specified here.","category":"message","code":1419}]},{"text":"File '/a/lib/lib.dom.d.ts' not found.\n The file is in the program because:\n Library 'lib.dom.d.ts' specified in compilerOptions","code":6053,"category":"error"},{"text":"File '/a/lib/lib.es2015.d.ts' not found.\n The file is in the program because:\n Library 'lib.es2015.d.ts' specified in compilerOptions","code":6053,"category":"error"},{"text":"File '/a.ts' is not under 'rootDir' '/hunter2'. 'rootDir' is expected to contain all source files.\n The file is in the program because:\n Part of 'files' list in tsconfig.json","code":6059,"category":"error","relatedInformation":[{"span":{"start":{"line":1,"offset":497},"end":{"line":1,"offset":504},"file":"/tsconfig.json"},"message":"File is matched by 'files' list specified here.","category":"message","code":1410}]},{"start":{"line":1,"offset":34},"end":{"line":1,"offset":43},"text":"Option 'out' cannot be specified with option 'outFile'.","code":5053,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":183},"end":{"line":1,"offset":195},"text":"Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.","code":5051,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":206},"end":{"line":1,"offset":215},"text":"Option 'mapRoot' cannot be specified without specifying option 'sourceMap' or option 'declarationMap'.","code":5069,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":226},"end":{"line":1,"offset":238},"text":"Option 'reactNamespace' cannot be specified with option 'jsxFactory'.","code":5053,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":249},"end":{"line":1,"offset":254},"text":"Option 'declarationDir' cannot be specified with option 'out'.","code":5053,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":249},"end":{"line":1,"offset":254},"text":"Option 'out' cannot be specified with option 'outFile'.","code":5053,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":249},"end":{"line":1,"offset":254},"text":"Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '\"ignoreDeprecations\": \"5.0\"' to silence this error.\n Use 'outFile' instead.","code":5101,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":265},"end":{"line":1,"offset":281},"text":"Option 'reactNamespace' cannot be specified with option 'jsxFactory'.","code":5053,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":292},"end":{"line":1,"offset":301},"text":"Option 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '\"ignoreDeprecations\": \"5.0\"' to silence this error.","code":5101,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":331},"end":{"line":1,"offset":347},"text":"Option 'declarationDir' cannot be specified with option 'out'.","code":5053,"category":"error","fileName":"/tsconfig.json"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"},{"start":{"line":1,"offset":422},"end":{"line":1,"offset":431},"text":"Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'decorators', 'decorators.legacy'.","code":6046,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":443},"end":{"line":1,"offset":452},"text":"Compiler option 'checkJs' requires a value of type boolean.","code":5024,"category":"error","fileName":"/tsconfig.json"},{"start":{"line":1,"offset":453},"end":{"line":1,"offset":476},"text":"Unknown compiler option 'unknownCompilerOption'.","code":5023,"category":"error","fileName":"/tsconfig.json"}]}} +Info 20 [00:00:27.000] Project '/tsconfig.json' (Configured) +Info 20 [00:00:28.000] Files (1) + +Info 20 [00:00:29.000] ----------------------------------------------- +Info 20 [00:00:30.000] Open files: +Info 20 [00:00:31.000] FileName: /a.ts ProjectRootPath: undefined +Info 20 [00:00:32.000] Projects: /tsconfig.json +Info 20 [00:00:33.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/hunter2: *new* + {"pollingInterval":500} +/a/lib/lib.es2015.d.ts: *new* + {"pollingInterval":500} +/a/lib/lib.dom.d.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/tsconfig.json: *new* + {} diff --git a/tests/baselines/reference/tsserver/telemetry/does-nothing-for-inferred-project.js b/tests/baselines/reference/tsserver/telemetry/does-nothing-for-inferred-project.js new file mode 100644 index 00000000000..f6fc923560c --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/does-nothing-for-inferred-project.js @@ -0,0 +1,92 @@ +Info 0 [00:00:05.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a.js] + + + +Info 1 [00:00:06.000] request: + { + "command": "open", + "arguments": { + "file": "/a.js" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:07.000] Search path: / +Info 3 [00:00:08.000] For info: /a.js :: No config files found. +Info 4 [00:00:09.000] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info 5 [00:00:10.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /dev/null/inferredProject1* WatchType: Missing file +Info 6 [00:00:11.000] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 7 [00:00:12.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 8 [00:00:13.000] Files (1) + /a.js SVC-1-0 "" + + + a.js + Root file specified for compilation + +Info 9 [00:00:14.000] ----------------------------------------------- +TI:: Creating typing installer + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +TI:: [00:00:15.000] Global cache location '/a/data/', safe file path '/safeList.json', types map path /typesMap.json +TI:: [00:00:16.000] Processing cache location '/a/data/' +TI:: [00:00:17.000] Trying to find '/a/data/package.json'... +TI:: [00:00:18.000] Finished processing cache location '/a/data/' +TI:: [00:00:19.000] Npm config file: /a/data/package.json +TI:: [00:00:20.000] Npm config file: '/a/data/package.json' is missing, creating new one... +TI:: [00:00:27.000] Updating types-registry npm package... +TI:: [00:00:28.000] npm install --ignore-scripts types-registry@latest +TI:: [00:00:35.000] TI:: Updated types-registry npm package +TI:: typing installer creation complete +//// [/a/data/package.json] +{ "private": true } + +//// [/a/data/node_modules/types-registry/index.json] +{ + "entries": {} +} + + +TI:: [00:00:36.000] Got install request {"projectName":"/dev/null/inferredProject1*","fileNames":["/a.js"],"compilerOptions":{"target":1,"jsx":1,"allowNonTsExtensions":true,"allowJs":true,"noEmitForJsFiles":true,"maxNodeModuleJsDepth":2},"typeAcquisition":{"enable":true,"include":[],"exclude":[]},"unresolvedImports":[],"projectRootPath":"/","cachePath":"/a/data/","kind":"discover"} +TI:: [00:00:37.000] Request specifies cache path '/a/data/', loading cached information... +TI:: [00:00:38.000] Processing cache location '/a/data/' +TI:: [00:00:39.000] Cache location was already processed... +TI:: [00:00:40.000] Failed to load safelist from types map file '/typesMap.json' +TI:: [00:00:41.000] Explicitly included types: [] +TI:: [00:00:42.000] Inferred typings from unresolved imports: [] +TI:: [00:00:43.000] Result: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:00:44.000] Finished typings discovery: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:00:45.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components +TI:: [00:00:46.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /dev/null/inferredProject1* watcher already invoked: false +TI:: [00:00:47.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /dev/null/inferredProject1* watcher already invoked: false +TI:: [00:00:48.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules +TI:: [00:00:49.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /dev/null/inferredProject1* watcher already invoked: false +TI:: [00:00:50.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /dev/null/inferredProject1* watcher already invoked: false +TI:: [00:00:51.000] Sending response: + {"projectName":"/dev/null/inferredProject1*","typeAcquisition":{"enable":true,"include":[],"exclude":[]},"compilerOptions":{"target":1,"jsx":1,"allowNonTsExtensions":true,"allowJs":true,"noEmitForJsFiles":true,"maxNodeModuleJsDepth":2},"typings":[],"unresolvedImports":[],"kind":"action::set"} +TI:: [00:00:52.000] No new typings were requested as a result of typings discovery +Info 10 [00:00:53.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 10 [00:00:54.000] Files (1) + +Info 10 [00:00:55.000] ----------------------------------------------- +Info 10 [00:00:56.000] Open files: +Info 10 [00:00:57.000] FileName: /a.js ProjectRootPath: undefined +Info 10 [00:00:58.000] Projects: /dev/null/inferredProject1* +Info 10 [00:00:59.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/bower_components: *new* + {"pollingInterval":500} +/node_modules: *new* + {"pollingInterval":500} diff --git a/tests/baselines/reference/tsserver/telemetry/even-for-project-with-ts-check-in-config.js b/tests/baselines/reference/tsserver/telemetry/even-for-project-with-ts-check-in-config.js new file mode 100644 index 00000000000..7409a7b6b68 --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/even-for-project-with-ts-check-in-config.js @@ -0,0 +1,180 @@ +Info 0 [00:00:07.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/jsconfig.json] +{"compilerOptions":{"checkJs":true}} + +//// [/a.js] + + + +Info 1 [00:00:08.000] request: + { + "command": "open", + "arguments": { + "file": "/a.js" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:09.000] Search path: / +Info 3 [00:00:10.000] For info: /a.js :: Config file name: /jsconfig.json +Info 4 [00:00:11.000] Creating configuration project /jsconfig.json +Info 5 [00:00:12.000] FileWatcher:: Added:: WatchInfo: /jsconfig.json 2000 undefined Project: /jsconfig.json WatchType: Config file +Info 6 [00:00:13.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/jsconfig.json","reason":"Creating possible configured project for /a.js to open"}} +Info 7 [00:00:14.000] Config: /jsconfig.json : { + "rootNames": [ + "/a.js" + ], + "options": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "checkJs": true, + "configFilePath": "/jsconfig.json" + } +} +Info 8 [00:00:15.000] DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 9 [00:00:16.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 10 [00:00:17.000] Starting updateGraphWorker: Project: /jsconfig.json +Info 11 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /jsconfig.json WatchType: Missing file +Info 12 [00:00:19.000] Finishing updateGraphWorker: Project: /jsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 13 [00:00:20.000] Project '/jsconfig.json' (Configured) +Info 14 [00:00:21.000] Files (1) + /a.js SVC-1-0 "" + + + a.js + Matched by default include pattern '**/*' + +Info 15 [00:00:22.000] ----------------------------------------------- +TI:: Creating typing installer + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: *new* + {} + +FsWatchesRecursive:: +/: *new* + {} + +TI:: [00:00:23.000] Global cache location '/a/data/', safe file path '/safeList.json', types map path /typesMap.json +TI:: [00:00:24.000] Processing cache location '/a/data/' +TI:: [00:00:25.000] Trying to find '/a/data/package.json'... +TI:: [00:00:26.000] Finished processing cache location '/a/data/' +TI:: [00:00:27.000] Npm config file: /a/data/package.json +TI:: [00:00:28.000] Npm config file: '/a/data/package.json' is missing, creating new one... +Info 16 [00:00:31.000] DirectoryWatcher:: Triggered with a :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 17 [00:00:32.000] Scheduled: /jsconfig.json +Info 18 [00:00:33.000] Scheduled: *ensureProjectForOpenFiles* +Info 19 [00:00:34.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 20 [00:00:37.000] DirectoryWatcher:: Triggered with a/data :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 21 [00:00:38.000] Scheduled: /jsconfig.json, Cancelled earlier one +Info 22 [00:00:39.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 23 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 24 [00:00:43.000] DirectoryWatcher:: Triggered with a/data/package.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 25 [00:00:44.000] Config: /jsconfig.json Detected new package.json: a/data/package.json +Info 26 [00:00:45.000] FileWatcher:: Added:: WatchInfo: /a/data/package.json 250 undefined WatchType: package.json file +Info 27 [00:00:46.000] Project: /jsconfig.json Detected file add/remove of non supported extension: a/data/package.json +Info 28 [00:00:47.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/package.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +TI:: [00:00:48.000] Updating types-registry npm package... +TI:: [00:00:49.000] npm install --ignore-scripts types-registry@latest +Info 29 [00:00:54.000] DirectoryWatcher:: Triggered with a/data/node_modules :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 30 [00:00:55.000] Scheduled: /jsconfig.json, Cancelled earlier one +Info 31 [00:00:56.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 32 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 33 [00:00:59.000] DirectoryWatcher:: Triggered with a/data/node_modules/types-registry :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 34 [00:01:00.000] Scheduled: /jsconfig.json, Cancelled earlier one +Info 35 [00:01:01.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 36 [00:01:02.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules/types-registry :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 37 [00:01:04.000] DirectoryWatcher:: Triggered with a/data/node_modules/types-registry/index.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 38 [00:01:05.000] Project: /jsconfig.json Detected file add/remove of non supported extension: a/data/node_modules/types-registry/index.json +Info 39 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules/types-registry/index.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +TI:: [00:01:07.000] TI:: Updated types-registry npm package +TI:: typing installer creation complete +//// [/a/data/package.json] +{ "private": true } + +//// [/a/data/node_modules/types-registry/index.json] +{ + "entries": {} +} + + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: + {} +/a/data/package.json: *new* + {} + +FsWatchesRecursive:: +/: + {} + +TI:: [00:01:08.000] Got install request {"projectName":"/jsconfig.json","fileNames":["/a.js"],"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"checkJs":true,"configFilePath":"/jsconfig.json","allowNonTsExtensions":true},"typeAcquisition":{"enable":true,"include":[],"exclude":[]},"unresolvedImports":[],"projectRootPath":"/","cachePath":"/a/data/","kind":"discover"} +TI:: [00:01:09.000] Request specifies cache path '/a/data/', loading cached information... +TI:: [00:01:10.000] Processing cache location '/a/data/' +TI:: [00:01:11.000] Cache location was already processed... +TI:: [00:01:12.000] Failed to load safelist from types map file '/typesMap.json' +TI:: [00:01:13.000] Explicitly included types: [] +TI:: [00:01:14.000] Inferred typings from unresolved imports: [] +TI:: [00:01:15.000] Result: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:01:16.000] Finished typings discovery: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:01:17.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components +TI:: [00:01:18.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:20.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules +TI:: [00:01:21.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:23.000] Sending response: + {"projectName":"/jsconfig.json","typeAcquisition":{"enable":true,"include":[],"exclude":[]},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"checkJs":true,"configFilePath":"/jsconfig.json","allowNonTsExtensions":true},"typings":[],"unresolvedImports":[],"kind":"action::set"} +TI:: [00:01:24.000] No new typings were requested as a result of typings discovery +Info 40 [00:01:25.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/jsconfig.json"}} +Info 41 [00:01:26.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"d3f7418c3d4888d0a51e42716b5a330dab4da64c452eebe918c1e0e634d8ede1","fileStats":{"js":1,"jsSize":0,"jsx":0,"jsxSize":0,"ts":0,"tsSize":0,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"checkJs":true},"typeAcquisition":{"enable":true,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"jsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 42 [00:01:27.000] Starting updateGraphWorker: Project: /jsconfig.json +Info 43 [00:01:28.000] Finishing updateGraphWorker: Project: /jsconfig.json Version: 2 structureChanged: false structureIsReused:: Not Elapsed:: *ms +Info 44 [00:01:29.000] Same program as before +Info 45 [00:01:30.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a.js","configFile":"/jsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 46 [00:01:31.000] Project '/jsconfig.json' (Configured) +Info 46 [00:01:32.000] Files (1) + +Info 46 [00:01:33.000] ----------------------------------------------- +Info 46 [00:01:34.000] Open files: +Info 46 [00:01:35.000] FileName: /a.js ProjectRootPath: undefined +Info 46 [00:01:36.000] Projects: /jsconfig.json +Info 46 [00:01:37.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/bower_components: *new* + {"pollingInterval":500} +/node_modules: *new* + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: + {} +/a/data/package.json: + {} + +FsWatchesRecursive:: +/: + {} diff --git a/tests/baselines/reference/tsserver/telemetry/not-for-ts-file.js b/tests/baselines/reference/tsserver/telemetry/not-for-ts-file.js new file mode 100644 index 00000000000..8a411b870a6 --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/not-for-ts-file.js @@ -0,0 +1,45 @@ +Info 0 [00:00:05.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a.ts] + + + +Info 1 [00:00:06.000] request: + { + "command": "open", + "arguments": { + "file": "/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:07.000] Search path: / +Info 3 [00:00:08.000] For info: /a.ts :: No config files found. +Info 4 [00:00:09.000] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info 5 [00:00:10.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /dev/null/inferredProject1* WatchType: Missing file +Info 6 [00:00:11.000] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 7 [00:00:12.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 8 [00:00:13.000] Files (1) + /a.ts SVC-1-0 "" + + + a.ts + Root file specified for compilation + +Info 9 [00:00:14.000] ----------------------------------------------- +Info 10 [00:00:15.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 10 [00:00:16.000] Files (1) + +Info 10 [00:00:17.000] ----------------------------------------------- +Info 10 [00:00:18.000] Open files: +Info 10 [00:00:19.000] FileName: /a.ts ProjectRootPath: undefined +Info 10 [00:00:20.000] Projects: /dev/null/inferredProject1* +Info 10 [00:00:21.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} diff --git a/tests/baselines/reference/tsserver/telemetry/only-sends-an-event-once.js b/tests/baselines/reference/tsserver/telemetry/only-sends-an-event-once.js new file mode 100644 index 00000000000..7fcbb95ba73 --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/only-sends-an-event-once.js @@ -0,0 +1,273 @@ +Info 0 [00:00:11.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a/a.ts] + + +//// [/b.ts] + + +//// [/a/tsconfig.json] +{} + + +Info 1 [00:00:12.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 1, + "type": "request" + } +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] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 7 [00:00:18.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts" + ], + "options": { + "configFilePath": "/a/tsconfig.json" + } +} +Info 8 [00:00:19.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 9 [00:00:20.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +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 (1) + /a/a.ts SVC-1-0 "" + + + a.ts + Matched by default include pattern '**/*' + +Info 17 [00:00:28.000] ----------------------------------------------- +Info 18 [00:00:29.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/tsconfig.json"}} +Info 19 [00:00:30.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":0,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 20 [00:00:31.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/a.ts","configFile":"/a/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 21 [00:00:32.000] Project '/a/tsconfig.json' (Configured) +Info 21 [00:00:33.000] Files (1) + +Info 21 [00:00:34.000] ----------------------------------------------- +Info 21 [00:00:35.000] Open files: +Info 21 [00:00:36.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 21 [00:00:37.000] Projects: /a/tsconfig.json +Info 21 [00:00:38.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} + +Before request + +Info 22 [00:00:39.000] request: + { + "command": "close", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 2, + "type": "request" + } +Info 23 [00:00:40.000] FileWatcher:: Added:: WatchInfo: /a/a.ts 500 undefined WatchType: Closed Script info +Info 24 [00:00:41.000] Project '/a/tsconfig.json' (Configured) +Info 24 [00:00:42.000] Files (1) + +Info 24 [00:00:43.000] ----------------------------------------------- +Info 24 [00:00:44.000] Open files: +Info 24 [00:00:45.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: + {} +/a/a.ts: *new* + {} + +FsWatchesRecursive:: +/a: + {} + +Before request + +Info 25 [00:00:46.000] request: + { + "command": "open", + "arguments": { + "file": "/b.ts" + }, + "seq": 3, + "type": "request" + } +Info 26 [00:00:47.000] Search path: / +Info 27 [00:00:48.000] For info: /b.ts :: No config files found. +Info 28 [00:00:49.000] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info 29 [00:00:50.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /dev/null/inferredProject1* WatchType: Missing file +Info 30 [00:00:51.000] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 31 [00:00:52.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 32 [00:00:53.000] Files (1) + /b.ts SVC-1-0 "" + + + b.ts + Root file specified for compilation + +Info 33 [00:00:54.000] ----------------------------------------------- +Info 34 [00:00:55.000] `remove Project:: +Info 35 [00:00:56.000] Project '/a/tsconfig.json' (Configured) +Info 36 [00:00:57.000] Files (1) + /a/a.ts + + + a.ts + Matched by default include pattern '**/*' + +Info 37 [00:00:58.000] ----------------------------------------------- +Info 38 [00:00:59.000] DirectoryWatcher:: Close:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 39 [00:01:00.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 40 [00:01:01.000] FileWatcher:: Close:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 41 [00:01:02.000] DirectoryWatcher:: Close:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 42 [00:01:03.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 43 [00:01:04.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/tsconfig.json WatchType: Missing file +Info 44 [00:01:05.000] FileWatcher:: Close:: WatchInfo: /a/a.ts 500 undefined WatchType: Closed Script info +Info 45 [00:01:06.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 45 [00:01:07.000] Files (1) + +Info 45 [00:01:08.000] ----------------------------------------------- +Info 45 [00:01:09.000] Open files: +Info 45 [00:01:10.000] FileName: /b.ts ProjectRootPath: undefined +Info 45 [00:01:11.000] Projects: /dev/null/inferredProject1* +Info 45 [00:01:12.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/a/node_modules/@types: + {"pollingInterval":500} + +FsWatches *deleted*:: +/a/tsconfig.json: + {} +/a/a.ts: + {} + +FsWatchesRecursive *deleted*:: +/a: + {} + +Before request + +Info 46 [00:01:13.000] request: + { + "command": "open", + "arguments": { + "file": "/a/a.ts" + }, + "seq": 4, + "type": "request" + } +Info 47 [00:01:14.000] Search path: /a +Info 48 [00:01:15.000] For info: /a/a.ts :: Config file name: /a/tsconfig.json +Info 49 [00:01:16.000] Creating configuration project /a/tsconfig.json +Info 50 [00:01:17.000] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file +Info 51 [00:01:18.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/a/tsconfig.json","reason":"Creating possible configured project for /a/a.ts to open"}} +Info 52 [00:01:19.000] Config: /a/tsconfig.json : { + "rootNames": [ + "/a/a.ts" + ], + "options": { + "configFilePath": "/a/tsconfig.json" + } +} +Info 53 [00:01:20.000] DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 54 [00:01:21.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory +Info 55 [00:01:22.000] Starting updateGraphWorker: Project: /a/tsconfig.json +Info 56 [00:01:23.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/tsconfig.json WatchType: Missing file +Info 57 [00:01:24.000] DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 58 [00:01:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/node_modules/@types 1 undefined Project: /a/tsconfig.json WatchType: Type roots +Info 59 [00:01:26.000] Finishing updateGraphWorker: Project: /a/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 60 [00:01:27.000] Project '/a/tsconfig.json' (Configured) +Info 61 [00:01:28.000] Files (1) + /a/a.ts SVC-2-0 "" + + + a.ts + Matched by default include pattern '**/*' + +Info 62 [00:01:29.000] ----------------------------------------------- +Info 63 [00:01:30.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/a/tsconfig.json"}} +Info 64 [00:01:31.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a/a.ts","configFile":"/a/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 65 [00:01:32.000] Project '/a/tsconfig.json' (Configured) +Info 65 [00:01:33.000] Files (1) + +Info 65 [00:01:34.000] ----------------------------------------------- +Info 65 [00:01:35.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 65 [00:01:36.000] Files (1) + +Info 65 [00:01:37.000] ----------------------------------------------- +Info 65 [00:01:38.000] Open files: +Info 65 [00:01:39.000] FileName: /b.ts ProjectRootPath: undefined +Info 65 [00:01:40.000] Projects: /dev/null/inferredProject1* +Info 65 [00:01:41.000] FileName: /a/a.ts ProjectRootPath: undefined +Info 65 [00:01:42.000] Projects: /a/tsconfig.json +Info 65 [00:01:43.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/a/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/a: *new* + {} diff --git a/tests/baselines/reference/tsserver/telemetry/sends-event-for-inferred-project.js b/tests/baselines/reference/tsserver/telemetry/sends-event-for-inferred-project.js new file mode 100644 index 00000000000..f2241158004 --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/sends-event-for-inferred-project.js @@ -0,0 +1,187 @@ +Info 0 [00:00:07.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a.js] +// @ts-check +const x = 0; + +//// [/b.js] + + + +Info 1 [00:00:08.000] request: + { + "command": "open", + "arguments": { + "file": "/a.js" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:09.000] Search path: / +Info 3 [00:00:10.000] For info: /a.js :: No config files found. +Info 4 [00:00:11.000] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info 5 [00:00:12.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /dev/null/inferredProject1* WatchType: Missing file +Info 6 [00:00:13.000] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 7 [00:00:14.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 8 [00:00:15.000] Files (1) + /a.js SVC-1-0 "// @ts-check\nconst x = 0;" + + + a.js + Root file specified for compilation + +Info 9 [00:00:16.000] ----------------------------------------------- +TI:: Creating typing installer + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +TI:: [00:00:17.000] Global cache location '/a/data/', safe file path '/safeList.json', types map path /typesMap.json +TI:: [00:00:18.000] Processing cache location '/a/data/' +TI:: [00:00:19.000] Trying to find '/a/data/package.json'... +TI:: [00:00:20.000] Finished processing cache location '/a/data/' +TI:: [00:00:21.000] Npm config file: /a/data/package.json +TI:: [00:00:22.000] Npm config file: '/a/data/package.json' is missing, creating new one... +TI:: [00:00:29.000] Updating types-registry npm package... +TI:: [00:00:30.000] npm install --ignore-scripts types-registry@latest +TI:: [00:00:37.000] TI:: Updated types-registry npm package +TI:: typing installer creation complete +//// [/a/data/package.json] +{ "private": true } + +//// [/a/data/node_modules/types-registry/index.json] +{ + "entries": {} +} + + +TI:: [00:00:38.000] Got install request {"projectName":"/dev/null/inferredProject1*","fileNames":["/a.js"],"compilerOptions":{"target":1,"jsx":1,"allowNonTsExtensions":true,"allowJs":true,"noEmitForJsFiles":true,"maxNodeModuleJsDepth":2},"typeAcquisition":{"enable":true,"include":[],"exclude":[]},"unresolvedImports":[],"projectRootPath":"/","cachePath":"/a/data/","kind":"discover"} +TI:: [00:00:39.000] Request specifies cache path '/a/data/', loading cached information... +TI:: [00:00:40.000] Processing cache location '/a/data/' +TI:: [00:00:41.000] Cache location was already processed... +TI:: [00:00:42.000] Failed to load safelist from types map file '/typesMap.json' +TI:: [00:00:43.000] Explicitly included types: [] +TI:: [00:00:44.000] Inferred typings from unresolved imports: [] +TI:: [00:00:45.000] Result: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:00:46.000] Finished typings discovery: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:00:47.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components +TI:: [00:00:48.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /dev/null/inferredProject1* watcher already invoked: false +TI:: [00:00:49.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /dev/null/inferredProject1* watcher already invoked: false +TI:: [00:00:50.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules +TI:: [00:00:51.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /dev/null/inferredProject1* watcher already invoked: false +TI:: [00:00:52.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /dev/null/inferredProject1* watcher already invoked: false +TI:: [00:00:53.000] Sending response: + {"projectName":"/dev/null/inferredProject1*","typeAcquisition":{"enable":true,"include":[],"exclude":[]},"compilerOptions":{"target":1,"jsx":1,"allowNonTsExtensions":true,"allowJs":true,"noEmitForJsFiles":true,"maxNodeModuleJsDepth":2},"typings":[],"unresolvedImports":[],"kind":"action::set"} +TI:: [00:00:54.000] No new typings were requested as a result of typings discovery +Info 10 [00:00:55.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 10 [00:00:56.000] Files (1) + +Info 10 [00:00:57.000] ----------------------------------------------- +Info 10 [00:00:58.000] Open files: +Info 10 [00:00:59.000] FileName: /a.js ProjectRootPath: undefined +Info 10 [00:01:00.000] Projects: /dev/null/inferredProject1* +Info 10 [00:01:01.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/bower_components: *new* + {"pollingInterval":500} +/node_modules: *new* + {"pollingInterval":500} + +Before request + +Info 11 [00:01:02.000] request: + { + "command": "open", + "arguments": { + "file": "/b.js" + }, + "seq": 2, + "type": "request" + } +Info 12 [00:01:03.000] Search path: / +Info 13 [00:01:04.000] For info: /b.js :: No config files found. +Info 14 [00:01:05.000] Starting updateGraphWorker: Project: /dev/null/inferredProject2* +Info 15 [00:01:06.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /dev/null/inferredProject2* WatchType: Missing file +Info 16 [00:01:07.000] Finishing updateGraphWorker: Project: /dev/null/inferredProject2* Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 17 [00:01:08.000] Project '/dev/null/inferredProject2*' (Inferred) +Info 18 [00:01:09.000] Files (1) + /b.js SVC-1-0 "" + + + b.js + Root file specified for compilation + +Info 19 [00:01:10.000] ----------------------------------------------- +TI:: [00:01:11.000] Got install request {"projectName":"/dev/null/inferredProject2*","fileNames":["/b.js"],"compilerOptions":{"target":1,"jsx":1,"allowNonTsExtensions":true,"allowJs":true,"noEmitForJsFiles":true,"maxNodeModuleJsDepth":2},"typeAcquisition":{"enable":true,"include":[],"exclude":[]},"unresolvedImports":[],"projectRootPath":"/","cachePath":"/a/data/","kind":"discover"} +TI:: [00:01:12.000] Request specifies cache path '/a/data/', loading cached information... +TI:: [00:01:13.000] Processing cache location '/a/data/' +TI:: [00:01:14.000] Cache location was already processed... +TI:: [00:01:15.000] Explicitly included types: [] +TI:: [00:01:16.000] Inferred typings from unresolved imports: [] +TI:: [00:01:17.000] Result: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:01:18.000] Finished typings discovery: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:01:19.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components +TI:: [00:01:20.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /dev/null/inferredProject2* watcher already invoked: false +TI:: [00:01:21.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /dev/null/inferredProject2* watcher already invoked: false +TI:: [00:01:22.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules +TI:: [00:01:23.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /dev/null/inferredProject2* watcher already invoked: false +TI:: [00:01:24.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /dev/null/inferredProject2* watcher already invoked: false +TI:: [00:01:25.000] Sending response: + {"projectName":"/dev/null/inferredProject2*","typeAcquisition":{"enable":true,"include":[],"exclude":[]},"compilerOptions":{"target":1,"jsx":1,"allowNonTsExtensions":true,"allowJs":true,"noEmitForJsFiles":true,"maxNodeModuleJsDepth":2},"typings":[],"unresolvedImports":[],"kind":"action::set"} +TI:: [00:01:26.000] No new typings were requested as a result of typings discovery +Info 20 [00:01:27.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 20 [00:01:28.000] Files (1) + +Info 20 [00:01:29.000] ----------------------------------------------- +Info 20 [00:01:30.000] Project '/dev/null/inferredProject2*' (Inferred) +Info 20 [00:01:31.000] Files (1) + +Info 20 [00:01:32.000] ----------------------------------------------- +Info 20 [00:01:33.000] Open files: +Info 20 [00:01:34.000] FileName: /a.js ProjectRootPath: undefined +Info 20 [00:01:35.000] Projects: /dev/null/inferredProject1* +Info 20 [00:01:36.000] FileName: /b.js ProjectRootPath: undefined +Info 20 [00:01:37.000] Projects: /dev/null/inferredProject2* +Info 20 [00:01:38.000] response: + { + "responseRequired": false + } +After request + +Before request + +Info 21 [00:01:39.000] request: + { + "command": "open", + "arguments": { + "file": "/b.js" + }, + "seq": 3, + "type": "request" + } +Info 22 [00:01:40.000] Project '/dev/null/inferredProject1*' (Inferred) +Info 22 [00:01:41.000] Files (1) + +Info 22 [00:01:42.000] ----------------------------------------------- +Info 22 [00:01:43.000] Project '/dev/null/inferredProject2*' (Inferred) +Info 22 [00:01:44.000] Files (1) + +Info 22 [00:01:45.000] ----------------------------------------------- +Info 22 [00:01:46.000] Open files: +Info 22 [00:01:47.000] FileName: /a.js ProjectRootPath: undefined +Info 22 [00:01:48.000] Projects: /dev/null/inferredProject1* +Info 22 [00:01:49.000] FileName: /b.js ProjectRootPath: undefined +Info 22 [00:01:50.000] Projects: /dev/null/inferredProject2* +Info 22 [00:01:51.000] response: + { + "responseRequired": false + } +After request diff --git a/tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-extends,-files,-include,-exclude,-and-compileOnSave.js b/tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-extends,-files,-include,-exclude,-and-compileOnSave.js new file mode 100644 index 00000000000..9b6886997e4 --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-extends,-files,-include,-exclude,-and-compileOnSave.js @@ -0,0 +1,76 @@ +Info 0 [00:00:09.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/hunter2/a.ts] + + +//// [/tsconfig.json] +{"compilerOptions":{},"extends":"hunter2.json","files":["hunter2/a.ts"],"include":["hunter2"],"exclude":["hunter2"],"compileOnSave":true} + + +Info 1 [00:00:10.000] request: + { + "command": "open", + "arguments": { + "file": "/hunter2/a.ts" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:11.000] Search path: /hunter2 +Info 3 [00:00:12.000] For info: /hunter2/a.ts :: Config file name: /tsconfig.json +Info 4 [00:00:13.000] Creating configuration project /tsconfig.json +Info 5 [00:00:14.000] FileWatcher:: Added:: WatchInfo: /tsconfig.json 2000 undefined Project: /tsconfig.json WatchType: Config file +Info 6 [00:00:15.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/tsconfig.json","reason":"Creating possible configured project for /hunter2/a.ts to open"}} +Info 7 [00:00:16.000] Config: /tsconfig.json : { + "rootNames": [ + "/hunter2/a.ts" + ], + "options": { + "configFilePath": "/tsconfig.json" + } +} +Info 8 [00:00:17.000] DirectoryWatcher:: Added:: WatchInfo: /hunter2 1 undefined Config: /tsconfig.json WatchType: Wild card directory +Info 9 [00:00:18.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /hunter2 1 undefined Config: /tsconfig.json WatchType: Wild card directory +Info 10 [00:00:19.000] Starting updateGraphWorker: Project: /tsconfig.json +Info 11 [00:00:20.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /tsconfig.json WatchType: Missing file +Info 12 [00:00:21.000] Finishing updateGraphWorker: Project: /tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 13 [00:00:22.000] Project '/tsconfig.json' (Configured) +Info 14 [00:00:23.000] Files (1) + /hunter2/a.ts SVC-1-0 "" + + + hunter2/a.ts + Part of 'files' list in tsconfig.json + +Info 15 [00:00:24.000] ----------------------------------------------- +Info 16 [00:00:25.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/tsconfig.json"}} +Info 17 [00:00:26.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"aace87d7c1572ff43c6978074161b586788b4518c7a9d06c79c03e613b6ce5a3","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":0,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":true,"files":true,"include":true,"exclude":true,"compileOnSave":true,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 18 [00:00:27.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/hunter2/a.ts","configFile":"/tsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"},{"start":{"line":1,"offset":33},"end":{"line":1,"offset":47},"text":"File 'hunter2.json' not found.","code":6053,"category":"error","fileName":"/tsconfig.json"}]}} +Info 19 [00:00:28.000] Project '/tsconfig.json' (Configured) +Info 19 [00:00:29.000] Files (1) + +Info 19 [00:00:30.000] ----------------------------------------------- +Info 19 [00:00:31.000] Open files: +Info 19 [00:00:32.000] FileName: /hunter2/a.ts ProjectRootPath: undefined +Info 19 [00:00:33.000] Projects: /tsconfig.json +Info 19 [00:00:34.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/hunter2: *new* + {} diff --git a/tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-file-sizes.js b/tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-file-sizes.js new file mode 100644 index 00000000000..9655801b4c8 --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-file-sizes.js @@ -0,0 +1,193 @@ +Info 0 [00:00:09.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/jsconfig.json] +{"compilerOptions":{"allowJs":true,"allowSyntheticDefaultImports":true,"maxNodeModuleJsDepth":2,"skipLibCheck":true,"noEmit":true}} + +//// [/b.ts] +12 + +//// [/a.js] +1 + + +Info 1 [00:00:10.000] request: + { + "command": "open", + "arguments": { + "file": "/a.js" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:11.000] Search path: / +Info 3 [00:00:12.000] For info: /a.js :: Config file name: /jsconfig.json +Info 4 [00:00:13.000] Creating configuration project /jsconfig.json +Info 5 [00:00:14.000] FileWatcher:: Added:: WatchInfo: /jsconfig.json 2000 undefined Project: /jsconfig.json WatchType: Config file +Info 6 [00:00:15.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/jsconfig.json","reason":"Creating possible configured project for /a.js to open"}} +Info 7 [00:00:16.000] Config: /jsconfig.json : { + "rootNames": [ + "/a.js", + "/b.ts" + ], + "options": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "/jsconfig.json" + } +} +Info 8 [00:00:17.000] DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 9 [00:00:18.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 10 [00:00:19.000] FileWatcher:: Added:: WatchInfo: /b.ts 500 undefined WatchType: Closed Script info +Info 11 [00:00:20.000] Starting updateGraphWorker: Project: /jsconfig.json +Info 12 [00:00:21.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /jsconfig.json WatchType: Missing file +Info 13 [00:00:22.000] Finishing updateGraphWorker: Project: /jsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 14 [00:00:23.000] Project '/jsconfig.json' (Configured) +Info 15 [00:00:24.000] Files (2) + /a.js SVC-1-0 "1" + /b.ts Text-1 "12" + + + a.js + Matched by default include pattern '**/*' + b.ts + Matched by default include pattern '**/*' + +Info 16 [00:00:25.000] ----------------------------------------------- +TI:: Creating typing installer + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: *new* + {} +/b.ts: *new* + {} + +FsWatchesRecursive:: +/: *new* + {} + +TI:: [00:00:26.000] Global cache location '/a/data/', safe file path '/safeList.json', types map path /typesMap.json +TI:: [00:00:27.000] Processing cache location '/a/data/' +TI:: [00:00:28.000] Trying to find '/a/data/package.json'... +TI:: [00:00:29.000] Finished processing cache location '/a/data/' +TI:: [00:00:30.000] Npm config file: /a/data/package.json +TI:: [00:00:31.000] Npm config file: '/a/data/package.json' is missing, creating new one... +Info 17 [00:00:34.000] DirectoryWatcher:: Triggered with a :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 18 [00:00:35.000] Scheduled: /jsconfig.json +Info 19 [00:00:36.000] Scheduled: *ensureProjectForOpenFiles* +Info 20 [00:00:37.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 21 [00:00:40.000] DirectoryWatcher:: Triggered with a/data :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 22 [00:00:41.000] Scheduled: /jsconfig.json, Cancelled earlier one +Info 23 [00:00:42.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 24 [00:00:43.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 25 [00:00:46.000] DirectoryWatcher:: Triggered with a/data/package.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 26 [00:00:47.000] Config: /jsconfig.json Detected new package.json: a/data/package.json +Info 27 [00:00:48.000] FileWatcher:: Added:: WatchInfo: /a/data/package.json 250 undefined WatchType: package.json file +Info 28 [00:00:49.000] Project: /jsconfig.json Detected file add/remove of non supported extension: a/data/package.json +Info 29 [00:00:50.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/package.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +TI:: [00:00:51.000] Updating types-registry npm package... +TI:: [00:00:52.000] npm install --ignore-scripts types-registry@latest +Info 30 [00:00:57.000] DirectoryWatcher:: Triggered with a/data/node_modules :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 31 [00:00:58.000] Scheduled: /jsconfig.json, Cancelled earlier one +Info 32 [00:00:59.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 33 [00:01:00.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 34 [00:01:02.000] DirectoryWatcher:: Triggered with a/data/node_modules/types-registry :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 35 [00:01:03.000] Scheduled: /jsconfig.json, Cancelled earlier one +Info 36 [00:01:04.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 37 [00:01:05.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules/types-registry :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 38 [00:01:07.000] DirectoryWatcher:: Triggered with a/data/node_modules/types-registry/index.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 39 [00:01:08.000] Project: /jsconfig.json Detected file add/remove of non supported extension: a/data/node_modules/types-registry/index.json +Info 40 [00:01:09.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules/types-registry/index.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +TI:: [00:01:10.000] TI:: Updated types-registry npm package +TI:: typing installer creation complete +//// [/a/data/package.json] +{ "private": true } + +//// [/a/data/node_modules/types-registry/index.json] +{ + "entries": {} +} + + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: + {} +/b.ts: + {} +/a/data/package.json: *new* + {} + +FsWatchesRecursive:: +/: + {} + +TI:: [00:01:11.000] Got install request {"projectName":"/jsconfig.json","fileNames":["/a.js","/b.ts"],"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"configFilePath":"/jsconfig.json","allowNonTsExtensions":true},"typeAcquisition":{"enable":true,"include":[],"exclude":[]},"unresolvedImports":[],"projectRootPath":"/","cachePath":"/a/data/","kind":"discover"} +TI:: [00:01:12.000] Request specifies cache path '/a/data/', loading cached information... +TI:: [00:01:13.000] Processing cache location '/a/data/' +TI:: [00:01:14.000] Cache location was already processed... +TI:: [00:01:15.000] Failed to load safelist from types map file '/typesMap.json' +TI:: [00:01:16.000] Explicitly included types: [] +TI:: [00:01:17.000] Inferred typings from unresolved imports: [] +TI:: [00:01:18.000] Result: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:01:19.000] Finished typings discovery: {"cachedTypingPaths":[],"newTypingNames":[],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:01:20.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components +TI:: [00:01:21.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:23.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules +TI:: [00:01:24.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:25.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:26.000] Sending response: + {"projectName":"/jsconfig.json","typeAcquisition":{"enable":true,"include":[],"exclude":[]},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"configFilePath":"/jsconfig.json","allowNonTsExtensions":true},"typings":[],"unresolvedImports":[],"kind":"action::set"} +TI:: [00:01:27.000] No new typings were requested as a result of typings discovery +Info 41 [00:01:28.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/jsconfig.json"}} +Info 42 [00:01:29.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"d3f7418c3d4888d0a51e42716b5a330dab4da64c452eebe918c1e0e634d8ede1","fileStats":{"js":1,"jsSize":1,"jsx":0,"jsxSize":0,"ts":1,"tsSize":2,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true},"typeAcquisition":{"enable":true,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"jsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 43 [00:01:30.000] Starting updateGraphWorker: Project: /jsconfig.json +Info 44 [00:01:31.000] Finishing updateGraphWorker: Project: /jsconfig.json Version: 2 structureChanged: false structureIsReused:: Not Elapsed:: *ms +Info 45 [00:01:32.000] Same program as before +Info 46 [00:01:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a.js","configFile":"/jsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 47 [00:01:34.000] Project '/jsconfig.json' (Configured) +Info 47 [00:01:35.000] Files (2) + +Info 47 [00:01:36.000] ----------------------------------------------- +Info 47 [00:01:37.000] Open files: +Info 47 [00:01:38.000] FileName: /a.js ProjectRootPath: undefined +Info 47 [00:01:39.000] Projects: /jsconfig.json +Info 47 [00:01:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/bower_components: *new* + {"pollingInterval":500} +/node_modules: *new* + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: + {} +/b.ts: + {} +/a/data/package.json: + {} + +FsWatchesRecursive:: +/: + {} diff --git a/tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-typeAcquisition-settings.js b/tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-typeAcquisition-settings.js new file mode 100644 index 00000000000..386c5217eaf --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/sends-telemetry-for-typeAcquisition-settings.js @@ -0,0 +1,182 @@ +Info 0 [00:00:07.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a.js] + + +//// [/jsconfig.json] +{"compilerOptions":{},"typeAcquisition":{"enable":true,"include":["hunter2","hunter3"],"exclude":[]}} + + +Info 1 [00:00:08.000] request: + { + "command": "open", + "arguments": { + "file": "/a.js" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:09.000] Search path: / +Info 3 [00:00:10.000] For info: /a.js :: Config file name: /jsconfig.json +Info 4 [00:00:11.000] Creating configuration project /jsconfig.json +Info 5 [00:00:12.000] FileWatcher:: Added:: WatchInfo: /jsconfig.json 2000 undefined Project: /jsconfig.json WatchType: Config file +Info 6 [00:00:13.000] event: + {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/jsconfig.json","reason":"Creating possible configured project for /a.js to open"}} +Info 7 [00:00:14.000] Config: /jsconfig.json : { + "rootNames": [ + "/a.js" + ], + "options": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "/jsconfig.json" + } +} +Info 8 [00:00:15.000] DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 9 [00:00:16.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 10 [00:00:17.000] Starting updateGraphWorker: Project: /jsconfig.json +Info 11 [00:00:18.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /jsconfig.json WatchType: Missing file +Info 12 [00:00:19.000] Finishing updateGraphWorker: Project: /jsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 13 [00:00:20.000] Project '/jsconfig.json' (Configured) +Info 14 [00:00:21.000] Files (1) + /a.js SVC-1-0 "" + + + a.js + Matched by default include pattern '**/*' + +Info 15 [00:00:22.000] ----------------------------------------------- +TI:: Creating typing installer + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: *new* + {} + +FsWatchesRecursive:: +/: *new* + {} + +TI:: [00:00:23.000] Global cache location '/a/data/', safe file path '/safeList.json', types map path /typesMap.json +TI:: [00:00:24.000] Processing cache location '/a/data/' +TI:: [00:00:25.000] Trying to find '/a/data/package.json'... +TI:: [00:00:26.000] Finished processing cache location '/a/data/' +TI:: [00:00:27.000] Npm config file: /a/data/package.json +TI:: [00:00:28.000] Npm config file: '/a/data/package.json' is missing, creating new one... +Info 16 [00:00:31.000] DirectoryWatcher:: Triggered with a :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 17 [00:00:32.000] Scheduled: /jsconfig.json +Info 18 [00:00:33.000] Scheduled: *ensureProjectForOpenFiles* +Info 19 [00:00:34.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 20 [00:00:37.000] DirectoryWatcher:: Triggered with a/data :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 21 [00:00:38.000] Scheduled: /jsconfig.json, Cancelled earlier one +Info 22 [00:00:39.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 23 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 24 [00:00:43.000] DirectoryWatcher:: Triggered with a/data/package.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 25 [00:00:44.000] Config: /jsconfig.json Detected new package.json: a/data/package.json +Info 26 [00:00:45.000] FileWatcher:: Added:: WatchInfo: /a/data/package.json 250 undefined WatchType: package.json file +Info 27 [00:00:46.000] Project: /jsconfig.json Detected file add/remove of non supported extension: a/data/package.json +Info 28 [00:00:47.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/package.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +TI:: [00:00:48.000] Updating types-registry npm package... +TI:: [00:00:49.000] npm install --ignore-scripts types-registry@latest +Info 29 [00:00:54.000] DirectoryWatcher:: Triggered with a/data/node_modules :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 30 [00:00:55.000] Scheduled: /jsconfig.json, Cancelled earlier one +Info 31 [00:00:56.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 32 [00:00:57.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 33 [00:00:59.000] DirectoryWatcher:: Triggered with a/data/node_modules/types-registry :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 34 [00:01:00.000] Scheduled: /jsconfig.json, Cancelled earlier one +Info 35 [00:01:01.000] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one +Info 36 [00:01:02.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules/types-registry :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 37 [00:01:04.000] DirectoryWatcher:: Triggered with a/data/node_modules/types-registry/index.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +Info 38 [00:01:05.000] Project: /jsconfig.json Detected file add/remove of non supported extension: a/data/node_modules/types-registry/index.json +Info 39 [00:01:06.000] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules/types-registry/index.json :: WatchInfo: 1 undefined Config: /jsconfig.json WatchType: Wild card directory +TI:: [00:01:07.000] TI:: Updated types-registry npm package +TI:: typing installer creation complete +//// [/a/data/package.json] +{ "private": true } + +//// [/a/data/node_modules/types-registry/index.json] +{ + "entries": {} +} + + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: + {} +/a/data/package.json: *new* + {} + +FsWatchesRecursive:: +/: + {} + +TI:: [00:01:08.000] Got install request {"projectName":"/jsconfig.json","fileNames":["/a.js"],"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"configFilePath":"/jsconfig.json","allowNonTsExtensions":true},"typeAcquisition":{"enable":true,"include":["hunter2","hunter3"],"exclude":[]},"unresolvedImports":[],"projectRootPath":"/","cachePath":"/a/data/","kind":"discover"} +TI:: [00:01:09.000] Request specifies cache path '/a/data/', loading cached information... +TI:: [00:01:10.000] Processing cache location '/a/data/' +TI:: [00:01:11.000] Cache location was already processed... +TI:: [00:01:12.000] Failed to load safelist from types map file '/typesMap.json' +TI:: [00:01:13.000] Explicitly included types: ["hunter2","hunter3"] +TI:: [00:01:14.000] Inferred typings from unresolved imports: [] +TI:: [00:01:15.000] Result: {"cachedTypingPaths":[],"newTypingNames":["hunter2","hunter3"],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:01:16.000] Finished typings discovery: {"cachedTypingPaths":[],"newTypingNames":["hunter2","hunter3"],"filesToWatch":["/bower_components","/node_modules"]} +TI:: [00:01:17.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components +TI:: [00:01:18.000] DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:19.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:20.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules +TI:: [00:01:21.000] DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:22.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /jsconfig.json watcher already invoked: false +TI:: [00:01:23.000] Installing typings ["hunter2","hunter3"] +TI:: [00:01:24.000] 'hunter2':: Entry for package 'hunter2' does not exist in local types registry - skipping... +TI:: [00:01:25.000] 'hunter3':: Entry for package 'hunter3' does not exist in local types registry - skipping... +TI:: [00:01:26.000] All typings are known to be missing or invalid - no need to install more typings +TI:: [00:01:27.000] Sending response: + {"projectName":"/jsconfig.json","typeAcquisition":{"enable":true,"include":["hunter2","hunter3"],"exclude":[]},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true,"configFilePath":"/jsconfig.json","allowNonTsExtensions":true},"typings":[],"unresolvedImports":[],"kind":"action::set"} +Info 40 [00:01:28.000] event: + {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/jsconfig.json"}} +Info 41 [00:01:29.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"d3f7418c3d4888d0a51e42716b5a330dab4da64c452eebe918c1e0e634d8ede1","fileStats":{"js":1,"jsSize":0,"jsx":0,"jsxSize":0,"ts":0,"tsSize":0,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"noEmit":true},"typeAcquisition":{"enable":true,"include":true,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"jsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 42 [00:01:30.000] Starting updateGraphWorker: Project: /jsconfig.json +Info 43 [00:01:31.000] Finishing updateGraphWorker: Project: /jsconfig.json Version: 2 structureChanged: false structureIsReused:: Not Elapsed:: *ms +Info 44 [00:01:32.000] Same program as before +Info 45 [00:01:33.000] event: + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/a.js","configFile":"/jsconfig.json","diagnostics":[{"text":"File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'","code":6053,"category":"error"},{"text":"Cannot find global type 'Array'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Boolean'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Function'.","code":2318,"category":"error"},{"text":"Cannot find global type 'IArguments'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Number'.","code":2318,"category":"error"},{"text":"Cannot find global type 'Object'.","code":2318,"category":"error"},{"text":"Cannot find global type 'RegExp'.","code":2318,"category":"error"},{"text":"Cannot find global type 'String'.","code":2318,"category":"error"}]}} +Info 46 [00:01:34.000] Project '/jsconfig.json' (Configured) +Info 46 [00:01:35.000] Files (1) + +Info 46 [00:01:36.000] ----------------------------------------------- +Info 46 [00:01:37.000] Open files: +Info 46 [00:01:38.000] FileName: /a.js ProjectRootPath: undefined +Info 46 [00:01:39.000] Projects: /jsconfig.json +Info 46 [00:01:40.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/bower_components: *new* + {"pollingInterval":500} +/node_modules: *new* + {"pollingInterval":500} + +FsWatches:: +/jsconfig.json: + {} +/a/data/package.json: + {} + +FsWatchesRecursive:: +/: + {} diff --git a/tests/baselines/reference/tsserver/telemetry/works-with-external-project.js b/tests/baselines/reference/tsserver/telemetry/works-with-external-project.js new file mode 100644 index 00000000000..01fb8d1e548 --- /dev/null +++ b/tests/baselines/reference/tsserver/telemetry/works-with-external-project.js @@ -0,0 +1,252 @@ +Info 0 [00:00:05.000] Provided types map file "/a/lib/typesMap.json" doesn't exist +Before request +//// [/a.ts] + + + +Info 1 [00:00:06.000] request: + { + "command": "openExternalProject", + "arguments": { + "rootFiles": [ + { + "fileName": "/a.ts" + } + ], + "options": { + "strict": true + }, + "projectFileName": "/hunter2/foo.csproj" + }, + "seq": 1, + "type": "request" + } +Info 2 [00:00:07.000] FileWatcher:: Added:: WatchInfo: /a.ts 500 undefined WatchType: Closed Script info +Info 3 [00:00:08.000] Starting updateGraphWorker: Project: /hunter2/foo.csproj +Info 4 [00:00:09.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /hunter2/foo.csproj WatchType: Missing file +Info 5 [00:00:10.000] DirectoryWatcher:: Added:: WatchInfo: /hunter2/node_modules/@types 1 undefined Project: /hunter2/foo.csproj WatchType: Type roots +Info 6 [00:00:11.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /hunter2/node_modules/@types 1 undefined Project: /hunter2/foo.csproj WatchType: Type roots +Info 7 [00:00:12.000] Finishing updateGraphWorker: Project: /hunter2/foo.csproj Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 8 [00:00:13.000] Project '/hunter2/foo.csproj' (External) +Info 9 [00:00:14.000] Files (1) + /a.ts Text-1 "" + + + ../a.ts + Root file specified for compilation + +Info 10 [00:00:15.000] ----------------------------------------------- +Info 11 [00:00:16.000] event: + {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"ef055f5036459f2705212d5657970dd7bc0280bdb6fa2cddd17d0cd73eb2a989","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":1,"tsSize":0,"tsx":0,"tsxSize":0,"dts":0,"dtsSize":0,"deferred":0,"deferredSize":0},"compilerOptions":{"strict":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"compileOnSave":true,"configFileName":"other","projectType":"external","languageServiceEnabled":true,"version":"FakeVersion"}}} +Info 12 [00:00:17.000] response: + { + "response": true, + "responseRequired": true + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/hunter2/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a.ts: *new* + {} + +Before request + +Info 13 [00:00:18.000] request: + { + "command": "open", + "arguments": { + "file": "/a.ts" + }, + "seq": 2, + "type": "request" + } +Info 14 [00:00:19.000] FileWatcher:: Close:: WatchInfo: /a.ts 500 undefined WatchType: Closed Script info +Info 15 [00:00:20.000] Project '/hunter2/foo.csproj' (External) +Info 15 [00:00:21.000] Files (1) + +Info 15 [00:00:22.000] ----------------------------------------------- +Info 15 [00:00:23.000] Open files: +Info 15 [00:00:24.000] FileName: /a.ts ProjectRootPath: undefined +Info 15 [00:00:25.000] Projects: /hunter2/foo.csproj +Info 15 [00:00:26.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/hunter2/node_modules/@types: + {"pollingInterval":500} + +FsWatches *deleted*:: +/a.ts: + {} + +Before request + +Info 16 [00:00:27.000] request: + { + "command": "close", + "arguments": { + "file": "/a.ts" + }, + "seq": 3, + "type": "request" + } +Info 17 [00:00:28.000] FileWatcher:: Added:: WatchInfo: /a.ts 500 undefined WatchType: Closed Script info +Info 18 [00:00:29.000] Project '/hunter2/foo.csproj' (External) +Info 18 [00:00:30.000] Files (1) + +Info 18 [00:00:31.000] ----------------------------------------------- +Info 18 [00:00:32.000] Open files: +Info 18 [00:00:33.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/hunter2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a.ts: *new* + {} + +Before request + +Info 19 [00:00:34.000] request: + { + "command": "closeExternalProject", + "arguments": { + "projectFileName": "/hunter2/foo.csproj" + }, + "seq": 4, + "type": "request" + } +Info 20 [00:00:35.000] `remove Project:: +Info 21 [00:00:36.000] Project '/hunter2/foo.csproj' (External) +Info 22 [00:00:37.000] Files (1) + /a.ts + + + ../a.ts + Root file specified for compilation + +Info 23 [00:00:38.000] ----------------------------------------------- +Info 24 [00:00:39.000] DirectoryWatcher:: Close:: WatchInfo: /hunter2/node_modules/@types 1 undefined Project: /hunter2/foo.csproj WatchType: Type roots +Info 25 [00:00:40.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /hunter2/node_modules/@types 1 undefined Project: /hunter2/foo.csproj WatchType: Type roots +Info 26 [00:00:41.000] FileWatcher:: Close:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /hunter2/foo.csproj WatchType: Missing file +Info 27 [00:00:42.000] response: + { + "response": true, + "responseRequired": true + } +After request + +PolledWatches *deleted*:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/hunter2/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/a.ts: + {} + +Before request + +Info 28 [00:00:43.000] request: + { + "command": "openExternalProject", + "arguments": { + "rootFiles": [ + { + "fileName": "/a.ts" + } + ], + "options": { + "strict": true, + "allowNonTsExtensions": true, + "noEmitForJsFiles": true + }, + "projectFileName": "/hunter2/foo.csproj" + }, + "seq": 5, + "type": "request" + } +Info 29 [00:00:44.000] Starting updateGraphWorker: Project: /hunter2/foo.csproj +Info 30 [00:00:45.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /hunter2/foo.csproj WatchType: Missing file +Info 31 [00:00:46.000] DirectoryWatcher:: Added:: WatchInfo: /hunter2/node_modules/@types 1 undefined Project: /hunter2/foo.csproj WatchType: Type roots +Info 32 [00:00:47.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /hunter2/node_modules/@types 1 undefined Project: /hunter2/foo.csproj WatchType: Type roots +Info 33 [00:00:48.000] Finishing updateGraphWorker: Project: /hunter2/foo.csproj Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 34 [00:00:49.000] Project '/hunter2/foo.csproj' (External) +Info 35 [00:00:50.000] Files (1) + /a.ts Text-1 "" + + + ../a.ts + Root file specified for compilation + +Info 36 [00:00:51.000] ----------------------------------------------- +Info 37 [00:00:52.000] response: + { + "response": true, + "responseRequired": true + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: *new* + {"pollingInterval":500} +/hunter2/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a.ts: + {} + +Before request + +Info 38 [00:00:53.000] request: + { + "command": "open", + "arguments": { + "file": "/a.ts" + }, + "seq": 6, + "type": "request" + } +Info 39 [00:00:54.000] FileWatcher:: Close:: WatchInfo: /a.ts 500 undefined WatchType: Closed Script info +Info 40 [00:00:55.000] Project '/hunter2/foo.csproj' (External) +Info 40 [00:00:56.000] Files (1) + +Info 40 [00:00:57.000] ----------------------------------------------- +Info 40 [00:00:58.000] Open files: +Info 40 [00:00:59.000] FileName: /a.ts ProjectRootPath: undefined +Info 40 [00:01:00.000] Projects: /hunter2/foo.csproj +Info 40 [00:01:01.000] response: + { + "responseRequired": false + } +After request + +PolledWatches:: +/a/lib/lib.d.ts: + {"pollingInterval":500} +/hunter2/node_modules/@types: + {"pollingInterval":500} + +FsWatches *deleted*:: +/a.ts: + {}