Skip to content

Make watch/FS testing code friendlier for project loading in module transformation #49087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/compiler/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,13 @@ namespace ts {
ExtendedConfigOfReferencedProject: "Extended config file of referenced project",
WildcardDirectoryOfReferencedProject: "Wild card directory of referenced project",
PackageJson: "package.json file",
ClosedScriptInfo: "Closed Script info",
ConfigFileForInferredRoot: "Config file for the inferred project root",
NodeModules: "node_modules for closed script infos and package.jsons affecting module specifier cache",
MissingSourceMapFile: "Missing source map file",
NoopConfigFileForInferredRoot: "Noop Config file for the inferred project root",
MissingGeneratedFile: "Missing generated file",
NodeModulesForModuleSpecifierCache: "node_modules for module specifier cache invalidation",
};

export interface WatchTypeRegistry {
Expand All @@ -521,6 +528,15 @@ namespace ts {
ExtendedConfigOfReferencedProject: "Extended config file of referenced project",
WildcardDirectoryOfReferencedProject: "Wild card directory of referenced project",
PackageJson: "package.json file",

// Additional tsserver specific watch information
ClosedScriptInfo: "Closed Script info",
ConfigFileForInferredRoot: "Config file for the inferred project root",
NodeModules: "node_modules for closed script infos and package.jsons affecting module specifier cache",
MissingSourceMapFile: "Missing source map file",
NoopConfigFileForInferredRoot: "Noop Config file for the inferred project root",
MissingGeneratedFile: "Missing generated file",
NodeModulesForModuleSpecifierCache: "node_modules for module specifier cache invalidation",
}

interface WatchFactory<X, Y = undefined> extends ts.WatchFactory<X, Y> {
Expand Down
2 changes: 1 addition & 1 deletion src/harness/virtualFileSystemWithWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ interface Array<T> { length: number; [n: number]: T; }`
symLink: string;
}

type FSEntry = FsFile | FsFolder | FsSymLink;
export type FSEntry = FsFile | FsFolder | FsSymLink;

function isFsFolder(s: FSEntry | undefined): s is FsFolder {
return !!s && isArray((s as FsFolder).entries);
Expand Down
1 change: 0 additions & 1 deletion src/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"types.ts",
"utilitiesPublic.ts",
"utilities.ts",
"watchType.ts",
"protocol.ts",
"scriptInfo.ts",
"typingsCache.ts",
Expand Down
19 changes: 0 additions & 19 deletions src/server/watchType.ts

This file was deleted.