121 references to PredefinedType
Microsoft.CodeAnalysis.CSharp.Features (3)
NullableImpactingSpanWalker.cs (3)
140
&& CSharpSyntaxFacts.Instance.TryGetPredefinedType(predefinedType.Keyword, out
var
type))
142
if (type is CodeAnalysis.LanguageService.
PredefinedType
.Object or CodeAnalysis.LanguageService.
PredefinedType
.String)
Microsoft.CodeAnalysis.CSharp.Workspaces (26)
CSharpSyntaxFacts.cs (26)
313
public bool IsPredefinedType(SyntaxToken token,
PredefinedType
type)
314
=> TryGetPredefinedType(token, out
var
actualType) && actualType == type;
319
public bool IsPredefinedType(SyntaxNode? node,
PredefinedType
type)
322
public bool TryGetPredefinedType(SyntaxToken token, out
PredefinedType
type)
325
return type !=
PredefinedType
.None;
328
private static
PredefinedType
GetPredefinedType(SyntaxToken token)
331
SyntaxKind.BoolKeyword =>
PredefinedType
.Boolean,
332
SyntaxKind.ByteKeyword =>
PredefinedType
.Byte,
333
SyntaxKind.SByteKeyword =>
PredefinedType
.SByte,
334
SyntaxKind.IntKeyword =>
PredefinedType
.Int32,
335
SyntaxKind.UIntKeyword =>
PredefinedType
.UInt32,
336
SyntaxKind.ShortKeyword =>
PredefinedType
.Int16,
337
SyntaxKind.UShortKeyword =>
PredefinedType
.UInt16,
338
SyntaxKind.LongKeyword =>
PredefinedType
.Int64,
339
SyntaxKind.ULongKeyword =>
PredefinedType
.UInt64,
340
SyntaxKind.FloatKeyword =>
PredefinedType
.Single,
341
SyntaxKind.DoubleKeyword =>
PredefinedType
.Double,
342
SyntaxKind.DecimalKeyword =>
PredefinedType
.Decimal,
343
SyntaxKind.StringKeyword =>
PredefinedType
.String,
344
SyntaxKind.CharKeyword =>
PredefinedType
.Char,
345
SyntaxKind.ObjectKeyword =>
PredefinedType
.Object,
346
SyntaxKind.VoidKeyword =>
PredefinedType
.Void,
349
"nint" =>
PredefinedType
.IntPtr,
350
"nuint" =>
PredefinedType
.UIntPtr,
351
_ =>
PredefinedType
.None,
353
_ =>
PredefinedType
.None,
Microsoft.CodeAnalysis.VisualBasic.Workspaces (27)
VisualBasicSyntaxFacts.vb (27)
302
Dim actualType As
PredefinedType
=
PredefinedType
.None
303
Return TryGetPredefinedType(token, actualType) AndAlso actualType <>
PredefinedType
.None
306
Public Function IsPredefinedType(token As SyntaxToken, type As
PredefinedType
) As Boolean Implements ISyntaxFacts.IsPredefinedType
307
Dim actualType As
PredefinedType
=
PredefinedType
.None
316
Public Function IsPredefinedType(node As SyntaxNode, type As
PredefinedType
) As Boolean Implements ISyntaxFacts.IsPredefinedType
321
Public Function TryGetPredefinedType(token As SyntaxToken, ByRef type As
PredefinedType
) As Boolean Implements ISyntaxFacts.TryGetPredefinedType
323
Return type <>
PredefinedType
.None
326
Private Shared Function GetPredefinedType(token As SyntaxToken) As
PredefinedType
329
Return
PredefinedType
.Boolean
331
Return
PredefinedType
.Byte
333
Return
PredefinedType
.SByte
335
Return
PredefinedType
.Int32
337
Return
PredefinedType
.UInt32
339
Return
PredefinedType
.Int16
341
Return
PredefinedType
.UInt16
343
Return
PredefinedType
.Int64
345
Return
PredefinedType
.UInt64
347
Return
PredefinedType
.Single
349
Return
PredefinedType
.Double
351
Return
PredefinedType
.Decimal
353
Return
PredefinedType
.String
355
Return
PredefinedType
.Char
357
Return
PredefinedType
.Object
359
Return
PredefinedType
.DateTime
361
Return
PredefinedType
.None
Microsoft.CodeAnalysis.Workspaces (60)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (2)
149
PredefinedType
predefinedType,
152
if (predefinedType ==
PredefinedType
.None)
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (4)
93
private static bool IsPotentialReference(
PredefinedType
predefinedType, ISyntaxFactsService syntaxFacts, SyntaxToken token)
94
=> syntaxFacts.TryGetPredefinedType(token, out
var
actualType) &&
178
var
predefinedType = symbol.ContainingType.SpecialType.ToPredefinedType();
179
if (predefinedType ==
PredefinedType
.None)
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (4)
103
PredefinedType
predefinedType,
108
syntaxFacts.TryGetPredefinedType(token, out
var
actualType) &&
201
var
predefinedType = symbol.SpecialType.ToPredefinedType();
202
if (predefinedType ==
PredefinedType
.None)
FindSymbols\SyntaxTree\SyntaxTreeIndex.ContextInfo.cs (1)
106
public bool ContainsPredefinedType(
PredefinedType
type)
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (2)
75
var predefinedTypes = (int)
PredefinedType
.None;
124
if (syntaxFacts.TryGetPredefinedType(token, out
var
predefinedType))
FindSymbols\SyntaxTree\SyntaxTreeIndex_Forwarders.cs (1)
16
public bool ContainsPredefinedType(
PredefinedType
type) => _contextInfo.ContainsPredefinedType(type);
ISyntaxFacts.cs (3)
120
bool IsPredefinedType(SyntaxToken token,
PredefinedType
type);
123
bool IsPredefinedType([NotNullWhen(true)] SyntaxNode? node,
PredefinedType
type);
192
bool TryGetPredefinedType(SyntaxToken token, out
PredefinedType
type);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SpecialTypeExtensions.cs\SpecialTypeExtensions.cs (21)
11
public static
PredefinedType
ToPredefinedType(this SpecialType specialType)
14
SpecialType.System_Object =>
PredefinedType
.Object,
15
SpecialType.System_Void =>
PredefinedType
.Void,
16
SpecialType.System_Boolean =>
PredefinedType
.Boolean,
17
SpecialType.System_Char =>
PredefinedType
.Char,
18
SpecialType.System_SByte =>
PredefinedType
.SByte,
19
SpecialType.System_Byte =>
PredefinedType
.Byte,
20
SpecialType.System_Int16 =>
PredefinedType
.Int16,
21
SpecialType.System_UInt16 =>
PredefinedType
.UInt16,
22
SpecialType.System_Int32 =>
PredefinedType
.Int32,
23
SpecialType.System_UInt32 =>
PredefinedType
.UInt32,
24
SpecialType.System_Int64 =>
PredefinedType
.Int64,
25
SpecialType.System_UInt64 =>
PredefinedType
.UInt64,
26
SpecialType.System_Decimal =>
PredefinedType
.Decimal,
27
SpecialType.System_Single =>
PredefinedType
.Single,
28
SpecialType.System_Double =>
PredefinedType
.Double,
29
SpecialType.System_String =>
PredefinedType
.String,
30
SpecialType.System_DateTime =>
PredefinedType
.DateTime,
31
SpecialType.System_IntPtr =>
PredefinedType
.IntPtr,
32
SpecialType.System_UIntPtr =>
PredefinedType
.UIntPtr,
33
_ =>
PredefinedType
.None,
PredefinedTypeExtensions.cs (20)
11
public static SpecialType ToSpecialType(this
PredefinedType
predefinedType)
14
PredefinedType
.Object => SpecialType.System_Object,
15
PredefinedType
.Void => SpecialType.System_Void,
16
PredefinedType
.Boolean => SpecialType.System_Boolean,
17
PredefinedType
.Char => SpecialType.System_Char,
18
PredefinedType
.SByte => SpecialType.System_SByte,
19
PredefinedType
.Byte => SpecialType.System_Byte,
20
PredefinedType
.Int16 => SpecialType.System_Int16,
21
PredefinedType
.UInt16 => SpecialType.System_UInt16,
22
PredefinedType
.Int32 => SpecialType.System_Int32,
23
PredefinedType
.UInt32 => SpecialType.System_UInt32,
24
PredefinedType
.Int64 => SpecialType.System_Int64,
25
PredefinedType
.UInt64 => SpecialType.System_UInt64,
26
PredefinedType
.Decimal => SpecialType.System_Decimal,
27
PredefinedType
.Single => SpecialType.System_Single,
28
PredefinedType
.Double => SpecialType.System_Double,
29
PredefinedType
.String => SpecialType.System_String,
30
PredefinedType
.DateTime => SpecialType.System_DateTime,
31
PredefinedType
.IntPtr => SpecialType.System_IntPtr,
32
PredefinedType
.UIntPtr => SpecialType.System_UIntPtr,
SyntaxGeneratorExtensions_Negate.cs (2)
155
if (syntaxFacts.IsPredefinedType(rightOperand,
PredefinedType
.Object) &&
535
if (syntaxFacts.IsPredefinedType(type,
PredefinedType
.Object))
Microsoft.VisualStudio.LanguageServices (3)
Library\ObjectBrowser\AbstractListItemFactory.cs (3)
60
return namedTypeSymbol.SpecialType.ToPredefinedType() !=
PredefinedType
.None
101
var fullNameText = namedTypeSymbol.SpecialType.ToPredefinedType() !=
PredefinedType
.None
112
var displayText = namedTypeSymbol.SpecialType.ToPredefinedType() !=
PredefinedType
.None
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
977
if (SyntaxFactsService.TryGetPredefinedType(predefinedTypeNode.Keyword, out
var
predefinedType))
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
3483
Dim predefinedType As
PredefinedType