@@ -189,8 +189,8 @@ private async Task<string> ProcessAfterAssemblyAsync(IAssemblySymbol afterAssemb
189
189
CSharpAssemblyDocumentGenerator docGenerator = new ( _log , options ) ;
190
190
191
191
Document document = await docGenerator . GetDocumentForAssemblyAsync ( assemblySymbol ) . ConfigureAwait ( false ) ; // Super hot and resource-intensive path
192
- SyntaxNode root = await document . GetSyntaxRootAsync ( ) . ConfigureAwait ( false ) ?? throw new InvalidOperationException ( string . Format ( Resources . RootNodeNotFound , assemblySymbol . Name ) ) ;
193
- SemanticModel model = await document . GetSemanticModelAsync ( ) . ConfigureAwait ( false ) ?? throw new InvalidOperationException ( string . Format ( Resources . SemanticModelNotFound , assemblySymbol . Name ) ) ;
192
+ SyntaxNode root = await document . GetSyntaxRootAsync ( ) . ConfigureAwait ( false ) ?? throw new InvalidOperationException ( $ "Root node could not be found for document of assembly ' { assemblySymbol . Name } '." ) ;
193
+ SemanticModel model = await document . GetSemanticModelAsync ( ) . ConfigureAwait ( false ) ?? throw new InvalidOperationException ( $ "Semantic model could not be found for document of assembly ' { assemblySymbol . Name } '." ) ;
194
194
195
195
return ( root , model ) ;
196
196
}
@@ -353,7 +353,7 @@ private ConcurrentDictionary<string, MemberDeclarationSyntax> CollectChildrenNod
353
353
}
354
354
else
355
355
{
356
- throw new InvalidOperationException ( string . Format ( Resources . UnexpectedNodeType , parentNode . Kind ( ) ) ) ;
356
+ throw new InvalidOperationException ( $ "Unexpected node type ' { parentNode . Kind ( ) } '" ) ;
357
357
}
358
358
359
359
return dictionary ;
@@ -410,7 +410,7 @@ private ConcurrentDictionary<string, MemberDeclarationSyntax> CollectChildrenNod
410
410
}
411
411
break ;
412
412
default :
413
- throw new NotSupportedException ( string . Format ( Resources . UnexpectedChangeType , changeType ) ) ;
413
+ throw new NotSupportedException ( $ "Unexpected change type ' { changeType } '." ) ;
414
414
}
415
415
416
416
return sb . Length > 0 ? sb . ToString ( ) : null ;
@@ -520,7 +520,7 @@ private Dictionary<string, AttributeSyntax> CollectAttributeNodes(MemberDeclarat
520
520
521
521
if ( ! dictionary . TryAdd ( GetAttributeDocId ( constructor , attributeNode , model ) , realAttributeNode ) )
522
522
{
523
- _log . LogWarning ( string . Format ( Resources . AttributeAlreadyExists , realAttributeNode . ToFullString ( ) , GetDocId ( memberNode , model ) ) ) ;
523
+ _log . LogWarning ( $ "Attribute already exists in dictionary. Attribute: ' { realAttributeNode . ToFullString ( ) } ', Member: ' { GetDocId ( memberNode , model ) } '" ) ;
524
524
}
525
525
}
526
526
}
@@ -568,7 +568,7 @@ private string GetCodeWrappedByParent(string diffedChildrenCode, SyntaxNode pare
568
568
ChangeType . Inserted => GenerateAddedDiff ( codeToDiff ) ,
569
569
ChangeType . Deleted => GenerateDeletedDiff ( codeToDiff ) ,
570
570
ChangeType . Unchanged => codeToDiff ,
571
- _ => throw new InvalidOperationException ( string . Format ( Resources . UnexpectedChangeType , parentChangeType ) ) ,
571
+ _ => throw new InvalidOperationException ( $ "Unexpected change type ' { parentChangeType } '." ) ,
572
572
} ;
573
573
}
574
574
}
@@ -627,7 +627,7 @@ private string GetClosingBraceCode(SyntaxNode childlessNode, SyntaxTriviaList le
627
627
RecordDeclarationSyntax recordDecl => recordDecl . CloseBraceToken . IsMissing ? _missingCloseBrace : recordDecl . CloseBraceToken ,
628
628
BaseTypeDeclarationSyntax typeDecl => typeDecl . CloseBraceToken ,
629
629
NamespaceDeclarationSyntax nsDecl => nsDecl . CloseBraceToken ,
630
- _ => throw new InvalidOperationException ( string . Format ( Resources . UnexpectedNodeType , childlessNode . Kind ( ) ) )
630
+ _ => throw new InvalidOperationException ( $ "Unexpected node type ' { childlessNode . Kind ( ) } '" )
631
631
} ;
632
632
633
633
return closeBrace . WithTrailingTrivia ( _endOfLineTrivia )
@@ -691,7 +691,7 @@ private string GetDocId(SyntaxNode node, SemanticModel model)
691
691
EventFieldDeclarationSyntax eventFieldDeclaration => model . GetDeclaredSymbol ( eventFieldDeclaration . Declaration . Variables . First ( ) ) ,
692
692
PropertyDeclarationSyntax propertyDeclaration => model . GetDeclaredSymbol ( propertyDeclaration ) ,
693
693
_ => model . GetDeclaredSymbol ( node )
694
- } ;
694
+ } ;
695
695
696
696
if ( symbol ? . GetDocumentationCommentId ( ) is string docId )
697
697
{
@@ -704,7 +704,7 @@ private string GetDocId(SyntaxNode node, SemanticModel model)
704
704
return docId ;
705
705
}
706
706
707
- throw new NullReferenceException ( string . Format ( Resources . CouldNotGetDocIdForNode , node ) ) ;
707
+ throw new NullReferenceException ( $ "Could not get the DocID for node: { node } " ) ;
708
708
}
709
709
710
710
private static string ? GenerateAddedDiff ( SyntaxNode afterNode ) => GenerateAddedDiff ( afterNode . ToFullString ( ) ) ;
0 commit comments