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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled JS file not updating if already open #14

Closed
Layoric opened this issue Mar 24, 2016 · 3 comments
Closed

Compiled JS file not updating if already open #14

Layoric opened this issue Mar 24, 2016 · 3 comments
Labels

Comments

@Layoric
Copy link

Layoric commented Mar 24, 2016

Nice addin and thanks for keeping it up to date 馃憤

I'm noticing an issue with the generated .js file when compiling on save where if the .js file is open in Xamarin Studio, it doesn't reflect changes from compiling the corresponding .ts file.

Reproduction steps:
1.Create/add to project myclass.ts
2.Create simple class

class MyClass { }

3.Save (with option to compile on save enabled).
4.Add myclass.js to project and open it.
5.Modify myclass.ts and save
6.myclass.js hasn't updated since first opened.

I'm not sure the best way to approach the problem, as when I've done it in the past for an Xamarin Studio addin, the best way I could find was to force the IDE to close and reopen the file, like so. Any ideas?

Using Xamarin Studio 5.10.1 (build 6) and addin version 0.9 on OSX

@mrward
Copy link
Owner

mrward commented Mar 24, 2016

The TypeScript addin should call the FileService.NotifyFileChanged after it compiles the file, but currently it is not doing that. This should cause the file to automatically be reloaded in the text editor.

@mrward mrward added the bug label Mar 24, 2016
@Layoric
Copy link
Author

Layoric commented Mar 24, 2016

@mrward Thanks for that info! I had trouble with FileService.NotifyFileChanged, in the past but testing it now, seems to work well 馃憤

@mrward
Copy link
Owner

mrward commented Mar 25, 2016

FileService.NotifyFileChanged does not always cause the file to be reloaded even if the autoreload flag is set. In Xamarin Studio 5 when FileService.NotifyFileChanged is called the changed file is automatically reloaded by the FileRegistry class. However if FileService.NotifyFileChanged is called when the document is being saved then all file changes are ignored since the TrackFileChanges flag is set to false.

This is a problem for the TypeScript addin since it uses the FileService.FileChanged event when compile on save is being used. So the TypeScript addin may have to reload the file itself.

@mrward mrward closed this as completed in f151cd1 Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants