@@ -585,6 +585,9 @@ export interface CopilotCompletionContextParams {
585
585
uri : string ;
586
586
caretOffset : number ;
587
587
featureFlag : CopilotCompletionContextFeatures ;
588
+ maxSnippetCount : number ;
589
+ maxSnippetLength : number ;
590
+ doAggregateSnippets : boolean ;
588
591
}
589
592
590
593
// Requests
@@ -843,7 +846,7 @@ export interface Client {
843
846
getIncludes ( uri : vscode . Uri , maxDepth : number ) : Promise < GetIncludesResult > ;
844
847
getChatContext ( uri : vscode . Uri , token : vscode . CancellationToken ) : Promise < ChatContextResult > ;
845
848
filesEncodingChanged ( filesEncodingChanged : FilesEncodingChanged ) : void ;
846
- getCompletionContext ( fileName : vscode . Uri , caretOffset : number , featureFlag : CopilotCompletionContextFeatures , token : vscode . CancellationToken ) : Promise < CopilotCompletionContextResult > ;
849
+ getCompletionContext ( fileName : vscode . Uri , caretOffset : number , featureFlag : CopilotCompletionContextFeatures , maxSnippetCount : number , maxSnippetLength : number , doAggregateSnippets : boolean , token : vscode . CancellationToken ) : Promise < CopilotCompletionContextResult > ;
847
850
}
848
851
849
852
export function createClient ( workspaceFolder ?: vscode . WorkspaceFolder ) : Client {
@@ -2352,11 +2355,12 @@ export class DefaultClient implements Client {
2352
2355
}
2353
2356
2354
2357
public async getCompletionContext ( file : vscode . Uri , caretOffset : number , featureFlag : CopilotCompletionContextFeatures ,
2358
+ maxSnippetCount : number , maxSnippetLength : number , doAggregateSnippets : boolean ,
2355
2359
token : vscode . CancellationToken ) : Promise < CopilotCompletionContextResult > {
2356
2360
await withCancellation ( this . ready , token ) ;
2357
2361
return DefaultClient . withLspCancellationHandling (
2358
2362
( ) => this . languageClient . sendRequest ( CopilotCompletionContextRequest ,
2359
- { uri : file . toString ( ) , caretOffset, featureFlag } , token ) , token ) ;
2363
+ { uri : file . toString ( ) , caretOffset, featureFlag, maxSnippetCount , maxSnippetLength , doAggregateSnippets } , token ) , token ) ;
2360
2364
}
2361
2365
2362
2366
/**
@@ -4277,5 +4281,5 @@ class NullClient implements Client {
4277
4281
getIncludes ( uri : vscode . Uri , maxDepth : number ) : Promise < GetIncludesResult > { return Promise . resolve ( { } as GetIncludesResult ) ; }
4278
4282
getChatContext ( uri : vscode . Uri , token : vscode . CancellationToken ) : Promise < ChatContextResult > { return Promise . resolve ( { } as ChatContextResult ) ; }
4279
4283
filesEncodingChanged ( filesEncodingChanged : FilesEncodingChanged ) : void { }
4280
- getCompletionContext ( file : vscode . Uri , caretOffset : number , featureFlag : CopilotCompletionContextFeatures , token : vscode . CancellationToken ) : Promise < CopilotCompletionContextResult > { return Promise . resolve ( { } as CopilotCompletionContextResult ) ; }
4284
+ getCompletionContext ( file : vscode . Uri , caretOffset : number , featureFlag : CopilotCompletionContextFeatures , maxSnippetCount : number , maxSnippetLength : number , doAggregateSnippets : boolean , token : vscode . CancellationToken ) : Promise < CopilotCompletionContextResult > { return Promise . resolve ( { } as CopilotCompletionContextResult ) ; }
4281
4285
}
0 commit comments