Skip to content

Commit

Permalink
Make watch/FS testing code friendlier for project loading in module t…
Browse files Browse the repository at this point in the history
…ransformation (microsoft#49087)
  • Loading branch information
jakebailey authored May 12, 2022
1 parent b689cd0 commit 92894d3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
16 changes: 16 additions & 0 deletions src/compiler/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,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 @@ -527,6 +534,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.

0 comments on commit 92894d3

Please sign in to comment.