2 implementations of HasConstantValue
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\FieldSymbol.cs (1)
94bool IFieldSymbol.HasConstantValue => _underlying.HasConstantValue;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\FieldSymbol.vb (1)
482Private ReadOnly Property IFieldSymbol_HasConstantValue As Boolean Implements IFieldSymbol.HasConstantValue
40 references to HasConstantValue
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
158field.HasConstantValue &&
Microsoft.CodeAnalysis (1)
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (1)
322if (field.HasConstantValue)
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
24.Where(f => f.HasConstantValue)
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (2)
178if (field is { HasConstantValue: true, ConstantValue: not null }) 197if (field is { HasConstantValue: true, ConstantValue: not null })
Microsoft.CodeAnalysis.CSharp (3)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
78symbol.HasConstantValue &&
Symbols\TypedConstantExtensions.cs (2)
87if (field is object && field.HasConstantValue) 165if (field is object && field.HasConstantValue)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
76if (!enumMember.HasConstantValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
113if (field.HasConstantValue)
Microsoft.CodeAnalysis.CSharp.Features (3)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
189var fields = type.GetMembers().OfType<IFieldSymbol>().Where(f => f.IsConst).Where(f => f.HasConstantValue);
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
101field.HasConstantValue,
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
109case IFieldSymbol { HasConstantValue: true }: return default;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (6)
Compilation\SemanticModelGetSemanticInfoTests.cs (6)
4623Assert.True(symbol.HasConstantValue); 4691Assert.True(symbol.HasConstantValue); 4728Assert.False(symbol.HasConstantValue); 4764Assert.False(symbol.HasConstantValue); 4800Assert.False(symbol.HasConstantValue); 4832Assert.True(symbol.HasConstantValue);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
76if (!enumMember.HasConstantValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
113if (field.HasConstantValue)
Microsoft.CodeAnalysis.VisualBasic (4)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
53symbol.HasConstantValue Then
Symbols\FieldSymbol.vb (1)
482Private ReadOnly Property IFieldSymbol_HasConstantValue As Boolean Implements IFieldSymbol.HasConstantValue
Symbols\TypedConstant.vb (2)
81If field IsNot Nothing AndAlso field.HasConstantValue Then 146If field IsNot Nothing AndAlso field.HasConstantValue Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (1)
53If Not enumMember.HasConstantValue Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
95If field.HasConstantValue Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (1)
53If Not enumMember.HasConstantValue Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
95If field.HasConstantValue Then
Microsoft.CodeAnalysis.Workspaces (8)
Editing\SyntaxGenerator.cs (1)
135var initializer = field.HasConstantValue ? this.LiteralExpression(field.ConstantValue, canUseFieldReference) : null;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
24.Where(f => f.HasConstantValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (2)
178if (field is { HasConstantValue: true, ConstantValue: not null }) 197if (field is { HasConstantValue: true, ConstantValue: not null })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
161if (f1.HasConstantValue != f2.HasConstantValue) 163return f1.HasConstantValue ? 1 : -1; 166return f1.HasConstantValue
Microsoft.Gen.Metrics (1)
Parser.cs (1)
378!fieldSymbol.HasConstantValue ||
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
378!fieldSymbol.HasConstantValue ||
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
ObjectBrowser\DescriptionBuilder.vb (1)
233If fieldSymbol.HasConstantValue Then