Skip to content

Conversation

@DanielRosenwasser
Copy link
Member

Fixes #268.

@@ -5,9 +5,9 @@ interface System {
newLine: string;
useCaseSensitiveFileNames: boolean;
write(s: string): void;
writeErr(s: string): void;
Copy link
Contributor

Choose a reason for hiding this comment

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

in the future I would do such a change in a separate commit at least, as it makes the change noisy

Copy link
Member Author

Choose a reason for hiding this comment

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

Noted, sorry about that.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 1, 2014

Love it.. thanks! 👍

@DanielRosenwasser
Copy link
Member Author

Addressed your feedback. I also ran into some weird issues with editing in vim, where if you exit and quit (:wq), recompilation is triggered twice. This was easily fixed by bringing back the old watchFile behavior:

function fileChanged(curr:any, prev:any) {
    if (+curr.mtime <= +prev.mtime) { // this check
        return;                           
    }                                     

    callback(fileName);                   
};                                        

@basarat
Copy link
Contributor

basarat commented Aug 1, 2014

👍 nice. Very insightful.

We no longer recompile unless the new last-modified time is more recent.
};

function fileChanged(curr:any, prev:any) {
if (+curr.mtime <= +prev.mtime) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

So even with the buffer period brought up to 500ms, my personal machine still has issues with this when saving in something like vim because it appears that the mtime and ctime are modified independently.

DanielRosenwasser and others added 2 commits August 1, 2014 18:54
Edited comments, no longer releasing 'program' as it is potentially confusing and doesn't buy us a heck of a lot anyway.
DanielRosenwasser added a commit that referenced this pull request Aug 3, 2014
Support the '--watch' compiler flag.
@DanielRosenwasser DanielRosenwasser merged commit 9a89147 into master Aug 3, 2014
@DanielRosenwasser DanielRosenwasser deleted the watcherIardlyKnowEr branch August 3, 2014 00:52
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support --watch on node

5 participants