2 overrides of GetType
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1962
public override SyntaxNode?
GetType
(SyntaxNode declaration)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
2104
Public Overrides Function
[GetType]
(declaration As SyntaxNode) As SyntaxNode
63 references to GetType
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (29)
CodeGeneration\SyntaxGeneratorTests.cs (29)
3194
Assert.Equal("t", Generator.
GetType
(Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"))).ToString());
3195
Assert.Null(Generator.
GetType
(Generator.MethodDeclaration("m")));
3197
Assert.Equal("t", Generator.
GetType
(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))).ToString());
3198
Assert.Equal("t", Generator.
GetType
(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).ToString());
3200
Assert.Equal("t", Generator.
GetType
(Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))).ToString());
3202
Assert.Equal("t", Generator.
GetType
(Generator.EventDeclaration("ef", Generator.IdentifierName("t"))).ToString());
3203
Assert.Equal("t", Generator.
GetType
(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"))).ToString());
3205
Assert.Equal("t", Generator.
GetType
(Generator.DelegateDeclaration("t", returnType: Generator.IdentifierName("t"))).ToString());
3206
Assert.Null(Generator.
GetType
(Generator.DelegateDeclaration("d")));
3208
Assert.Equal("t", Generator.
GetType
(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "v")).ToString());
3210
Assert.Null(Generator.
GetType
(Generator.ClassDeclaration("c")));
3211
Assert.Null(Generator.
GetType
(Generator.IdentifierName("x")));
3217
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3218
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.FieldDeclaration("f", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3219
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.PropertyDeclaration("p", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3221
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.ParameterDeclaration("p", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3223
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.DelegateDeclaration("t"), Generator.IdentifierName("t"))).ToString());
3225
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.EventDeclaration("ef", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3226
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3228
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.LocalDeclarationStatement(Generator.IdentifierName("x"), "v"), Generator.IdentifierName("t"))).ToString());
3229
Assert.Null(Generator.
GetType
(Generator.WithType(Generator.ClassDeclaration("c"), Generator.IdentifierName("t"))));
3230
Assert.Null(Generator.
GetType
(Generator.WithType(Generator.IdentifierName("x"), Generator.IdentifierName("t"))));
3796
Assert.NotNull(Generator.
GetType
(declX));
3797
Assert.Equal("int", Generator.
GetType
(declX).ToString());
3802
Assert.NotNull(Generator.
GetType
(declY));
3803
Assert.Equal("int", Generator.
GetType
(declY).ToString());
3808
Assert.NotNull(Generator.
GetType
(declZ));
3809
Assert.Equal("int", Generator.
GetType
(declZ).ToString());
3817
Assert.Equal("T", Generator.
GetType
(xTypedT).ToString());
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (33)
CodeGeneration\SyntaxGeneratorTests.vb (33)
2764
Assert.Equal("t", Generator.
GetType
(Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("t"))).ToString())
2765
Assert.Null(Generator.
GetType
(Generator.MethodDeclaration("m")))
2767
Assert.Equal("t", Generator.
GetType
(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))).ToString())
2768
Assert.Equal("t", Generator.
GetType
(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).ToString())
2769
Assert.Equal("t", Generator.
GetType
(Generator.IndexerDeclaration({Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))}, Generator.IdentifierName("t"))).ToString())
2770
Assert.Equal("t", Generator.
GetType
(Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))).ToString())
2772
Assert.Equal("t", Generator.
GetType
(Generator.EventDeclaration("ef", Generator.IdentifierName("t"))).ToString())
2773
Assert.Equal("t", Generator.
GetType
(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"))).ToString())
2775
Assert.Equal("t", Generator.
GetType
(Generator.DelegateDeclaration("t", returnType:=Generator.IdentifierName("t"))).ToString())
2776
Assert.Null(Generator.
GetType
(Generator.DelegateDeclaration("d")))
2778
Assert.Equal("t", Generator.
GetType
(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "v")).ToString())
2780
Assert.Null(Generator.
GetType
(Generator.ClassDeclaration("c")))
2781
Assert.Null(Generator.
GetType
(Generator.IdentifierName("x")))
2786
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2787
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.MethodDeclaration("m"), Generator.IdentifierName("t"))).ToString())
2788
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.FieldDeclaration("f", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2789
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.PropertyDeclaration("p", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2790
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.IndexerDeclaration({Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))}, Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2791
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.ParameterDeclaration("p", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2793
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.DelegateDeclaration("t", returnType:=Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2794
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.DelegateDeclaration("t"), Generator.IdentifierName("t"))).ToString())
2796
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.EventDeclaration("ef", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2797
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2799
Assert.Equal("t", Generator.
GetType
(Generator.WithType(Generator.LocalDeclarationStatement(Generator.IdentifierName("x"), "v"), Generator.IdentifierName("t"))).ToString())
2800
Assert.Null(Generator.
GetType
(Generator.WithType(Generator.ClassDeclaration("c"), Generator.IdentifierName("t"))))
2801
Assert.Null(Generator.
GetType
(Generator.WithType(Generator.IdentifierName("x"), Generator.IdentifierName("t"))))
3487
Assert.NotNull(Generator.
GetType
(declX))
3488
Assert.Equal("Integer", Generator.
GetType
(declX).ToString())
3493
Assert.NotNull(Generator.
GetType
(declY))
3494
Assert.Equal("Integer", Generator.
GetType
(declY).ToString())
3499
Assert.NotNull(Generator.
GetType
(declZ))
3500
Assert.Equal("Integer", Generator.
GetType
(declZ).ToString())
3508
Assert.Equal("T", Generator.
GetType
(xTypedT).ToString())
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
245
editor.Generator.ParameterDeclaration("@return", editor.Generator.
GetType
(generatedDeclaration), refKind: RefKind.Out)