Skip to content
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

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

Merged
merged 4 commits into from
May 12, 2022

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented May 12, 2022

Two changes that let me load all of TS into a single project for doing the module transformation without checker errors:

  • Export FSEntry in the test harness code; this type is indirectly returned from the public function snap, and declaration: true (which we need for composite) is incompatible. Exporting it makes TS happy.
  • Move tsserver's internal WatchTypeRegistry extras into compiler; this kind of augmentation prevents loading of everything as one project, and it turns out that this code was incorrect because it forgot to assign NodeModulesForModuleSpecifierCache to the object. Maybe this just needs to be an enum or something, rather than writing everything twice, but it's unfortunately already exported.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels May 12, 2022
@jakebailey jakebailey changed the title Make watch code friendlier for project loading in module transformation Make watch/FS testing code friendlier for project loading in module transformation May 12, 2022
@@ -521,6 +528,22 @@ 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
/* @internal */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything in this file is already internal ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it is, oops. I could have sworn it wasn't on my branch (maybe an error in my transformer code).

Now I'm even more compelled to make this an enum.

@jakebailey jakebailey merged commit 92894d3 into microsoft:main May 12, 2022
@jakebailey jakebailey deleted the watch-enum-thing branch May 12, 2022 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants