@@ -536,6 +536,16 @@ interface DidChangeActiveEditorParams {
536536 selection ?: Range ;
537537}
538538
539+ interface GetIncludesParams
540+ {
541+ maxDepth : number ;
542+ }
543+
544+ interface GetIncludesResult
545+ {
546+ includedFiles : string [ ] ;
547+ }
548+
539549// Requests
540550const InitializationRequest : RequestType < CppInitializationParams , string , void > = new RequestType < CppInitializationParams , string , void > ( 'cpptools/initialize' ) ;
541551const QueryCompilerDefaultsRequest : RequestType < QueryDefaultCompilerParams , configs . CompilerDefaults , void > = new RequestType < QueryDefaultCompilerParams , configs . CompilerDefaults , void > ( 'cpptools/queryCompilerDefaults' ) ;
@@ -553,6 +563,7 @@ const ExtractToFunctionRequest: RequestType<ExtractToFunctionParams, WorkspaceEd
553563const GoToDirectiveInGroupRequest : RequestType < GoToDirectiveInGroupParams , Position | undefined , void > = new RequestType < GoToDirectiveInGroupParams , Position | undefined , void > ( 'cpptools/goToDirectiveInGroup' ) ;
554564const GenerateDoxygenCommentRequest : RequestType < GenerateDoxygenCommentParams , GenerateDoxygenCommentResult | undefined , void > = new RequestType < GenerateDoxygenCommentParams , GenerateDoxygenCommentResult , void > ( 'cpptools/generateDoxygenComment' ) ;
555565const ChangeCppPropertiesRequest : RequestType < CppPropertiesParams , void , void > = new RequestType < CppPropertiesParams , void , void > ( 'cpptools/didChangeCppProperties' ) ;
566+ const IncludesRequest : RequestType < GetIncludesParams , GetIncludesResult , void > = new RequestType < GetIncludesParams , GetIncludesResult , void > ( 'cpptools/getIncludes' ) ;
556567
557568// Notifications to the server
558569const DidOpenNotification : NotificationType < DidOpenTextDocumentParams > = new NotificationType < DidOpenTextDocumentParams > ( 'textDocument/didOpen' ) ;
@@ -781,6 +792,7 @@ export interface Client {
781792 getShowConfigureIntelliSenseButton ( ) : boolean ;
782793 setShowConfigureIntelliSenseButton ( show : boolean ) : void ;
783794 addTrustedCompiler ( path : string ) : Promise < void > ;
795+ getIncludes ( maxDepth : number ) : Promise < GetIncludesResult > ;
784796}
785797
786798export function createClient ( workspaceFolder ?: vscode . WorkspaceFolder ) : Client {
@@ -2190,6 +2202,12 @@ export class DefaultClient implements Client {
21902202 await this . languageClient . sendNotification ( DidOpenNotification , params ) ;
21912203 }
21922204
2205+ public async getIncludes ( maxDepth : number ) : Promise < GetIncludesResult > {
2206+ const params : GetIncludesParams = { maxDepth : maxDepth } ;
2207+ await this . ready ;
2208+ return this . languageClient . sendRequest ( IncludesRequest , params ) ;
2209+ }
2210+
21932211 /**
21942212 * a Promise that can be awaited to know when it's ok to proceed.
21952213 *
@@ -4012,4 +4030,5 @@ class NullClient implements Client {
40124030 getShowConfigureIntelliSenseButton ( ) : boolean { return false ; }
40134031 setShowConfigureIntelliSenseButton ( show : boolean ) : void { }
40144032 addTrustedCompiler ( path : string ) : Promise < void > { return Promise . resolve ( ) ; }
4033+ getIncludes ( ) : Promise < GetIncludesResult > { return Promise . resolve ( { } as GetIncludesResult ) ; }
40154034}
0 commit comments