Skip to content

fix(typescript): force update target file version on association dirty#267

Merged
johnsoncodehk merged 1 commit intomasterfrom
focue-update-target
Mar 6, 2025
Merged

fix(typescript): force update target file version on association dirty#267
johnsoncodehk merged 1 commit intomasterfrom
focue-update-target

Conversation

@johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Mar 6, 2025

In Glint, when the association script (.hbs) is updated and the target script (.ts) is not, the association script's diagnostics don't refresh correctly because the target script's getScriptVersion value hasn't changed.

We can't proxy getScriptVersion to deal with this, that would cause serious performance issues with the tsserver some how, so we send a change event to the tsserver session to force the target script to be considered new.

/cc @piotrtomiak, @machty

@johnsoncodehk johnsoncodehk merged commit efc7e88 into master Mar 6, 2025
6 of 8 checks passed
@johnsoncodehk johnsoncodehk deleted the focue-update-target branch March 6, 2025 18:55
@piotrtomiak
Copy link
Contributor

Thanks for heads up! I should be able to remove my workaround now, right?

@johnsoncodehk johnsoncodehk changed the title fix(typescript): focus update target file version on association dirty fix(typescript): force update target file version on association dirty Mar 8, 2025
@johnsoncodehk
Copy link
Member Author

@piotrtomiak I think yes! But of course we need to test it in WebStorm. (It has been tested in Glint)

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.

2 participants