@@ -94,7 +94,7 @@ static XDocument loadDoc(string path)
94
94
;
95
95
96
96
var docMap = generateDocMap ( types , docMembers , trimLevel , logger ) ;
97
- var docCref = docMembers . Elements ( DocElementNames . Member ) . Where ( m => ! m . HasAttribute ( DocAttributeNames . _trimmed ) ) . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( c => ! string . IsNullOrWhiteSpace ( c ) ) ;
97
+ var docCref = docMembers . Elements ( DocElementNames . Member ) . Where ( m => ! m . HasAttribute ( DocAttributeNames . _trimmed ) ) . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( isValidCref ) ;
98
98
var asmTypes = types . Select ( t => t . GetDocID ( ) ) . ToHashSet ( ) ;
99
99
100
100
var refCref = docMap . Values . SelectMany ( v => v . Select ( l => l . Cref ) ) . Concat ( docCref ) . Where ( c => ! asmTypes . Contains ( getTypeIDFromDocID ( c ) ) ) . ToHashSet ( ) ;
@@ -171,7 +171,7 @@ private static IDictionary<string, IEnumerable<DocMatch>> generateDocMap(IList<T
171
171
{
172
172
logger . Write ( ILogger . Severity . Diag , "Processing DocID: " + typeID ) ;
173
173
174
- var crefs = typeDocs . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( c => ! string . IsNullOrWhiteSpace ( c ) ) . ToList ( ) ;
174
+ var crefs = typeDocs . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( isValidCref ) . ToList ( ) ;
175
175
var dml = new List < DocMatch > ( ) ;
176
176
docMap . Add ( typeID , dml ) ;
177
177
@@ -267,7 +267,7 @@ private static IDictionary<string, IEnumerable<DocMatch>> generateDocMap(IList<T
267
267
logger . Write ( ILogger . Severity . Diag , "Processing DocID: " + memID ) ;
268
268
269
269
var bases = ( om is not null ? ( new [ ] { om } ) : [ ] ) . Concat ( m . GetBaseCandidates ( ) ) . ToList ( ) ;
270
- var crefs = methDocs . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( c => ! string . IsNullOrWhiteSpace ( c ) ) . ToHashSet ( ) ;
270
+ var crefs = methDocs . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( isValidCref ) . ToHashSet ( ) ;
271
271
var dml = new List < DocMatch > ( ) ;
272
272
273
273
foreach ( var ( bm , cref ) in bases . SelectMany ( bm => bm . GetDocID ( ) . Select ( d => ( bm , d ) ) ) )
@@ -555,6 +555,8 @@ static XDocument getRefDocs(IReadOnlyCollection<string> refAssemblies, IReadOnly
555
555
}
556
556
}
557
557
558
+ private static bool isValidCref ( string cref ) => cref is { Length : > 2 } && cref [ 0 ] is not '!' && ( cref [ 0 ] is 'T' || cref . IndexOf ( '.' , 2 ) > 0 ) ;
559
+
558
560
private static string getTypeIDFromDocID ( string docID )
559
561
{
560
562
if ( docID [ 0 ] == 'T' )
0 commit comments