@@ -43,8 +43,8 @@ export class Client {
4343 private clientOptions : object | undefined ;
4444
4545 grpcClient : ServerReflectionClient | undefined ;
46+ compatibleReflectionVersion : string | undefined ;
4647 private reflectionResponseCache : ServerReflectionResponse | undefined ;
47- private compatibleProtocol : string | undefined ;
4848 private CompatibleServerReflectionRequest :
4949 | ( new (
5050 ...args : ConstructorParameters < typeof ServerReflectionRequest >
@@ -142,7 +142,7 @@ export class Client {
142142 priority : protocolConfig . priority ,
143143 effect : ( ) => {
144144 this . grpcClient = grpcClientForProtocol ;
145- this . compatibleProtocol = version ;
145+ this . compatibleReflectionVersion = version ;
146146 this . CompatibleServerReflectionRequest =
147147 protocolClient . ServerReflectionRequest ;
148148 this . reflectionResponseCache = reflectionResponse ;
@@ -186,14 +186,14 @@ export class Client {
186186 successfulReflectionByPriority . effect ! ( ) ;
187187 }
188188
189- private async initializeReflectionClient ( ) {
190- if ( this . grpcClient || this . compatibleProtocol ) return ;
189+ async initialize ( ) {
190+ if ( this . grpcClient || this . compatibleReflectionVersion ) return ;
191191
192192 await this . evaluateSupportedServerReflectionProtocol ( ) ;
193193 }
194194
195195 async listServices ( ) : Promise < string [ ] > {
196- await this . initializeReflectionClient ( ) ;
196+ await this . initialize ( ) ;
197197
198198 return new Promise ( ( resolve , reject ) => {
199199 function dataCallback ( response : ServerReflectionResponse ) {
@@ -287,7 +287,7 @@ export class Client {
287287 private async getFileContainingSymbol (
288288 symbol : string
289289 ) : Promise < Array < IFileDescriptorProto > | undefined > {
290- await this . initializeReflectionClient ( ) ;
290+ await this . initialize ( ) ;
291291
292292 const fileDescriptorCache = this . fileDescriptorCache ;
293293 return new Promise ( ( resolve , reject ) => {
@@ -332,7 +332,7 @@ export class Client {
332332 private async getFilesByFilenames (
333333 symbols : string [ ]
334334 ) : Promise < Array < IFileDescriptorProto > | undefined > {
335- await this . initializeReflectionClient ( ) ;
335+ await this . initialize ( ) ;
336336
337337 const result : Array < IFileDescriptorProto > = [ ] ;
338338 const fileDescriptorCache = this . fileDescriptorCache ;
0 commit comments