Giter Club home page Giter Club logo

Comments (6)

devongovett avatar devongovett commented on May 17, 2024

Same reply as #71.

from watcher.

bpasero avatar bpasero commented on May 17, 2024

Does that apply even to Windows? My tests resulted in the same on both platforms.

This might be a bit harder for VS Code to digest in case of atomic writes. But I need to test with our previous watchers if they behaved any different...

from watcher.

devongovett avatar devongovett commented on May 17, 2024

Hmm I think the logic is here:

std::string type = isCreated ? "create" : isDeleted ? "delete" : "update";

Perhaps we should have a case for both created and deleted that emits "updated" instead? It would still not happen all the time on macOS but should be a bit better elsewhere. I think we'd have to skip such a test on macOS. I guess that's why I did it this way - so it's consistent across platforms.

from watcher.

bpasero avatar bpasero commented on May 17, 2024

I am not sure this kind of event normalization should happen in the watcher: in the end what happens on disk is a delete followed by a create, so if anyone wants to normalize that to an "updated" event, they should do it. For the watcher I think it is important to distinguish though.

But if the watcher itself does not emit these 2 events, a client cannot do this.

I wonder if your structure of known files could help here (State)?

from watcher.

bpasero avatar bpasero commented on May 17, 2024

This issue is now being reported as microsoft/vscode#136460 for VS Code where it looks like the git process deletes and writes the .git/HEAD file very quickly. Previously extensions would listen to change events on this file to react and now have to change to listen to create events.

I was able to verify that our previous watchers reported the create+delete events and we did fold the event into a single change event.

from watcher.

Kynde avatar Kynde commented on May 17, 2024

... but linux uses inotify and one must remonitor that file after create! Coalescing that into modify breaks watching on linux.

This breaks on linux when used for example with git or (unmodified) vim.

from watcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.