@@ -118,6 +118,8 @@ finalize(doc::Reference& ref)
118
118
ref.id = res->id ;
119
119
}
120
120
if (res == nullptr &&
121
+ corpus_.config ->warnings &&
122
+ corpus_.config ->warnBrokenRef &&
121
123
// Only warn once per reference
122
124
!warned_.contains ({ref.string , current_context_->Name }) &&
123
125
// Ignore std:: references
@@ -128,7 +130,7 @@ finalize(doc::Reference& ref)
128
130
MRDOCS_ASSERT (current_context_);
129
131
if (auto primaryLoc = getPrimaryLocation (*current_context_))
130
132
{
131
- warn (
133
+ this -> warn (
132
134
" {}:{}\n {}: Failed to resolve reference to '{}'" ,
133
135
primaryLoc->FullPath ,
134
136
primaryLoc->LineNumber ,
@@ -281,10 +283,13 @@ copyBriefAndDetails(Javadoc& javadoc)
281
283
Info const * res = corpus_.lookup (current_context_->id , copied->string );
282
284
if (!res)
283
285
{
284
- MRDOCS_ASSERT (current_context_);
285
- if (auto primaryLoc = getPrimaryLocation (*current_context_))
286
+ if (corpus_.config ->warnings &&
287
+ corpus_.config ->warnBrokenRef &&
288
+ !warned_.contains ({copied->string , current_context_->Name }))
286
289
{
287
- warn (
290
+ MRDOCS_ASSERT (current_context_);
291
+ auto primaryLoc = getPrimaryLocation (*current_context_);
292
+ this ->warn (
288
293
" {}:{}\n "
289
294
" {}: Failed to copy documentation from '{}'\n "
290
295
" Note: Symbol '{}' not found." ,
@@ -304,21 +309,26 @@ copyBriefAndDetails(Javadoc& javadoc)
304
309
}
305
310
if (!res->javadoc )
306
311
{
307
- auto ctxPrimaryLoc = getPrimaryLocation (*current_context_);
308
- auto resPrimaryLoc = getPrimaryLocation (*res);
309
- warn (
310
- " {}:{}\n "
311
- " {}: Failed to copy documentation from '{}'.\n "
312
- " No documentation available.\n "
313
- " {}:{}\n "
314
- " Note: No documentation available for '{}'." ,
315
- ctxPrimaryLoc->FullPath ,
316
- ctxPrimaryLoc->LineNumber ,
317
- corpus_.Corpus ::qualifiedName (*current_context_),
318
- copied->string ,
319
- resPrimaryLoc->FullPath ,
320
- resPrimaryLoc->LineNumber ,
321
- corpus_.Corpus ::qualifiedName (*res));
312
+ if (corpus_.config ->warnings &&
313
+ corpus_.config ->warnBrokenRef &&
314
+ !warned_.contains ({copied->string , current_context_->Name }))
315
+ {
316
+ auto ctxPrimaryLoc = getPrimaryLocation (*current_context_);
317
+ auto resPrimaryLoc = getPrimaryLocation (*res);
318
+ this ->warn (
319
+ " {}:{}\n "
320
+ " {}: Failed to copy documentation from '{}'.\n "
321
+ " No documentation available.\n "
322
+ " {}:{}\n "
323
+ " Note: No documentation available for '{}'." ,
324
+ ctxPrimaryLoc->FullPath ,
325
+ ctxPrimaryLoc->LineNumber ,
326
+ corpus_.Corpus ::qualifiedName (*current_context_),
327
+ copied->string ,
328
+ resPrimaryLoc->FullPath ,
329
+ resPrimaryLoc->LineNumber ,
330
+ corpus_.Corpus ::qualifiedName (*res));
331
+ }
322
332
continue ;
323
333
}
324
334
@@ -531,7 +541,7 @@ warnUndocumented() const
531
541
{
532
542
MRDOCS_CHECK_OR (!I->javadoc || I->Extraction == ExtractionMode::Regular);
533
543
}
534
- warn (" {}: Symbol is undocumented" , name);
544
+ this -> warn (" {}: Symbol is undocumented" , name);
535
545
}
536
546
corpus_.undocumented_ .clear ();
537
547
}
@@ -590,7 +600,7 @@ warnParamErrors(FunctionInfo const& I) const
590
600
std::string_view duplicateParamName: uniqueDuplicateParamNames)
591
601
{
592
602
auto primaryLoc = getPrimaryLocation (I);
593
- warn (
603
+ this -> warn (
594
604
" {}:{}\n "
595
605
" {}: Duplicate parameter documentation for '{}'" ,
596
606
primaryLoc->FullPath ,
@@ -609,7 +619,7 @@ warnParamErrors(FunctionInfo const& I) const
609
619
if (std::ranges::find (paramNames, javadocParamName) == paramNames.end ())
610
620
{
611
621
auto primaryLoc = getPrimaryLocation (I);
612
- warn (
622
+ this -> warn (
613
623
" {}:{}\n "
614
624
" {}: Documented parameter '{}' does not exist" ,
615
625
primaryLoc->FullPath ,
@@ -649,7 +659,7 @@ warnNoParamDocs(FunctionInfo const& I) const
649
659
if (std::ranges::find (javadocParamNames, paramName) == javadocParamNames.end ())
650
660
{
651
661
auto primaryLoc = getPrimaryLocation (I);
652
- warn (
662
+ this -> warn (
653
663
" {}:{}\n "
654
664
" {}: Missing documentation for parameter '{}'" ,
655
665
primaryLoc->FullPath ,
@@ -674,7 +684,7 @@ warnNoParamDocs(FunctionInfo const& I) const
674
684
if (!isVoid (*I.ReturnType ))
675
685
{
676
686
auto primaryLoc = getPrimaryLocation (I);
677
- warn (
687
+ this -> warn (
678
688
" {}:{}\n "
679
689
" {}: Missing documentation for return type" ,
680
690
primaryLoc->FullPath ,
@@ -695,7 +705,7 @@ warnUndocEnumValues() const
695
705
MRDOCS_CHECK_OR_CONTINUE (I->Extraction == ExtractionMode::Regular);
696
706
MRDOCS_CHECK_OR_CONTINUE (!I->javadoc );
697
707
auto primaryLoc = getPrimaryLocation (*I);
698
- warn (
708
+ this -> warn (
699
709
" {}:{}\n "
700
710
" {}: Missing documentation for enum value" ,
701
711
primaryLoc->FullPath ,
0 commit comments