11 references to WithTarget
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
464
.
WithTarget
(AttributeTargetSpecifier(PropertyKeyword))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
185
=> attributeList.
WithTarget
(AttributeTargetSpecifier(Identifier(SyntaxFacts.GetText(SyntaxKind.FieldKeyword)), ColonToken.WithTrailingTrivia(Space)));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
160
a => a.
WithTarget
(AttributeTargetSpecifier(MethodKeyword)).WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation)));
Microsoft.CodeAnalysis.CSharp.Features (4)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
492
[.. methodTargetingAttributes.Select(a => a.
WithTarget
(null).WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation))],
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
464
.
WithTarget
(AttributeTargetSpecifier(PropertyKeyword))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
185
=> attributeList.
WithTarget
(AttributeTargetSpecifier(Identifier(SyntaxFacts.GetText(SyntaxKind.FieldKeyword)), ColonToken.WithTrailingTrivia(Space)));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
160
a => a.
WithTarget
(AttributeTargetSpecifier(MethodKeyword)).WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation)));
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
CodeGeneration\CSharpSyntaxGenerator.cs (3)
1083
.Select(list => list.
WithTarget
(SyntaxFactory.AttributeTargetSpecifier(ReturnKeyword)));
1088
return [.. attributes.Select(list => list.
WithTarget
(SyntaxFactory.AttributeTargetSpecifier(AssemblyKeyword)))];
2203
return attrList.WithAttributes([attr]).
WithTarget
(null);
Roslyn.Diagnostics.CSharp.Analyzers (1)
CSharpImportingConstructorShouldBeObsoleteCodeFixProvider.cs (1)
32
=> ((AttributeListSyntax)attributeList).
WithTarget
(AttributeTargetSpecifier(MethodKeyword));