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

fix: ensure SvelteKit file is patched when first open #2160

Merged
merged 2 commits into from Sep 19, 2023

Conversation

jasonlyu123
Copy link
Member

#2053

If a file is patched the first time, typescript might have cached the unpatched version. It won't update even if we return the patched version in getScriptSnapshot. This should only happen to files the client opens after the first compilation of the proxy language service. In the first compilation, there won't be any files in the cache. And once there are any updates TypeScript will reparse the file with the patched snapshot.

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Nice!

@dummdidumm dummdidumm merged commit 54f921a into sveltejs:master Sep 19, 2023
2 checks passed
dummdidumm added a commit that referenced this pull request Sep 19, 2023
@michal-weglarz
Copy link

Thank you for fixing this 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants