2 implementations of IsConst
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\FieldSymbol.cs (1)
82bool IFieldSymbol.IsConst => _underlying.IsConst;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\FieldSymbol.vb (1)
422Private ReadOnly Property IFieldSymbol_IsConst As Boolean Implements IFieldSymbol.IsConst
62 references to IsConst
Microsoft.CodeAnalysis.CodeStyle (8)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
163IsConst: false,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
139IsConst: false, 403if (getterField.IsConst || getterField.IsVolatile)
src\Workspaces\Core\Portable\Editing\DeclarationModifiers.cs (1)
77var isConst = field?.IsConst == true;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
486if (!fieldSymbol.IsConst &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
317IFieldSymbol fieldSymbol => !fieldSymbol.IsReadOnly && !fieldSymbol.IsConst,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
701if (!fieldSymbol.IsConst && !fieldSymbol.IsReadOnly && !fieldSymbol.IsStatic)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
518if ((kind == SymbolKind.Field && ((IFieldSymbol)symbol).IsConst) ||
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
548!field.IsConst &&
Microsoft.CodeAnalysis.CSharp (4)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (4)
74else if (symbol.IsConst) 85symbol.IsConst && 899if (symbol.IsConst) 932var isConst = symbol is IFieldSymbol { IsConst: true };
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
313if (exprSymbol is not IFieldSymbol { IsConst: true })
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
108.Where(field => !field.IsConst && !field.IsStatic)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
127if (field.IsConst)
Microsoft.CodeAnalysis.CSharp.Features (4)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
189var fields = type.GetMembers().OfType<IFieldSymbol>().Where(f => f.IsConst).Where(f => f.HasConstantValue);
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
98new DeclarationModifiers(isStatic: field.IsStatic, isReadOnly: field.IsReadOnly, isConst: field.IsConst),
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
106if (memberWithName is IFieldSymbol { IsConst: false, DeclaringSyntaxReferences: [var syntaxRef1, ..] } field &&
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
108.Where(field => !field.IsConst && !field.IsStatic)
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
236if (fieldSymbol.IsConst)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
616.WhereAsArray(symbol => symbol is INamespaceOrTypeSymbol or IFieldSymbol { IsConst: true }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
313if (exprSymbol is not IFieldSymbol { IsConst: true })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
127if (field.IsConst)
Microsoft.CodeAnalysis.Features (11)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
351=> symbol.IsConst ? ((symbol.ContainingType.TypeKind == TypeKind.Enum) ? FeaturesResources.enum_value : FeaturesResources.const_field) :
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
356setMethod: field.IsReadOnly || field.IsConst ? null : CreateSet(fieldName, field, factory)));
GenerateFromMembers\AbstractGenerateFromMembersCodeRefactoringProvider.cs (1)
72IFieldSymbol field => IsViableField(field) && !field.IsConst,
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
700!field.IsConst &&
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (2)
551symbol.IsConst 560if (symbol.IsConst)
Shared\Extensions\ISymbolExtensions_2.cs (1)
45publicIcon = ((IFieldSymbol)symbol).IsConst ? Glyph.ConstantPublic : Glyph.FieldPublic;
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
163IsConst: false,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
139IsConst: false, 403if (getterField.IsConst || getterField.IsVolatile)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
548!field.IsConst &&
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
92if (!field.IsConst && !field.IsReadOnly && !assignedToFields.Contains(field))
Microsoft.CodeAnalysis.VisualBasic (5)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (4)
31ElseIf symbol.IsConst Then 52symbol.IsConst AndAlso 598If symbol.IsConst Then 618Dim isConst = symbol.Kind = SymbolKind.Field AndAlso DirectCast(symbol, IFieldSymbol).IsConst
Symbols\FieldSymbol.vb (1)
422Private ReadOnly Property IFieldSymbol_IsConst As Boolean Implements IFieldSymbol.IsConst
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
111If field.IsConst Then
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Completion\CompletionProviders\EnumCompletionProvider.vb (1)
68If member.Kind = SymbolKind.Field AndAlso DirectCast(member, IFieldSymbol).IsConst AndAlso member.IsEditorBrowsable(options.MemberDisplayOptions.HideAdvancedMembers, syntaxContext.SemanticModel.Compilation) Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (1)
197If fieldSymbol.IsConst Then
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
86Return Not field.IsReadOnly AndAlso Not field.IsConst
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
111If field.IsConst Then
Microsoft.CodeAnalysis.Workspaces (5)
Editing\DeclarationModifiers.cs (1)
77var isConst = field?.IsConst == true;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
486if (!fieldSymbol.IsConst &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
317IFieldSymbol fieldSymbol => !fieldSymbol.IsReadOnly && !fieldSymbol.IsConst,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
701if (!fieldSymbol.IsConst && !fieldSymbol.IsReadOnly && !fieldSymbol.IsStatic)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
518if ((kind == SymbolKind.Field && ((IFieldSymbol)symbol).IsConst) ||
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckAnalyzer.cs (1)
153return field?.IsConst ?? false;
InstanceInitializerAnalyzer.cs (1)
45if (symbol.IsConst || symbol.IsStatic || symbol.IsImplicitlyDeclared)
Microsoft.VisualStudio.LanguageServices (1)
Library\ObjectBrowser\Lists\MemberListItem.cs (1)
33Kind = fieldSymbol.IsConst
Microsoft.VisualStudio.LanguageServices.CSharp (2)
ObjectBrowser\DescriptionBuilder.cs (2)
280(fieldSymbol == null || !fieldSymbol.IsConst)) 295if (fieldSymbol != null && fieldSymbol.IsConst)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
240fieldMock.SetupGet(s => s.IsConst).Returns(isConst);
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
ObjectBrowser\DescriptionBuilder.vb (2)
342(fieldSymbol Is Nothing OrElse Not fieldSymbol.IsConst) Then 351If fieldSymbol IsNot Nothing AndAlso fieldSymbol.IsConst Then
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Parser.cs (1)
954fieldInfo.IsStatic || fieldInfo.IsConst ||
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
295fieldReferenceOperation.Member is IFieldSymbol fieldSymbol && fieldSymbol.IsConst)
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationInfo.cs (1)
23IsConst: true,