116 references to ParseTypeName
Microsoft.AspNetCore.App.CodeFixes (2)
RouteParameterUnusedParameterFixer.cs (2)
22private static readonly TypeSyntax DefaultType = SyntaxFactory.ParseTypeName("string"); 160return resolvedName != null ? SyntaxFactory.ParseTypeName(resolvedName) : DefaultType;
Microsoft.CodeAnalysis.CSharp (1)
Syntax\SyntaxFactory.cs (1)
1708return ParseTypeName(text, offset, options: null, consumeFullText);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
98SyntaxFactory.ParseTypeName("Task")
Microsoft.CodeAnalysis.CSharp.Features (2)
ExtractMethod\CSharpMethodExtractor.cs (1)
168=> SyntaxFactory.ParseTypeName(name);
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
98SyntaxFactory.ParseTypeName("Task")
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (20)
Semantics\NativeIntegerTests.cs (1)
4075var typeSyntax = SyntaxFactory.ParseTypeName("nuint");
Semantics\NullableContextTests.cs (1)
2229var type = SyntaxFactory.ParseTypeName(typeName);
Semantics\NullableReferenceTypesTests.cs (16)
113787TypeSyntax type = SyntaxFactory.ParseTypeName( 113824TypeSyntax type = SyntaxFactory.ParseTypeName( 113849TypeSyntax type = SyntaxFactory.ParseTypeName( 113874TypeSyntax type = SyntaxFactory.ParseTypeName( 113903TypeSyntax type = SyntaxFactory.ParseTypeName( 113930TypeSyntax type = SyntaxFactory.ParseTypeName( 113958TypeSyntax type = SyntaxFactory.ParseTypeName( 113986TypeSyntax type = SyntaxFactory.ParseTypeName( 114012TypeSyntax type = SyntaxFactory.ParseTypeName( 114050TypeSyntax type = SyntaxFactory.ParseTypeName( 114075TypeSyntax type = SyntaxFactory.ParseTypeName( 114100TypeSyntax type = SyntaxFactory.ParseTypeName( 114129TypeSyntax type = SyntaxFactory.ParseTypeName( 114156TypeSyntax type = SyntaxFactory.ParseTypeName( 114184TypeSyntax type = SyntaxFactory.ParseTypeName( 114212TypeSyntax type = SyntaxFactory.ParseTypeName(
Semantics\SyntaxTreeRootTests.cs (1)
34var node = SyntaxFactory.CatchClause(SyntaxFactory.CatchDeclaration(SyntaxFactory.ParseTypeName(typeof(InvalidOperationException).Name)), null, SyntaxFactory.Block());
Semantics\UnsafeTests.cs (1)
7297model.GetSpeculativeTypeInfo(syntax.SpanStart, SyntaxFactory.ParseTypeName("S*"), SpeculativeBindingOption.BindAsTypeOrNamespace);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (13)
Compilation\SemanticModelAPITests.cs (2)
3223var typeSyntax = SyntaxFactory.ParseTypeName("System.Collections.Generic.IEnumerable<C[]>"); 4328var typeSyntax = SyntaxFactory.ParseTypeName("dynamic");
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (10)
4006symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("A<T>"), SpeculativeBindingOption.BindAsTypeOrNamespace); 4012symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("A<int>"), SpeculativeBindingOption.BindAsTypeOrNamespace); 4018symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("A<>"), SpeculativeBindingOption.BindAsTypeOrNamespace); 4024symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("B<U>"), SpeculativeBindingOption.BindAsTypeOrNamespace); 4030symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("B<int>"), SpeculativeBindingOption.BindAsTypeOrNamespace); 4036symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("B<>"), SpeculativeBindingOption.BindAsTypeOrNamespace); 4042symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("A<>.B<>"), SpeculativeBindingOption.BindAsTypeOrNamespace); 4048symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("A<>.B<U>"), SpeculativeBindingOption.BindAsTypeOrNamespace); 4053symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("A<T>.B<>"), SpeculativeBindingOption.BindAsTypeOrNamespace); 4059symbolInfo = model.GetSpeculativeSymbolInfo(typeofArgPosition, SyntaxFactory.ParseTypeName("A<T>.B<U>"), SpeculativeBindingOption.BindAsTypeOrNamespace);
Symbols\Source\NullablePublicAPITests.cs (1)
4243var type = SyntaxFactory.ParseTypeName("string");
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (14)
LexicalAndXml\XmlDocCommentTests.cs (6)
2953SyntaxFactory.TypeCref(SyntaxFactory.ParseTypeName("TypeName"))), 3000SyntaxFactory.TypeCref(SyntaxFactory.ParseTypeName("TypeName"))), 3003SyntaxFactory.TypeCref(SyntaxFactory.ParseTypeName("TypeName2"))), 3129SyntaxFactory.XmlSeeElement(SyntaxFactory.TypeCref(SyntaxFactory.ParseTypeName("TypeName"))), 3155SyntaxFactory.ParseTypeName("InvalidOperationException")), 3180SyntaxFactory.ParseTypeName("MyPermission")),
Parsing\NameParsingTests.cs (1)
26return SyntaxFactory.ParseTypeName(text);
Syntax\SyntaxFactoryTests.cs (4)
518SyntaxFactory.ParseTypeName("DateTime")), 564returnType: SyntaxFactory.ParseTypeName("int[]"), 626var parsedWith8 = SyntaxFactory.ParseTypeName(type, options: TestOptions.Regular8); 629var parsedWithPreview = SyntaxFactory.ParseTypeName(type, options: TestOptions.Regular9);
Syntax\SyntaxListTests.cs (1)
236var newMethodDeclaration = SyntaxFactory.MethodDeclaration(SyntaxFactory.ParseTypeName("void"), "M");
Syntax\SyntaxNodeTests.cs (1)
65var cls2 = cls.AddBaseListTypes(SyntaxFactory.SimpleBaseType(SyntaxFactory.ParseTypeName("B")));
Syntax\SyntaxRewriterTests.cs (1)
351var newRoot = tree.GetCompilationUnitRoot().ReplaceNode(typeName, SyntaxFactory.ParseTypeName("Class2<U>"));
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Simplification\CSharpSimplificationService.Expander.cs (2)
753[.. typeArguments.Select(p => ParseTypeName(p.ToDisplayString(s_typeNameFormatWithGenerics)))])) 937ExpressionSyntax left = ParseTypeName(displayString);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
Formatting\FormattingElasticTriviaTests.cs (1)
69BaseList([SimpleBaseType(ParseTypeName("System.Attribute"))]),
Formatting\FormattingTests.cs (1)
4642SyntaxFactory.ParseTypeName("int"),
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
ChangeSignature\AddedParameterOrExistingIndex.cs (1)
68LanguageNames.CSharp => semanticModel.GetSpeculativeTypeInfo(0, CSharp.SyntaxFactory.ParseTypeName(_addedParameterFullyQualifiedTypeName!), SpeculativeBindingOption.BindAsTypeOrNamespace).Type,
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
CodeCleanup\CodeCleanupTests.cs (1)
366=> CSharp.SyntaxFactory.MethodDeclaration(CSharp.SyntaxFactory.ParseTypeName(returnType), CSharp.SyntaxFactory.Identifier(methodName));
Microsoft.Gen.Logging.Unit.Tests (3)
ParserUtilitiesTests.cs (3)
25SyntaxFactory.ParseTypeName("string"), 35SyntaxFactory.ParseTypeName("object"), 63SyntaxFactory.VariableDeclaration(SyntaxFactory.ParseTypeName("string")));
Microsoft.Interop.ComInterfaceGenerator (5)
ComInterfaceGenerator.cs (2)
555LocalDeclarationStatement(VariableDeclaration(ParseTypeName("nint")) 600TypeOfExpression(ParseTypeName(interfaceMethods.Interface.Base.Info.Type.FullTypeName))
Marshallers\StructAsHResultMarshallerFactory.cs (2)
45ParseTypeName(TypeNames.System_Runtime_CompilerServices_Unsafe), 63ParseTypeName(TypeNames.System_Runtime_CompilerServices_Unsafe),
VtableIndexStubGenerator.cs (1)
305var unwrapperSyntax = ParseTypeName(unmanagedObjectUnwrapper.AttributeClass.TypeArguments[0].ToDisplayString());
Microsoft.Interop.JavaScript.JSImportGenerator (5)
JSExportGenerator.cs (1)
149Parameter(Identifier("__arguments_buffer")).WithType(PointerType(ParseTypeName(Constants.JSMarshalerArgumentGlobal))))))
JSManagedTypeInfo.cs (4)
73Syntax = SyntaxFactory.ParseTypeName(fullTypeName.Trim()) 78Syntax = SyntaxFactory.ParseTypeName(fullTypeName.Trim()) 83Syntax = SyntaxFactory.ParseTypeName(fullTypeName.Trim()) 98Syntax = SyntaxFactory.ParseTypeName(fullTypeName.Trim())
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
378ParseTypeName(typeof(CharSet).FullName),
Microsoft.Interop.SourceGeneration (34)
ManagedTypeInfo.cs (1)
16public TypeSyntax Syntax => _syntax ??= SyntaxFactory.ParseTypeName(FullTypeName);
MarshallingAttributeInfo.cs (1)
136_ => CreateWellKnownComExceptionMarshallingData($"{TypeNames.ExceptionAsDefaultMarshaller}<{MarshallerHelpers.GetCompatibleGenericTypeParameterSyntax(SyntaxFactory.ParseTypeName(unmanagedReturnType.FullTypeName))}>", unmanagedReturnType),
TypeNames.cs (31)
55public static TypeSyntax Nint { get; } = ParseTypeName(TypeNames.Nint); 58public static TypeSyntax StringMarshalling => _StringMarshalling ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.StringMarshalling); 61public static TypeSyntax System_Runtime_InteropServices_ComWrappers_ComInterfaceEntry => _System_Runtime_InteropServices_ComWrappers_ComInterfaceEntry ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_ComWrappers_ComInterfaceEntry); 64public static TypeSyntax System_Runtime_InteropServices_NativeMemory => _System_Runtime_InteropServices_NativeMemory ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_NativeMemory); 67public static TypeSyntax StrategyBasedComWrappers => _StrategyBasedComWrappers ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.StrategyBasedComWrappers); 70public static TypeSyntax IUnmanagedVirtualMethodTableProvider => _IUnmanagedVirtualMethodTableProvider ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IUnmanagedVirtualMethodTableProvider); 73public static TypeSyntax IIUnknownInterfaceType => _IIUnknownInterfaceType ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IIUnknownInterfaceType); 76public static TypeSyntax IIUnknownDerivedDetails => _IIUnknownDerivedDetails ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IIUnknownDerivedDetails); 79public static TypeSyntax UnmanagedObjectUnwrapper => _UnmanagedObjectUnwrapper ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.UnmanagedObjectUnwrapper); 82public static TypeSyntax IComExposedClass => _IComExposedClass ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IComExposedClass); 85public static TypeSyntax UnreachableException => _UnreachableException ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.UnreachableException); 88public static TypeSyntax System_Runtime_CompilerServices_RuntimeHelpers => _System_Runtime_CompilerServices_RuntimeHelpers ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_CompilerServices_RuntimeHelpers); 91public static TypeSyntax System_Runtime_InteropServices_ComWrappers => _System_Runtime_InteropServices_ComWrappers ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_ComWrappers); 94public static TypeSyntax System_IntPtr => _System_IntPtr ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_IntPtr); 97public static TypeSyntax System_Guid => _System_Guid ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Guid); 100public static TypeSyntax DllImportSearchPath => _DllImportSearchPath ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.DllImportSearchPath); 103public static TypeSyntax System_Type => _System_Type ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Type); 106public static TypeSyntax System_Activator => _System_Activator ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Activator); 109public static TypeSyntax System_Runtime_InteropServices_Marshal => _System_Runtime_InteropServices_Marshal ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_Marshal); 112public static TypeSyntax System_Runtime_InteropServices_UnmanagedType => _System_Runtime_InteropServices_UnmanagedType ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_UnmanagedType); 115public static TypeSyntax System_Runtime_InteropServices_MemoryMarshal => _System_Runtime_InteropServices_MemoryMarshal ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_MemoryMarshal); 118public static TypeSyntax System_Exception => _System_Exception ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Exception); 121public static TypeSyntax System_GC => _System_GC ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_GC); 124public static TypeSyntax System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch => _System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch); 127public static TypeSyntax System_Runtime_CompilerServices_Unsafe => _System_Runtime_CompilerServices_Unsafe ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_CompilerServices_Unsafe); 139"Cdecl" => _CallConvCdecl ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.CallConvCdeclName), 140"Fastcall" => _CallConvFastcall ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.CallConvFastcallName), 141"MemberFunction" => _CallConvMemberFunction ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.CallConvMemberFunctionName), 142"Stdcall" => _CallConvStdcall ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.CallConvStdcallName), 143"SuppressGCTransition" => _CallConvSuppressGCTransition ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.CallConvSuppressGCTransitionName), 144"Thiscall" => _CallConvThiscall ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.CallConvThiscallName),
TypeSymbolExtensions.cs (1)
172return SyntaxFactory.ParseTypeName(type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat));
Microsoft.VisualStudio.LanguageServices.CSharp (9)
ChangeSignature\CSharpChangeSignatureViewModelFactoryService.cs (2)
55public override bool IsTypeNameValid(string typeName) => !SyntaxFactory.ParseTypeName(typeName, options: s_langVersionLatestParseOptions).ContainsDiagnostics; 57public override SyntaxNode GetTypeNode(string typeName) => SyntaxFactory.ParseTypeName(typeName);
CodeModel\CSharpCodeModelService.cs (7)
971var typeName = SyntaxFactory.ParseTypeName(name); 1808=> SyntaxFactory.Parameter(SyntaxFactory.Identifier(name)).WithType(SyntaxFactory.ParseTypeName(type)); 2743var newType = SyntaxFactory.ParseTypeName(typeName); 3015var parsedTypeName = SyntaxFactory.ParseTypeName(partialName); 3026var parsedTypeName = SyntaxFactory.ParseTypeName(fullName); 3067SyntaxFactory.ParseTypeName(type.ToDisplayString()))); 3699var typeName = SyntaxFactory.ParseTypeName(typeSymbol.ToMinimalDisplayString(semanticModel, position));