From 3c4c060dff2b0292d3a4d88ba0627b7657d67e7f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 6 Jun 2023 11:11:14 -0700 Subject: [PATCH] Adds tests and fixes issues by verifying incremental project updates are handling language service ref counting correctly (#54504) --- src/compiler/debug.ts | 5 + src/compiler/moduleNameResolver.ts | 2 +- src/compiler/program.ts | 6 +- src/compiler/watchPublic.ts | 3 +- src/harness/harnessLanguageService.ts | 4 +- src/harness/incrementalUtils.ts | 100 ++++++++++++++++++ src/server/editorServices.ts | 8 +- src/server/project.ts | 39 ++++--- src/server/session.ts | 5 +- src/services/documentRegistry.ts | 28 +++-- src/services/services.ts | 8 +- src/testRunner/unittests/helpers/tsserver.ts | 5 +- .../unittests/tsserver/documentRegistry.ts | 5 +- src/testRunner/unittests/tsserver/session.ts | 13 ++- ...-orphan,-and-orphan-script-info-changes.js | 16 ++- ...he-source-file-if-script-info-is-orphan.js | 16 ++- ...en-package-json-with-type-module-exists.js | 15 +-- .../package-json-file-is-edited.js | 14 +++ ...indirect-project-but-not-in-another-one.js | 17 ++- ...dProjectLoad-is-set-in-indirect-project.js | 18 +++- ...-if-disableReferencedProjectLoad-is-set.js | 16 ++- ...ject-is-directly-referenced-by-solution.js | 17 ++- ...ct-is-indirectly-referenced-by-solution.js | 17 ++- ...indirect-project-but-not-in-another-one.js | 33 +++++- ...dProjectLoad-is-set-in-indirect-project.js | 30 +++++- ...-if-disableReferencedProjectLoad-is-set.js | 18 +++- ...ces-open-file-through-project-reference.js | 31 +++++- ...ct-is-indirectly-referenced-by-solution.js | 33 +++++- .../reloadProjects/configured-project.js | 11 ++ .../external-project-with-config-file.js | 11 ++ .../reloadProjects/external-project.js | 11 ++ .../reloadProjects/inferred-project.js | 16 ++- 32 files changed, 492 insertions(+), 79 deletions(-) create mode 100644 src/harness/incrementalUtils.ts diff --git a/src/compiler/debug.ts b/src/compiler/debug.ts index 94838e3f863..057323c788e 100644 --- a/src/compiler/debug.ts +++ b/src/compiler/debug.ts @@ -72,6 +72,7 @@ import { ObjectFlags, ObjectType, RelationComparisonResult, + ScriptKind, Signature, SignatureCheckMode, SignatureFlags, @@ -439,6 +440,10 @@ export namespace Debug { return formatEnum(kind, (ts as any).SnippetKind, /*isFlags*/ false); } + export function formatScriptKind(kind: ScriptKind | undefined): string { + return formatEnum(kind, (ts as any).ScriptKind, /*isFlags*/ false); + } + export function formatNodeFlags(flags: NodeFlags | undefined): string { return formatEnum(flags, (ts as any).NodeFlags, /*isFlags*/ true); } diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index a9ce9fd9273..fbe1332b939 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -880,7 +880,7 @@ function compilerOptionValueToString(value: unknown): string { /** @internal */ export function getKeyForCompilerOptions(options: CompilerOptions, affectingOptionDeclarations: readonly CommandLineOption[]) { - return affectingOptionDeclarations.map(option => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + (options.pathsBasePath ? `|${options.pathsBasePath}` : undefined); + return affectingOptionDeclarations.map(option => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + `|${options.pathsBasePath}`; } /** @internal */ diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 7736fe9183d..345ff985a6b 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2369,8 +2369,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg for (const oldSourceFile of oldSourceFiles) { const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options); let newSourceFile = host.getSourceFileByPath - ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, sourceFileOptions, /*onError*/ undefined, shouldCreateNewSourceFile || sourceFileOptions.impliedNodeFormat !== oldSourceFile.impliedNodeFormat) - : host.getSourceFile(oldSourceFile.fileName, sourceFileOptions, /*onError*/ undefined, shouldCreateNewSourceFile || sourceFileOptions.impliedNodeFormat !== oldSourceFile.impliedNodeFormat); // TODO: GH#18217 + ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, sourceFileOptions, /*onError*/ undefined, shouldCreateNewSourceFile) + : host.getSourceFile(oldSourceFile.fileName, sourceFileOptions, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217 if (!newSourceFile) { return StructureIsReused.Not; @@ -3615,7 +3615,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg fileName, sourceFileOptions, hostErrorMessage => addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]), - shouldCreateNewSourceFile || (oldProgram?.getSourceFileByPath(toPath(fileName))?.impliedNodeFormat !== sourceFileOptions.impliedNodeFormat) + shouldCreateNewSourceFile, ); if (packageId) { diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index 1dd9ff02a2a..f5eb07f44dd 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -724,7 +724,8 @@ export function createWatchProgram(host: WatchCompiler } // Create new source file if requested or the versions dont match - if (hostSourceFile === undefined || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile)) { + const impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined; + if (hostSourceFile === undefined || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile) || hostSourceFile.sourceFile.impliedNodeFormat !== impliedNodeFormat) { const sourceFile = getNewSourceFile(fileName, languageVersionOrOptions, onError); if (hostSourceFile) { if (sourceFile) { diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 369ac5183a0..26682df5cdf 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -9,6 +9,7 @@ import * as ts from "./_namespaces/ts"; import { getNewLineCharacter } from "./_namespaces/ts"; import * as vfs from "./_namespaces/vfs"; import * as vpath from "./_namespaces/vpath"; +import { incrementalVerifier } from "./incrementalUtils"; export function makeDefaultProxy(info: ts.server.PluginCreateInfo): ts.LanguageService { const proxy = Object.create(/*o*/ null); // eslint-disable-line no-null/no-null @@ -1016,7 +1017,8 @@ export class ServerLanguageServiceAdapter implements LanguageServiceAdapter { byteLength: Buffer.byteLength, hrtime: process.hrtime, logger: serverHost, - canUseEvents: true + canUseEvents: true, + incrementalVerifier, }; this.server = new FourslashSession(opts); diff --git a/src/harness/incrementalUtils.ts b/src/harness/incrementalUtils.ts new file mode 100644 index 00000000000..b1f517b2fd8 --- /dev/null +++ b/src/harness/incrementalUtils.ts @@ -0,0 +1,100 @@ +import * as ts from "./_namespaces/ts"; + +export function reportDocumentRegistryStats(documentRegistry: ts.DocumentRegistry) { + const str: string[] = []; + documentRegistry.getBuckets().forEach((bucketEntries, key) => { + str.push(` Key:: ${key}`); + bucketEntries.forEach((entry, path) => { + if (ts.isDocumentRegistryEntry(entry)) { + str.push(` ${path}: ${ts.Debug.formatScriptKind(entry.sourceFile.scriptKind)} ${entry.languageServiceRefCount}`); + } + else { + entry.forEach((real, kind) => str.push(` ${path}: ${ts.Debug.formatScriptKind(kind)} ${real.languageServiceRefCount}`)); + } + }); + }); + return str; +} + +type DocumentRegistryExpectedStats = Map>>; +function verifyDocumentRegistryStats( + documentRegistry: ts.DocumentRegistry, + stats: DocumentRegistryExpectedStats, +) { + documentRegistry.getBuckets().forEach((bucketEntries, key) => { + const statsByPath = stats.get(key); + bucketEntries.forEach((entry, path) => { + const expected = statsByPath?.get(path); + if (ts.isDocumentRegistryEntry(entry)) { + ts.Debug.assert( + expected?.size === 1 && expected.has(entry.sourceFile.scriptKind) && expected.get(entry.sourceFile.scriptKind) === entry.languageServiceRefCount, + `Document registry has unexpected language service ref count for ${key} ${path} ${ts.Debug.formatScriptKind(entry.sourceFile.scriptKind)} ${entry.languageServiceRefCount}`, + reportStats, + ); + } + else { + entry.forEach((real, kind) => ts.Debug.assert( + real.languageServiceRefCount === expected?.get(kind), + `Document registry has unexpected language service ref count for ${key} ${path} ${ts.Debug.formatScriptKind(kind)} ${real.languageServiceRefCount}`, + reportStats, + )); + expected?.forEach((value, kind) => ts.Debug.assert( + entry.has(kind), + `Document registry expected language service ref count for ${key} ${path} ${ts.Debug.formatScriptKind(kind)} ${value}`, + reportStats, + )); + } + }); + statsByPath?.forEach((_value, path) => ts.Debug.assert( + bucketEntries.has(path), + `Document registry does not contain entry for ${key}, ${path}`, + reportStats, + )); + }); + stats.forEach((_value, key) => ts.Debug.assert( + documentRegistry.getBuckets().has(key), + `Document registry does not contain entry for key: ${key}`, + reportStats, + )); + + function reportStats() { + const str: string[] = ["", "Actual::", ...reportDocumentRegistryStats(documentRegistry)]; + str.push("Expected::"); + stats?.forEach((statsByPath, key) => { + str.push(` Key:: ${key}`); + statsByPath.forEach((entry, path) => entry.forEach((refCount, kind) => str.push(` ${path}: ${ts.Debug.formatScriptKind(kind)} ${refCount}`))); + }); + return str.join("\n"); + } +} + +function verifyDocumentRegistry(service: ts.server.ProjectService) { + const stats: DocumentRegistryExpectedStats = new Map(); + const collectStats = (project: ts.server.Project) => { + if (project.autoImportProviderHost) collectStats(project.autoImportProviderHost); + if (project.noDtsResolutionProject) collectStats(project.noDtsResolutionProject); + const program = project.getCurrentProgram(); + if (!program) return; + const key = service.documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()); + program.getSourceFiles().forEach(f => { + const keyWithMode = service.documentRegistry.getDocumentRegistryBucketKeyWithMode(key, f.impliedNodeFormat); + let mapForKeyWithMode = stats.get(keyWithMode); + let result: Map | undefined; + if (mapForKeyWithMode === undefined) { + stats.set(keyWithMode, mapForKeyWithMode = new Map()); + mapForKeyWithMode.set(f.resolvedPath, result = new Map()); + } + else { + result = mapForKeyWithMode.get(f.resolvedPath); + if (!result) mapForKeyWithMode.set(f.resolvedPath, result = new Map()); + } + result.set(f.scriptKind, (result.get(f.scriptKind) || 0) + 1); + }); + }; + service.forEachProject(collectStats); + verifyDocumentRegistryStats(service.documentRegistry, stats); +} + +export function incrementalVerifier(service: ts.server.ProjectService) { + service.verifyDocumentRegistry = () => verifyDocumentRegistry(service); +} \ No newline at end of file diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 53356204298..9e38e97d3cf 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -590,6 +590,7 @@ export interface ProjectServiceOptions { typesMapLocation?: string; serverMode?: LanguageServiceMode; session: Session | undefined; + /** @internal */ incrementalVerifier?: (service: ProjectService) => void; } interface OriginalFileInfo { fileName: NormalizedPath; path: Path; } @@ -989,12 +990,13 @@ export class ProjectService { /** @internal */ readonly session: Session | undefined; - private performanceEventHandler?: PerformanceEventHandler; private pendingPluginEnablements?: Map[]>; private currentPluginEnablementPromise?: Promise; + /** @internal */ verifyDocumentRegistry = noop; + constructor(opts: ProjectServiceOptions) { this.host = opts.host; this.logger = opts.logger; @@ -1057,6 +1059,7 @@ export class ProjectService { watchDirectory: returnNoopFileWatcher, } : getWatchFactory(this.host, watchLogLevel, log, getDetailWatchInfo); + opts.incrementalVerifier?.(this); } toPath(fileName: string) { @@ -1334,7 +1337,7 @@ export class ProjectService { } /** @internal */ - private forEachProject(cb: (project: Project) => void) { + forEachProject(cb: (project: Project) => void) { this.externalProjects.forEach(cb); this.configuredProjects.forEach(cb); this.inferredProjects.forEach(cb); @@ -2640,6 +2643,7 @@ export class ProjectService { private clearSemanticCache(project: Project) { project.resolutionCache.clear(); project.getLanguageService(/*ensureSynchronized*/ false).cleanupSemanticCache(); + project.cleanupProgram(); project.markAsDirty(); } diff --git a/src/server/project.ts b/src/server/project.ts index 129d18a2dc1..381ebb5e9df 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -393,7 +393,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo private packageJsonsForAutoImport: Set | undefined; /** @internal */ - private noDtsResolutionProject?: AuxiliaryProject | undefined; + noDtsResolutionProject?: AuxiliaryProject | undefined; /** @internal */ getResolvedProjectReferenceToRedirect(_fileName: string): ResolvedProjectReference | undefined { @@ -969,6 +969,19 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo this.projectService.onUpdateLanguageServiceStateForProject(this, /*languageServiceEnabled*/ true); } + /** @internal */ + cleanupProgram() { + if (this.program) { + // Root files are always attached to the project irrespective of program + for (const f of this.program.getSourceFiles()) { + this.detachScriptInfoIfNotRoot(f.fileName); + } + this.program.forEachResolvedProjectReference(ref => + this.detachScriptInfoFromProject(ref.sourceFile.fileName)); + this.program = undefined; + } + } + disableLanguageService(lastFileExceededProgramSize?: string) { if (!this.languageServiceEnabled) { return; @@ -976,6 +989,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo Debug.assert(this.projectService.serverMode !== LanguageServiceMode.Syntactic); this.languageService.cleanupSemanticCache(); this.languageServiceEnabled = false; + this.cleanupProgram(); this.lastFileExceededProgramSize = lastFileExceededProgramSize; this.builderState = undefined; if (this.autoImportProviderHost) { @@ -984,6 +998,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo this.autoImportProviderHost = undefined; this.resolutionCache.closeTypeRootsWatch(); this.clearGeneratedFileWatch(); + this.projectService.verifyDocumentRegistry(); this.projectService.onUpdateLanguageServiceStateForProject(this, /*languageServiceEnabled*/ false); } @@ -1030,17 +1045,10 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo close() { this.projectService.typingsCache.onProjectClosed(this); this.closeWatchingTypingLocations(); - if (this.program) { - // if we have a program - release all files that are enlisted in program but arent root - // The releasing of the roots happens later - // The project could have pending update remaining and hence the info could be in the files but not in program graph - for (const f of this.program.getSourceFiles()) { - this.detachScriptInfoIfNotRoot(f.fileName); - } - this.program.forEachResolvedProjectReference(ref => - this.detachScriptInfoFromProject(ref.sourceFile.fileName)); - } - + // if we have a program - release all files that are enlisted in program but arent root + // The releasing of the roots happens later + // The project could have pending update remaining and hence the info could be in the files but not in program graph + this.cleanupProgram(); // Release external files forEach(this.externalFiles, externalFile => this.detachScriptInfoIfNotRoot(externalFile)); // Always remove root files from the project @@ -1492,6 +1500,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo private updateGraphWorker() { const oldProgram = this.languageService.getCurrentProgram(); + Debug.assert(oldProgram === this.program); Debug.assert(!this.isClosed(), "Called update graph worker of closed project"); this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`); const start = timestamp(); @@ -1633,6 +1642,8 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo else if (this.program !== oldProgram) { this.writeLog(`Different program with same set of files`); } + // Verify the document registry count + this.projectService.verifyDocumentRegistry(); return hasNewProgram; } @@ -2342,7 +2353,8 @@ export class InferredProject extends Project { } } -class AuxiliaryProject extends Project { +/** @internal */ +export class AuxiliaryProject extends Project { constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, currentDirectory: string) { super(projectService.newAuxiliaryProjectName(), ProjectKind.Auxiliary, @@ -2361,7 +2373,6 @@ class AuxiliaryProject extends Project { return true; } - /** @internal */ override scheduleInvalidateResolutionsOfFailedLookupLocations(): void { // Invalidation will happen on-demand as part of updateGraph return; diff --git a/src/server/session.ts b/src/server/session.ts index 066b3989419..c74ab264f2e 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -946,6 +946,7 @@ export interface SessionOptions { pluginProbeLocations?: readonly string[]; allowLocalPluginLoads?: boolean; typesMapLocation?: string; + /** @internal */ incrementalVerifier?: (service: ProjectService) => void; } export class Session implements EventSender { @@ -1010,7 +1011,8 @@ export class Session implements EventSender { allowLocalPluginLoads: opts.allowLocalPluginLoads, typesMapLocation: opts.typesMapLocation, serverMode: opts.serverMode, - session: this + session: this, + incrementalVerifier: opts.incrementalVerifier, }; this.projectService = new ProjectService(settings); this.projectService.setPerformanceEventHandler(this.performanceEventHandler.bind(this)); @@ -1339,6 +1341,7 @@ export class Session implements EventSender { this.logger.info(`cleaning ${caption}`); for (const p of projects) { p.getLanguageService(/*ensureSynchronized*/ false).cleanupSemanticCache(); + p.cleanupProgram(); } } diff --git a/src/services/documentRegistry.ts b/src/services/documentRegistry.ts index 50f660d6bf7..b8ef0757b77 100644 --- a/src/services/documentRegistry.ts +++ b/src/services/documentRegistry.ts @@ -117,6 +117,8 @@ export interface DocumentRegistry { ): SourceFile; getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey; + /** @internal */ + getDocumentRegistryBucketKeyWithMode(key: DocumentRegistryBucketKey, mode: ResolutionMode): DocumentRegistryBucketKeyWithMode; /** * Informs the DocumentRegistry that a file is not needed any longer. * @@ -147,10 +149,8 @@ export interface DocumentRegistry { releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind?: ScriptKind): void; releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind: ScriptKind, impliedNodeFormat: ResolutionMode): void; // eslint-disable-line @typescript-eslint/unified-signatures - /** @internal */ - getLanguageServiceRefCounts(path: Path, scriptKind: ScriptKind): [string, number | undefined][]; - reportStats(): string; + /** @internal */ getBuckets(): Map>; } /** @internal */ @@ -161,7 +161,8 @@ export interface ExternalDocumentCache { export type DocumentRegistryBucketKey = string & { __bucketKey: any }; -interface DocumentRegistryEntry { +/** @internal */ +export interface DocumentRegistryEntry { sourceFile: SourceFile; // The number of language services that this source file is referenced in. When no more @@ -170,8 +171,10 @@ interface DocumentRegistryEntry { languageServiceRefCount: number; } -type BucketEntry = DocumentRegistryEntry | Map; -function isDocumentRegistryEntry(entry: BucketEntry): entry is DocumentRegistryEntry { +/** @internal */ +export type BucketEntry = DocumentRegistryEntry | Map; +/** @internal */ +export function isDocumentRegistryEntry(entry: BucketEntry): entry is DocumentRegistryEntry { return !!(entry as DocumentRegistryEntry).sourceFile; } @@ -383,14 +386,6 @@ export function createDocumentRegistryInternal(useCaseSensitiveFileNames?: boole } } - function getLanguageServiceRefCounts(path: Path, scriptKind: ScriptKind) { - return arrayFrom(buckets.entries(), ([key, bucket]): [string, number | undefined] => { - const bucketEntry = bucket.get(path); - const entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind); - return [key, entry && entry.languageServiceRefCount]; - }); - } - return { acquireDocument, acquireDocumentWithKey, @@ -398,9 +393,10 @@ export function createDocumentRegistryInternal(useCaseSensitiveFileNames?: boole updateDocumentWithKey, releaseDocument, releaseDocumentWithKey, - getLanguageServiceRefCounts, + getKeyForCompilationSettings, + getDocumentRegistryBucketKeyWithMode, reportStats, - getKeyForCompilationSettings + getBuckets: () => buckets, }; } diff --git a/src/services/services.ts b/src/services/services.ts index d1ce067ca40..d631ce9a0a1 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1937,10 +1937,6 @@ export function createLanguageService( } function cleanupSemanticCache(): void { - program = undefined!; // TODO: GH#18217 - } - - function dispose(): void { if (program) { // Use paths to ensure we are using correct key and paths as document registry could be created with different current directory than host const key = documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()); @@ -1948,6 +1944,10 @@ export function createLanguageService( documentRegistry.releaseDocumentWithKey(f.resolvedPath, key, f.scriptKind, f.impliedNodeFormat)); program = undefined!; // TODO: GH#18217 } + } + + function dispose(): void { + cleanupSemanticCache(); host = undefined!; } diff --git a/src/testRunner/unittests/helpers/tsserver.ts b/src/testRunner/unittests/helpers/tsserver.ts index c5bca88bd72..0192fa5388b 100644 --- a/src/testRunner/unittests/helpers/tsserver.ts +++ b/src/testRunner/unittests/helpers/tsserver.ts @@ -1,3 +1,4 @@ +import { incrementalVerifier } from "../../../harness/incrementalUtils"; import * as Harness from "../../_namespaces/Harness"; import * as ts from "../../_namespaces/ts"; import { ActionWatchTypingLocations } from "../../_namespaces/ts.server"; @@ -553,7 +554,8 @@ export function createSession(host: TestServerHost, opts: Partial { byteLength: Buffer.byteLength, hrtime: process.hrtime, logger: nullLogger(), - canUseEvents: true + canUseEvents: true, + incrementalVerifier, }; return new TestSession(opts); } @@ -387,7 +389,8 @@ describe("unittests:: tsserver:: Session:: exceptions", () => { byteLength: Buffer.byteLength, hrtime: process.hrtime, logger: nullLogger(), - canUseEvents: true + canUseEvents: true, + incrementalVerifier, }); this.addProtocolHandler(command, this.exceptionRaisingHandler); } @@ -434,7 +437,8 @@ describe("unittests:: tsserver:: Session:: how Session is extendable via subclas byteLength: Buffer.byteLength, hrtime: process.hrtime, logger: createHasErrorMessageLogger(), - canUseEvents: true + canUseEvents: true, + incrementalVerifier, }); this.addProtocolHandler(this.customHandler, () => { return { response: undefined, responseRequired: true }; @@ -502,7 +506,8 @@ describe("unittests:: tsserver:: Session:: an example of using the Session API t byteLength: Buffer.byteLength, hrtime: process.hrtime, logger: createHasErrorMessageLogger(), - canUseEvents: true + canUseEvents: true, + incrementalVerifier, }); this.addProtocolHandler("echo", (req: ts.server.protocol.Request) => ({ response: req.arguments, diff --git a/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan,-and-orphan-script-info-changes.js b/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan,-and-orphan-script-info-changes.js index 827d9eca05d..fb5aff08f7a 100644 --- a/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan,-and-orphan-script-info-changes.js +++ b/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan,-and-orphan-script-info-changes.js @@ -68,6 +68,11 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/index.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +DocumentRegistry:: + Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined + /user/username/projects/myproject/index.ts: TS 1 + /user/username/projects/myproject/module1.d.ts: TS 1 + /a/lib/lib.d.ts: TS 1 Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) @@ -82,6 +87,10 @@ Info seq [hh:mm:ss:mss] Files (2) Part of 'files' list in tsconfig.json Info seq [hh:mm:ss:mss] ----------------------------------------------- +DocumentRegistry:: + Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined + /user/username/projects/myproject/index.ts: TS 1 + /a/lib/lib.d.ts: TS 1 Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /user/username/projects/myproject/module1.d.ts 1:: WatchInfo: /user/username/projects/myproject/module1.d.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/module1.d.ts 1:: WatchInfo: /user/username/projects/myproject/module1.d.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json @@ -100,4 +109,9 @@ Info seq [hh:mm:ss:mss] Files (3) index.ts Part of 'files' list in tsconfig.json -Info seq [hh:mm:ss:mss] ----------------------------------------------- \ No newline at end of file +Info seq [hh:mm:ss:mss] ----------------------------------------------- +DocumentRegistry:: + Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined + /user/username/projects/myproject/index.ts: TS 1 + /a/lib/lib.d.ts: TS 1 + /user/username/projects/myproject/module1.d.ts: TS 1 \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan.js b/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan.js index ac1fcbbb9f2..4c987008954 100644 --- a/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan.js +++ b/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan.js @@ -68,6 +68,11 @@ Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/index.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json +DocumentRegistry:: + Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined + /user/username/projects/myproject/index.ts: TS 1 + /user/username/projects/myproject/module1.d.ts: TS 1 + /a/lib/lib.d.ts: TS 1 Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) @@ -82,6 +87,10 @@ Info seq [hh:mm:ss:mss] Files (2) Part of 'files' list in tsconfig.json Info seq [hh:mm:ss:mss] ----------------------------------------------- +DocumentRegistry:: + Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined + /user/username/projects/myproject/index.ts: TS 1 + /a/lib/lib.d.ts: TS 1 Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) @@ -98,4 +107,9 @@ Info seq [hh:mm:ss:mss] Files (3) index.ts Part of 'files' list in tsconfig.json -Info seq [hh:mm:ss:mss] ----------------------------------------------- \ No newline at end of file +Info seq [hh:mm:ss:mss] ----------------------------------------------- +DocumentRegistry:: + Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined + /user/username/projects/myproject/index.ts: TS 1 + /a/lib/lib.d.ts: TS 1 + /user/username/projects/myproject/module1.d.ts: TS 1 \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js b/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js index ac29f63d49a..e5daa9d3bc4 100644 --- a/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js +++ b/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js @@ -581,6 +581,13 @@ Info seq [hh:mm:ss:mss] File '/user/username/projects/package.json' does not ex Info seq [hh:mm:ss:mss] File '/user/username/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== +Info seq [hh:mm:ss:mss] Module resolution kind is not specified, using 'Node16'. +Info seq [hh:mm:ss:mss] Resolving in CJS mode with conditions 'require', 'types', 'node'. +Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +Info seq [hh:mm:ss:mss] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. +Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/fileB.mts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== Info seq [hh:mm:ss:mss] File '/a/lib/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/a/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. @@ -770,13 +777,7 @@ Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/package.jso Info seq [hh:mm:ss:mss] Found 'package.json' at '/user/username/projects/myproject/package.json'. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. -Info seq [hh:mm:ss:mss] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== -Info seq [hh:mm:ss:mss] Module resolution kind is not specified, using 'Node16'. -Info seq [hh:mm:ss:mss] Resolving in CJS mode with conditions 'require', 'types', 'node'. -Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. -Info seq [hh:mm:ss:mss] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/fileB.mts' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== +Info seq [hh:mm:ss:mss] Reusing resolution of module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. Info seq [hh:mm:ss:mss] File '/a/lib/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/a/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited.js b/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited.js index c7bce1aadad..6705d7ae7bb 100644 --- a/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited.js +++ b/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited.js @@ -771,6 +771,13 @@ Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/package.jso Info seq [hh:mm:ss:mss] Found 'package.json' at '/user/username/projects/myproject/package.json'. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. +Info seq [hh:mm:ss:mss] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== +Info seq [hh:mm:ss:mss] Module resolution kind is not specified, using 'Node16'. +Info seq [hh:mm:ss:mss] Resolving in ESM mode with conditions 'import', 'types', 'node'. +Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +Info seq [hh:mm:ss:mss] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. +Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/fileB.mts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== Info seq [hh:mm:ss:mss] File '/a/lib/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/a/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. @@ -954,6 +961,13 @@ Info seq [hh:mm:ss:mss] File '/user/username/projects/package.json' does not ex Info seq [hh:mm:ss:mss] File '/user/username/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== +Info seq [hh:mm:ss:mss] Module resolution kind is not specified, using 'Node16'. +Info seq [hh:mm:ss:mss] Resolving in CJS mode with conditions 'require', 'types', 'node'. +Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +Info seq [hh:mm:ss:mss] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. +Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/fileB.mts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== Info seq [hh:mm:ss:mss] File '/a/lib/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/a/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js b/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js index 5411c7d1502..493f32113f2 100644 --- a/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js +++ b/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js @@ -687,6 +687,15 @@ Info seq [hh:mm:ss:mss] 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/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + Matched by include pattern './src/**/*' in 'tsconfig-src.json' + src/main.ts + Matched by include pattern './src/**/*' in 'tsconfig-src.json' Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -719,7 +728,7 @@ Info seq [hh:mm:ss:mss] Files (3) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -733,6 +742,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-indirect-project.js b/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-indirect-project.js index e7b2b0d667d..01665527da7 100644 --- a/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-indirect-project.js +++ b/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-indirect-project.js @@ -634,6 +634,16 @@ Info seq [hh:mm:ss:mss] Files (4) /user/username/projects/myproject/src/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" /user/username/projects/myproject/indirect1/main.ts Text-2 "import { foo } from 'main';\nfoo;\nexport function bar() {}" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + src/main.ts + Imported via 'main' from file 'indirect1/main.ts' + indirect1/main.ts + Part of 'files' list in tsconfig.json Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -666,7 +676,7 @@ Info seq [hh:mm:ss:mss] Files (4) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -680,6 +690,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set.js b/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set.js index c0568c91be3..006ec9ff044 100644 --- a/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set.js +++ b/tests/baselines/reference/tsserver/projectReferences/disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set.js @@ -480,11 +480,11 @@ Info seq [hh:mm:ss:mss] Files (0) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject2*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject3*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -498,6 +498,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject2*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject3* @@ -518,6 +524,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject3*' (Inferred) Info seq [hh:mm:ss:mss] 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/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" + + + ../../../../../a/lib/lib.d.ts + Default library for target 'es5' + main.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/projectReferences/project-is-directly-referenced-by-solution.js b/tests/baselines/reference/tsserver/projectReferences/project-is-directly-referenced-by-solution.js index 31e70af71ef..ff084bf395a 100644 --- a/tests/baselines/reference/tsserver/projectReferences/project-is-directly-referenced-by-solution.js +++ b/tests/baselines/reference/tsserver/projectReferences/project-is-directly-referenced-by-solution.js @@ -748,6 +748,15 @@ Info seq [hh:mm:ss:mss] 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/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + Matched by include pattern './src/**/*' in 'tsconfig-src.json' + src/main.ts + Matched by include pattern './src/**/*' in 'tsconfig-src.json' Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -782,7 +791,7 @@ Info seq [hh:mm:ss:mss] Files (3) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -796,6 +805,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/projectReferences/project-is-indirectly-referenced-by-solution.js b/tests/baselines/reference/tsserver/projectReferences/project-is-indirectly-referenced-by-solution.js index a8676fdd718..e73da1642f5 100644 --- a/tests/baselines/reference/tsserver/projectReferences/project-is-indirectly-referenced-by-solution.js +++ b/tests/baselines/reference/tsserver/projectReferences/project-is-indirectly-referenced-by-solution.js @@ -888,6 +888,15 @@ Info seq [hh:mm:ss:mss] 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/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + Matched by include pattern './src/**/*' in 'tsconfig-src.json' + src/main.ts + Matched by include pattern './src/**/*' in 'tsconfig-src.json' Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -922,7 +931,7 @@ Info seq [hh:mm:ss:mss] Files (3) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -936,6 +945,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js index deded679bdd..5669183a4e1 100644 --- a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js +++ b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js @@ -720,6 +720,18 @@ Info seq [hh:mm:ss:mss] Files (5) /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" /user/username/projects/myproject/indirect1/main.ts Text-2 "import { foo } from 'main';\nfoo;\nexport function bar() {}" /user/username/projects/myproject/own/main.ts Text-2 "import { bar } from 'main';\nbar;" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + src/main.ts + Imported via 'main' from file 'indirect1/main.ts' + indirect1/main.ts + Imported via 'main' from file 'own/main.ts' + own/main.ts + Part of 'files' list in tsconfig.json Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -768,6 +780,15 @@ Info seq [hh:mm:ss:mss] 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/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + Matched by include pattern './src/**/*' in 'tsconfig-src.json' + src/main.ts + Matched by include pattern './src/**/*' in 'tsconfig-src.json' Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -800,20 +821,26 @@ Info seq [hh:mm:ss:mss] Files (3) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /dummy/dummy.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/src/main.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json,/user/username/projects/myproject/tsconfig-src.json +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig-src.json,/user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 3 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: @@ -833,4 +860,4 @@ Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /dummy/dummy.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/src/main.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json,/user/username/projects/myproject/tsconfig-src.json \ No newline at end of file +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig-src.json,/user/username/projects/myproject/tsconfig.json \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-indirect-project.js b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-indirect-project.js index c14e280c392..36ed3640cc5 100644 --- a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-indirect-project.js +++ b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-indirect-project.js @@ -662,6 +662,18 @@ Info seq [hh:mm:ss:mss] Files (5) /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" /user/username/projects/myproject/indirect1/main.ts Text-2 "import { foo } from 'main';\nfoo;\nexport function bar() {}" /user/username/projects/myproject/own/main.ts Text-2 "import { bar } from 'main';\nbar;" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + src/main.ts + Imported via 'main' from file 'indirect1/main.ts' + indirect1/main.ts + Imported via 'main' from file 'own/main.ts' + own/main.ts + Part of 'files' list in tsconfig.json Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -711,6 +723,16 @@ Info seq [hh:mm:ss:mss] Files (4) /user/username/projects/myproject/src/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" /user/username/projects/myproject/indirect1/main.ts Text-2 "import { foo } from 'main';\nfoo;\nexport function bar() {}" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + src/main.ts + Imported via 'main' from file 'indirect1/main.ts' + indirect1/main.ts + Part of 'files' list in tsconfig.json Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -743,7 +765,7 @@ Info seq [hh:mm:ss:mss] Files (4) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -757,6 +779,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set.js b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set.js index 881568216ec..e197695966e 100644 --- a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set.js +++ b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set.js @@ -414,6 +414,16 @@ Info seq [hh:mm:ss:mss] Files (4) /user/username/projects/myproject/src/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" /user/username/projects/myproject/own/main.ts Text-2 "import { foo } from 'main';\nfoo;\nexport function bar() {}" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + src/main.ts + Imported via 'main' from file 'own/main.ts' + own/main.ts + Part of 'files' list in tsconfig.json Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -442,7 +452,7 @@ Info seq [hh:mm:ss:mss] Files (4) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -456,6 +466,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-found-is-not-solution-but-references-open-file-through-project-reference.js b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-found-is-not-solution-but-references-open-file-through-project-reference.js index 4932e5e4bba..5e123b84f29 100644 --- a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-found-is-not-solution-but-references-open-file-through-project-reference.js +++ b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-found-is-not-solution-but-references-open-file-through-project-reference.js @@ -773,6 +773,16 @@ Info seq [hh:mm:ss:mss] Files (4) /user/username/projects/myproject/src/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" /user/username/projects/myproject/own/main.ts Text-2 "import { foo } from 'main';\nfoo;\nexport function bar() {}" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + src/main.ts + Imported via 'main' from file 'own/main.ts' + own/main.ts + Part of 'files' list in tsconfig.json Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -821,6 +831,15 @@ Info seq [hh:mm:ss:mss] 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/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + Matched by include pattern './src/**/*' in 'tsconfig-src.json' + src/main.ts + Matched by include pattern './src/**/*' in 'tsconfig-src.json' Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -855,12 +874,12 @@ Info seq [hh:mm:ss:mss] Files (3) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/src/main.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json,/user/username/projects/myproject/tsconfig-src.json +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig-src.json,/user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] FileName: /dummy/dummy.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* @@ -869,6 +888,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: @@ -886,7 +911,7 @@ Info seq [hh:mm:ss:mss] Files (2) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/src/main.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json,/user/username/projects/myproject/tsconfig-src.json +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig-src.json,/user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] FileName: /dummy/dummy.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* Before request diff --git a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-is-indirectly-referenced-by-solution.js b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-is-indirectly-referenced-by-solution.js index f6d727c03ed..a50344bcdf0 100644 --- a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-is-indirectly-referenced-by-solution.js +++ b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-is-indirectly-referenced-by-solution.js @@ -929,6 +929,18 @@ Info seq [hh:mm:ss:mss] Files (5) /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" /user/username/projects/myproject/indirect1/main.ts Text-2 "import { foo } from 'main';\nfoo;\nexport function bar() {}" /user/username/projects/myproject/own/main.ts Text-2 "import { bar } from 'main';\nbar;" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + src/main.ts + Imported via 'main' from file 'indirect1/main.ts' + indirect1/main.ts + Imported via 'main' from file 'own/main.ts' + own/main.ts + Part of 'files' list in tsconfig.json Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -977,6 +989,15 @@ Info seq [hh:mm:ss:mss] 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/helpers/functions.ts Text-2 "export const foo = 1;" /user/username/projects/myproject/src/main.ts SVC-2-0 "import { foo } from 'helpers/functions';\nexport { foo };" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + src/helpers/functions.ts + Imported via 'helpers/functions' from file 'src/main.ts' + Matched by include pattern './src/**/*' in 'tsconfig-src.json' + src/main.ts + Matched by include pattern './src/**/*' in 'tsconfig-src.json' Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] event: @@ -1011,12 +1032,12 @@ Info seq [hh:mm:ss:mss] Files (3) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (2) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/src/main.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json,/user/username/projects/myproject/tsconfig-src.json +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig-src.json,/user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] FileName: /dummy/dummy.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* @@ -1025,6 +1046,12 @@ Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] 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; }" /dummy/dummy.ts SVC-1-0 "let a = 10;" + + + ../a/lib/lib.d.ts + Default library for target 'es5' + dummy.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: @@ -1042,7 +1069,7 @@ Info seq [hh:mm:ss:mss] Files (2) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: Info seq [hh:mm:ss:mss] FileName: /user/username/projects/myproject/src/main.ts ProjectRootPath: undefined -Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig.json,/user/username/projects/myproject/tsconfig-src.json +Info seq [hh:mm:ss:mss] Projects: /user/username/projects/myproject/tsconfig-src.json,/user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] FileName: /dummy/dummy.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* Before request diff --git a/tests/baselines/reference/tsserver/reloadProjects/configured-project.js b/tests/baselines/reference/tsserver/reloadProjects/configured-project.js index e745c39713e..b043c351e8c 100644 --- a/tests/baselines/reference/tsserver/reloadProjects/configured-project.js +++ b/tests/baselines/reference/tsserver/reloadProjects/configured-project.js @@ -311,6 +311,17 @@ Info seq [hh:mm:ss:mss] Files (4) /user/username/projects/myproject/node_modules/module1/index.d.ts Text-1 "export function foo(): string;" /user/username/projects/myproject/file2.ts Text-2 "export function bar(){}\n bar();" /user/username/projects/myproject/file1.ts SVC-1-0 "import { foo } from \"module1\";\n foo();\n import { bar } from \"./file2\";\n bar();" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + node_modules/module1/index.d.ts + Imported via "module1" from file 'file1.ts' + file2.ts + Imported via "./file2" from file 'file1.ts' + Matched by default include pattern '**/*' + file1.ts + Matched by default include pattern '**/*' Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/reloadProjects/external-project-with-config-file.js b/tests/baselines/reference/tsserver/reloadProjects/external-project-with-config-file.js index fd99e788d38..b21acff2fb6 100644 --- a/tests/baselines/reference/tsserver/reloadProjects/external-project-with-config-file.js +++ b/tests/baselines/reference/tsserver/reloadProjects/external-project-with-config-file.js @@ -369,6 +369,17 @@ Info seq [hh:mm:ss:mss] Files (4) /user/username/projects/myproject/node_modules/module1/index.d.ts Text-1 "export function foo(): string;" /user/username/projects/myproject/file2.ts Text-2 "export function bar(){}\n bar();" /user/username/projects/myproject/file1.ts Text-1 "import { foo } from \"module1\";\n foo();\n import { bar } from \"./file2\";\n bar();" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + node_modules/module1/index.d.ts + Imported via "module1" from file 'file1.ts' + file2.ts + Imported via "./file2" from file 'file1.ts' + Matched by default include pattern '**/*' + file1.ts + Matched by default include pattern '**/*' Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/reloadProjects/external-project.js b/tests/baselines/reference/tsserver/reloadProjects/external-project.js index e9bc2529a8d..576f2271241 100644 --- a/tests/baselines/reference/tsserver/reloadProjects/external-project.js +++ b/tests/baselines/reference/tsserver/reloadProjects/external-project.js @@ -295,6 +295,17 @@ Info seq [hh:mm:ss:mss] Files (4) /user/username/projects/myproject/node_modules/module1/index.d.ts Text-1 "export function foo(): string;" /user/username/projects/myproject/file2.ts Text-2 "export function bar(){}\n bar();" /user/username/projects/myproject/file1.ts Text-1 "import { foo } from \"module1\";\n foo();\n import { bar } from \"./file2\";\n bar();" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + node_modules/module1/index.d.ts + Imported via "module1" from file 'file1.ts' + file2.ts + Imported via "./file2" from file 'file1.ts' + Root file specified for compilation + file1.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: diff --git a/tests/baselines/reference/tsserver/reloadProjects/inferred-project.js b/tests/baselines/reference/tsserver/reloadProjects/inferred-project.js index 38ee842c9d2..0b7ee799899 100644 --- a/tests/baselines/reference/tsserver/reloadProjects/inferred-project.js +++ b/tests/baselines/reference/tsserver/reloadProjects/inferred-project.js @@ -172,7 +172,7 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/pr Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/node_modules/@types 1 {"excludeFiles":["/user/username/projects/myproject/file2.ts"],"excludeDirectories":["/user/username/projects/myproject/node_modules"]} Project: /dev/null/inferredProject1* WatchType: Type roots Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (3) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -270,7 +270,7 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/pr Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/node_modules/@types 1 {"excludeFiles":["/user/username/projects/myproject/file2.ts"],"excludeDirectories":["/user/username/projects/myproject/node_modules"]} Project: /dev/null/inferredProject1* WatchType: Type roots Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (4) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -288,6 +288,16 @@ Info seq [hh:mm:ss:mss] Files (4) /user/username/projects/myproject/node_modules/module1/index.d.ts Text-1 "export function foo(): string;" /user/username/projects/myproject/file2.ts Text-2 "export function bar(){}\n bar();" /user/username/projects/myproject/file1.ts SVC-1-0 "import { foo } from \"module1\";\n foo();\n import { bar } from \"./file2\";\n bar();" + + + ../../../../a/lib/lib.d.ts + Default library for target 'es5' + node_modules/module1/index.d.ts + Imported via "module1" from file 'file1.ts' + file2.ts + Imported via "./file2" from file 'file1.ts' + file1.ts + Root file specified for compilation Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles: @@ -352,7 +362,7 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/pr Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/node_modules/@types 1 {"excludeFiles":["/user/username/projects/myproject/file2.ts"],"excludeDirectories":["/user/username/projects/myproject/node_modules"]} Project: /dev/null/inferredProject1* WatchType: Type roots Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles: Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) -Info seq [hh:mm:ss:mss] Files (4) +Info seq [hh:mm:ss:mss] Files (0) NoProgram Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: