@@ -29,6 +29,7 @@ import { LifecyclePhase } from '../../../../services/lifecycle/common/lifecycle.
29
29
import { QueryBuilder } from '../../../../services/search/common/queryBuilder.js' ;
30
30
import { ISearchService } from '../../../../services/search/common/search.js' ;
31
31
import { ChatAgentLocation , IChatAgentData , IChatAgentNameService , IChatAgentService , getFullyQualifiedId } from '../../common/chatAgents.js' ;
32
+ import { IChatEditingService } from '../../common/chatEditingService.js' ;
32
33
import { ChatRequestAgentPart , ChatRequestAgentSubcommandPart , ChatRequestTextPart , ChatRequestToolPart , ChatRequestVariablePart , chatAgentLeader , chatSubcommandLeader , chatVariableLeader } from '../../common/chatParserTypes.js' ;
33
34
import { IChatSlashCommandService } from '../../common/chatSlashCommands.js' ;
34
35
import { IChatVariablesService , IDynamicVariable } from '../../common/chatVariables.js' ;
@@ -437,6 +438,7 @@ class BuiltinDynamicCompletions extends Disposable {
437
438
@ILabelService private readonly labelService : ILabelService ,
438
439
@ILanguageFeaturesService private readonly languageFeaturesService : ILanguageFeaturesService ,
439
440
@IChatWidgetService private readonly chatWidgetService : IChatWidgetService ,
441
+ @IChatEditingService private readonly _chatEditingService : IChatEditingService ,
440
442
@IInstantiationService private readonly instantiationService : IInstantiationService ,
441
443
) {
442
444
super ( ) ;
@@ -574,6 +576,16 @@ class BuiltinDynamicCompletions extends Disposable {
574
576
}
575
577
}
576
578
579
+ // RELATED FILES
580
+ if ( widget . location === ChatAgentLocation . EditingSession && widget . viewModel && this . _chatEditingService . currentEditingSessionObs . get ( ) ?. chatSessionId === widget . viewModel ?. sessionId ) {
581
+ for ( const relatedFile of ( await this . _chatEditingService . getRelatedFiles ( widget . viewModel . sessionId , widget . getInput ( ) , token ) ?? [ ] ) ) {
582
+ if ( seen . has ( relatedFile ) ) {
583
+ continue ;
584
+ }
585
+ result . suggestions . push ( makeFileCompletionItem ( relatedFile ) ) ;
586
+ }
587
+ }
588
+
577
589
// mark results as incomplete because further typing might yield
578
590
// in more search results
579
591
result . incomplete = true ;
0 commit comments