src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (16)
48if (destination is TypeDeclarationSyntax typeDeclaration)
59private static IList<bool> GetInsertionIndices(TypeDeclarationSyntax destination, CancellationToken cancellationToken)
92CheckDeclarationNode<TypeDeclarationSyntax>(destination);
94return Cast<TDeclarationNode>(EventGenerator.AddEventTo(Cast<TypeDeclarationSyntax>(destination), @event, info, availableIndices, cancellationToken));
99CheckDeclarationNode<EnumDeclarationSyntax, TypeDeclarationSyntax, CompilationUnitSyntax>(destination);
105else if (destination is TypeDeclarationSyntax)
107return Cast<TDeclarationNode>(FieldGenerator.AddFieldTo(Cast<TypeDeclarationSyntax>(destination), field, info, availableIndices, cancellationToken));
123CheckDeclarationNode<TypeDeclarationSyntax, CompilationUnitSyntax, BaseNamespaceDeclarationSyntax>(destination);
143if (destination is TypeDeclarationSyntax typeDeclaration)
191CheckDeclarationNode<TypeDeclarationSyntax, CompilationUnitSyntax>(destination);
235if (destination is TypeDeclarationSyntax)
238Cast<TypeDeclarationSyntax>(destination), property, info, availableIndices, cancellationToken));
249CheckDeclarationNode<TypeDeclarationSyntax, BaseNamespaceDeclarationSyntax, CompilationUnitSyntax>(destination);
253if (destination is TypeDeclarationSyntax typeDeclaration)
343CheckDeclarationNode<EnumDeclarationSyntax, TypeDeclarationSyntax, BaseNamespaceDeclarationSyntax, CompilationUnitSyntax>(destination);
350else if (destination is TypeDeclarationSyntax typeDeclaration)
CodeGeneration\CSharpSyntaxGenerator.cs (10)
1220=> declaration is TypeDeclarationSyntax { ParameterList: { } parameterList } ? parameterList : null;
1257TypeDeclarationSyntax type => type.Members,
1364TypeDeclarationSyntax type => type.WithMembers(type.Members.AddRange(newMembers)),
1381TypeDeclarationSyntax typeDeclaration => AsClassMember(member, typeDeclaration.Identifier.Text),
1757TypeDeclarationSyntax type => type.WithTypeParameterList(typeParameterList),
1811TypeDeclarationSyntax type => type.WithConstraintClauses(WithTypeConstraints(type.ConstraintClauses, typeParameterName, kinds, isUnmanagedType, types)),
2243return ((TypeDeclarationSyntax)declaration).WithParameterList((ParameterListSyntax)list);
2688=> declaration is TypeDeclarationSyntax typeDeclaration
2693=> declaration is TypeDeclarationSyntax typeDeclaration
3616if (modifiedNode is TypeDeclarationSyntax declarationSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (16)
48if (destination is TypeDeclarationSyntax typeDeclaration)
59private static IList<bool> GetInsertionIndices(TypeDeclarationSyntax destination, CancellationToken cancellationToken)
92CheckDeclarationNode<TypeDeclarationSyntax>(destination);
94return Cast<TDeclarationNode>(EventGenerator.AddEventTo(Cast<TypeDeclarationSyntax>(destination), @event, info, availableIndices, cancellationToken));
99CheckDeclarationNode<EnumDeclarationSyntax, TypeDeclarationSyntax, CompilationUnitSyntax>(destination);
105else if (destination is TypeDeclarationSyntax)
107return Cast<TDeclarationNode>(FieldGenerator.AddFieldTo(Cast<TypeDeclarationSyntax>(destination), field, info, availableIndices, cancellationToken));
123CheckDeclarationNode<TypeDeclarationSyntax, CompilationUnitSyntax, BaseNamespaceDeclarationSyntax>(destination);
143if (destination is TypeDeclarationSyntax typeDeclaration)
191CheckDeclarationNode<TypeDeclarationSyntax, CompilationUnitSyntax>(destination);
235if (destination is TypeDeclarationSyntax)
238Cast<TypeDeclarationSyntax>(destination), property, info, availableIndices, cancellationToken));
249CheckDeclarationNode<TypeDeclarationSyntax, BaseNamespaceDeclarationSyntax, CompilationUnitSyntax>(destination);
253if (destination is TypeDeclarationSyntax typeDeclaration)
343CheckDeclarationNode<EnumDeclarationSyntax, TypeDeclarationSyntax, BaseNamespaceDeclarationSyntax, CompilationUnitSyntax>(destination);
350else if (destination is TypeDeclarationSyntax typeDeclaration)