@@ -46,6 +46,7 @@ import {
46
46
47
47
import { isLocalAssistantFile } from "./config/loadLocalAssistants" ;
48
48
import { shouldIgnore } from "./indexing/shouldIgnore" ;
49
+ import { walkDirCache } from "./indexing/walkDir" ;
49
50
import type { FromCoreProtocol , ToCoreProtocol } from "./protocol" ;
50
51
import type { IMessenger , Message } from "./protocol/messenger" ;
51
52
@@ -834,6 +835,7 @@ export class Core {
834
835
if ( ! config || config . disableIndexing ) {
835
836
return ; // TODO silent in case of commands?
836
837
}
838
+ walkDirCache . invalidate ( ) ;
837
839
if ( data ?. shouldClearIndexes ) {
838
840
const codebaseIndexer = await this . codebaseIndexerPromise ;
839
841
await codebaseIndexer . clearIndexes ( ) ;
@@ -861,9 +863,8 @@ export class Core {
861
863
// TODO - remove remaining logic for these from IDEs where possible
862
864
on ( "files/changed" , async ( { data } ) => {
863
865
if ( data ?. uris ?. length ) {
866
+ walkDirCache . invalidate ( ) ; // safe approach for now - TODO - only invalidate on relevant changes
864
867
for ( const uri of data . uris ) {
865
- // Listen for file changes in the workspace
866
- // URI TODO is this equality statement valid?
867
868
const currentProfileUri =
868
869
this . configHandler . currentProfile ?. profileDescription . uri ?? "" ;
869
870
@@ -934,6 +935,7 @@ export class Core {
934
935
935
936
on ( "files/created" , async ( { data } ) => {
936
937
if ( data ?. uris ?. length ) {
938
+ walkDirCache . invalidate ( ) ;
937
939
void refreshIfNotIgnored ( data . uris ) ;
938
940
939
941
// If it's a local assistant being created, we want to reload all assistants so it shows up in the list
@@ -947,6 +949,7 @@ export class Core {
947
949
948
950
on ( "files/deleted" , async ( { data } ) => {
949
951
if ( data ?. uris ?. length ) {
952
+ walkDirCache . invalidate ( ) ;
950
953
void refreshIfNotIgnored ( data . uris ) ;
951
954
}
952
955
} ) ;
0 commit comments