Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply suggestions from code review
Co-authored-by: Stephen Toub <[email protected]>
  • Loading branch information
jkoritzinsky and stephentoub authored Sep 16, 2022
commit a4856ed1a8ed8e83f3e5eacfe2b544c1a5a34c4d
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static Location FindTypeExpressionOrNullLocation(this AttributeArgumentSy
if (targetSymbol is IMethodSymbol method)
{
// Sometimes an attribute is put on a symbol that is nested within the containing symbol.
// For example, the ContainingSymbol for an AttributeSyntax on a local function have a ContainingSymbol of the method.
// For example, the ContainingSymbol for an AttributeSyntax on a local function has a ContainingSymbol of the method.
// Since this method is internal and the callers don't care about attributes on local functions,
// we just allow this method to return null in those cases.
return method.GetReturnTypeAttributes().FirstOrDefault(attributeSyntaxLocationMatches);
Expand All @@ -53,8 +53,8 @@ public static Location FindTypeExpressionOrNullLocation(this AttributeArgumentSy
}
}
// Sometimes an attribute is put on a symbol that is nested within the containing symbol.
// For example, the ContainingSymbol for an AttributeSyntax on a parameter have a ContainingSymbol of the method
// and an AttributeSyntax on a local function have a ContainingSymbol of the containing method.
// For example, the ContainingSymbol for an AttributeSyntax on a parameter has a ContainingSymbol of the method
// and an AttributeSyntax on a local function has a ContainingSymbol of the containing method.
// Since this method is internal and the callers don't care about attributes on parameters, we just allow
// this method to return null in those cases.
return targetSymbol.GetAttributes().FirstOrDefault(attributeSyntaxLocationMatches);
Expand Down