File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed
packages/graphql-language-service-server/src Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -971,10 +971,16 @@ export class MessageProcessor {
971971 } ) ,
972972 ) ;
973973
974- return this . _languageService . getDocumentSymbols (
975- cachedDocument . contents [ 0 ] . query ,
976- textDocument . uri ,
974+ const results = await Promise . all (
975+ cachedDocument . contents . map ( content =>
976+ this . _languageService . getDocumentSymbols (
977+ content . query ,
978+ textDocument . uri ,
979+ content . range ,
980+ ) ,
981+ ) ,
977982 ) ;
983+ return results . flat ( ) ;
978984 }
979985
980986 // async handleReferencesRequest(params: ReferenceParams): Promise<Location[]> {
@@ -1021,11 +1027,16 @@ export class MessageProcessor {
10211027 ) {
10221028 return [ ] ;
10231029 }
1024- const docSymbols = await this . _languageService . getDocumentSymbols (
1025- cachedDocument . contents [ 0 ] . query ,
1026- uri ,
1030+ const docSymbols = await Promise . all (
1031+ cachedDocument . contents . map ( content =>
1032+ this . _languageService . getDocumentSymbols (
1033+ content . query ,
1034+ uri ,
1035+ content . range ,
1036+ ) ,
1037+ ) ,
10271038 ) ;
1028- symbols . push ( ...docSymbols ) ;
1039+ symbols . push ( ...docSymbols . flat ( ) ) ;
10291040 } ) ,
10301041 ) ;
10311042 return symbols . filter ( symbol => symbol ?. name ?. includes ( params . query ) ) ;
You can’t perform that action at this time.
0 commit comments