@@ -275,7 +275,8 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx,
275
275
Optional<StringRef> Group,
276
276
SwiftInterfaceGenContext::Implementation &Impl,
277
277
std::string &ErrMsg,
278
- bool SynthesizedExtensions) {
278
+ bool SynthesizedExtensions,
279
+ Optional<StringRef> InterestedUSR) {
279
280
Module *&Mod = Impl.Mod ;
280
281
SourceTextInfo &Info = Impl.Info ;
281
282
@@ -316,6 +317,9 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx,
316
317
SmallString<128 > Text;
317
318
llvm::raw_svector_ostream OS (Text);
318
319
AnnotatingPrinter Printer (Info, OS);
320
+ if (!Group && InterestedUSR) {
321
+ Group = findGroupNameForUSR (Mod, InterestedUSR.getValue ());
322
+ }
319
323
printSubmoduleInterface (Mod, SplitModuleName,
320
324
Group.hasValue () ? llvm::makeArrayRef (Group.getValue ()) : ArrayRef<StringRef>(),
321
325
TraversalOptions,
@@ -376,7 +380,8 @@ SwiftInterfaceGenContext::create(StringRef DocumentName,
376
380
Optional<StringRef> Group,
377
381
CompilerInvocation Invocation,
378
382
std::string &ErrMsg,
379
- bool SynthesizedExtensions) {
383
+ bool SynthesizedExtensions,
384
+ Optional<StringRef> InterestedUSR) {
380
385
SwiftInterfaceGenContextRef IFaceGenCtx{ new SwiftInterfaceGenContext () };
381
386
IFaceGenCtx->Impl .DocumentName = DocumentName;
382
387
IFaceGenCtx->Impl .IsModule = IsModule;
@@ -405,7 +410,7 @@ SwiftInterfaceGenContext::create(StringRef DocumentName,
405
410
406
411
if (IsModule) {
407
412
if (getModuleInterfaceInfo (Ctx, ModuleOrHeaderName, Group, IFaceGenCtx->Impl ,
408
- ErrMsg, SynthesizedExtensions))
413
+ ErrMsg, SynthesizedExtensions, InterestedUSR ))
409
414
return nullptr ;
410
415
} else {
411
416
auto &FEOpts = Invocation.getFrontendOptions ();
@@ -585,7 +590,8 @@ void SwiftLangSupport::editorOpenInterface(EditorConsumer &Consumer,
585
590
StringRef ModuleName,
586
591
Optional<StringRef> Group,
587
592
ArrayRef<const char *> Args,
588
- bool SynthesizedExtensions) {
593
+ bool SynthesizedExtensions,
594
+ Optional<StringRef> InterestedUSR) {
589
595
CompilerInstance CI;
590
596
// Display diagnostics to stderr.
591
597
PrintingDiagnosticConsumer PrintDiags;
@@ -619,7 +625,8 @@ void SwiftLangSupport::editorOpenInterface(EditorConsumer &Consumer,
619
625
Group,
620
626
Invocation,
621
627
ErrMsg,
622
- SynthesizedExtensions);
628
+ SynthesizedExtensions,
629
+ InterestedUSR);
623
630
if (!IFaceGenRef) {
624
631
Consumer.handleRequestError (ErrMsg.c_str ());
625
632
return ;
@@ -725,7 +732,8 @@ void SwiftLangSupport::editorOpenHeaderInterface(EditorConsumer &Consumer,
725
732
None,
726
733
Invocation,
727
734
Error,
728
- SynthesizedExtensions);
735
+ SynthesizedExtensions,
736
+ None);
729
737
if (!IFaceGenRef) {
730
738
Consumer.handleRequestError (Error.c_str ());
731
739
return ;
0 commit comments