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

typescript-vue-plugin caches getExternalFiles and hence doesnt have updated list of external files when new vue files are added #3555

Closed
sheetalkamat opened this issue Sep 11, 2023 · 6 comments · Fixed by #3649 or withastro/language-tools#679
Labels
bug Something isn't working

Comments

@sheetalkamat
Copy link

I was looking into microsoft/TypeScript#55525 and have fix as part of microsoft/TypeScript#55716
i have a test that seems to work but validating against the current plugin, seems to not work as expected. When i debugged it, it seems the external files are cached for the project and hence when queried about it while updating list of files for the project, it seems to get the old list and does not have newly added vue file.
f7ab51e#diff-4908c4b643b0a53f52116f73ef63e7707a880156989108a78d60e3b5a94114afR36 is the corresponding line.

@johnsoncodehk
Copy link
Member

Thanks for letting me know! Do you suggest that instead of caching external files, we re-search for .vue files in the project on every getExternalFiles request? Do you think this could cause potential performance issues?

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Oct 8, 2023
@sheetalkamat
Copy link
Author

If using cache, the plugin need to be looking for addition or deletion of .vue files and on those cases you would want to search the files again from the disk and update the cache.

@johnsoncodehk
Copy link
Member

In case I misunderstood, should we maintain our own file watchers for *.vue to update the cache?

@sheetalkamat
Copy link
Author

Per current design, yes.

@sheetalkamat
Copy link
Author

But we could pass parameter to getExternalFiles about what kind of update on program is happening that you could use.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Oct 9, 2023

This will be neat, thanks! cc @mizdra, @Princesseuh

Related code:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants