Skip to content

Fix invalidating cache in the WatchingResolvePathTemplateManager when the source teplate file is renaming #7

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vladsm
Copy link

@vladsm vladsm commented Jul 2, 2021

I'm using WatchingResolvePathTemplateManager to simplify template creation at the development time leveraging change-and-check iterative process without restarting my application.

When trying to change source template file in the Visual Studio it appears that template cache is not invalidating, while with changes in simple text editor everything works fine. The reason is Visual Studion makes files changes by creating temporal files and renaming them to editing ones after all.

In WatchingResolvePathTemplateManager files renamings was handled with emulating two other events: delete file and create file. The issue was in using FileSystemEventArgs constructor calling which accepts file directory as a second argument. But the full path of the file was passed to it. This causes wrong template file invalidating.

I fixed it by explicitly calling invalidating function for "deleted" and "created" files in "file renamed" event handler.

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.

1 participant