@@ -43,6 +43,7 @@ type ApplyResult struct {
4343 Stats IndexStats
4444 SynonymError error
4545 Changed bool
46+ ChangedPaths map [string ]fsnotify.Op
4647}
4748
4849type IndexManager struct {
@@ -325,7 +326,7 @@ func (m *IndexManager) ApplyChanges(ctx context.Context, changes map[string]fsno
325326 return ApplyResult {}, fmt .Errorf ("index manager not bootstrapped" )
326327 }
327328
328- result := ApplyResult {}
329+ result := ApplyResult {ChangedPaths : make ( map [ string ]fsnotify. Op ) }
329330 if len (changes ) == 0 {
330331 result .Stats = ComputeStats (m .index .Tree )
331332 result .Stats .CollectedNames = len (CollectNamesForLLM (m .index .Tree ))
@@ -376,6 +377,7 @@ func (m *IndexManager) ApplyChanges(ctx context.Context, changes map[string]fsno
376377 if op & (fsnotify .Remove | fsnotify .Rename ) != 0 {
377378 if removeNodeByRelPath (m .index .Tree , relPath ) {
378379 result .Changed = true
380+ result .ChangedPaths [relPath ] |= op & (fsnotify .Remove | fsnotify .Rename )
379381 }
380382 }
381383
@@ -394,12 +396,14 @@ func (m *IndexManager) ApplyChanges(ctx context.Context, changes map[string]fsno
394396 if matcher .shouldIgnore (relPath , baseName , isDir ) {
395397 if removeNodeByRelPath (m .index .Tree , relPath ) {
396398 result .Changed = true
399+ result .ChangedPaths [relPath ] |= op & (fsnotify .Create | fsnotify .Write | fsnotify .Chmod )
397400 }
398401 continue
399402 }
400403
401404 if upsertNodeByRelPath (m .index .Tree , m .rootPath , relPath , isDir , mtime , m .cache , m .synonymsMax ) {
402405 result .Changed = true
406+ result .ChangedPaths [relPath ] |= op & (fsnotify .Create | fsnotify .Write | fsnotify .Chmod )
403407 }
404408 }
405409
0 commit comments