@@ -33,11 +33,22 @@ import { CppSettings } from './settings';
33
33
import { LanguageStatusUI , getUI } from './ui' ;
34
34
import { makeLspRange , rangeEquals , showInstallCompilerWalkthrough } from './utils' ;
35
35
36
+ interface CopilotTrait {
37
+ name : string ;
38
+ value : string ;
39
+ includeInPrompt ?: boolean ;
40
+ promptTextOverride ?: string ;
41
+ }
42
+
36
43
interface CopilotApi {
37
44
registerRelatedFilesProvider (
38
45
providerId : { extensionId : string ; languageId : string } ,
39
- callback : ( uri : vscode . Uri , token : vscode . CancellationToken ) => Promise < { entries : vscode . Uri [ ] ; traits ?: { name : string ; value : string } [ ] } >
40
- ) : vscode . Disposable ;
46
+ callback : (
47
+ uri : vscode . Uri ,
48
+ context : { flags : Record < string , unknown > } ,
49
+ cancellationToken : vscode . CancellationToken
50
+ ) => Promise < { entries : vscode . Uri [ ] ; traits ?: CopilotTrait [ ] } >
51
+ ) : Disposable ;
41
52
}
42
53
43
54
nls . config ( { messageFormat : nls . MessageFormat . bundle , bundleFormat : nls . BundleFormat . standalone } ) ( ) ;
@@ -270,7 +281,7 @@ export async function activate(): Promise<void> {
270
281
for ( const languageId of [ 'c' , 'cpp' , 'cuda-cpp' ] ) {
271
282
api . registerRelatedFilesProvider (
272
283
{ extensionId : util . extensionContext . extension . id , languageId } ,
273
- async ( _uri : vscode . Uri , token : vscode . CancellationToken ) =>
284
+ async ( _uri : vscode . Uri , _context : { flags : Record < string , unknown > } , token : vscode . CancellationToken ) =>
274
285
( { entries : ( await clients . ActiveClient . getIncludes ( 1 , token ) ) ?. includedFiles . map ( file => vscode . Uri . file ( file ) ) ?? [ ] } )
275
286
) ;
276
287
}
0 commit comments