43 references to DisableKeyword
Microsoft.CodeAnalysis.CSharp (11)
Parser\DirectiveParser.cs (5)
546SyntaxKind.DisableKeyword => EatToken(), 548_ => EatToken(SyntaxKind.DisableKeyword, ErrorCode.ERR_NullableDirectiveQualifierExpected, reportError: isActive) 576if (this.CurrentToken.Kind == SyntaxKind.DisableKeyword || this.CurrentToken.Kind == SyntaxKind.RestoreKeyword) 632style = this.EatToken(SyntaxKind.DisableKeyword, ErrorCode.WRN_IllegalPPWarning, reportError: isActive); 678var style = this.EatToken(SyntaxKind.DisableKeyword, reportError: false);
Syntax\CSharpPragmaWarningStateMap.cs (1)
102SyntaxKind.DisableKeyword => PragmaWarningState.Disabled,
Syntax\NullableContextStateMap.cs (1)
157SyntaxKind.DisableKeyword => NullableContextState.State.Disabled,
Syntax\SyntaxKindFacts.cs (4)
100case SyntaxKind.DisableKeyword: 132case SyntaxKind.DisableKeyword: 1147return SyntaxKind.DisableKeyword; 1687case SyntaxKind.DisableKeyword:
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
147else if (directive.SettingToken.IsKind(SyntaxKind.DisableKeyword)) 161else if (directive.SettingToken.IsKind(SyntaxKind.DisableKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
26public static readonly SyntaxToken DisableKeyword = Token(SyntaxKind.DisableKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
206isDisable = pragmaWarning.DisableOrRestoreKeyword.IsKind(SyntaxKind.DisableKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
322if (!IsFormatDirective(pragmaWarningDirectiveTrivia, SyntaxKind.DisableKeyword))
Microsoft.CodeAnalysis.CSharp.Features (10)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (2)
241var toggledKeywordKind = currentKeyword.Kind() == SyntaxKind.DisableKeyword ? SyntaxKind.RestoreKeyword : SyntaxKind.DisableKeyword;
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
51if (token.Kind() is not (SyntaxKind.EnableKeyword or SyntaxKind.RestoreKeyword or SyntaxKind.DisableKeyword or SyntaxKind.NullableKeyword or SyntaxKind.HashToken) || 138if (originalNode.SettingToken.IsKind(SyntaxKind.DisableKeyword))
Completion\KeywordRecommenders\AnnotationsKeywordRecommender.cs (1)
26(previousToken1.Kind() == SyntaxKind.EnableKeyword || previousToken1.Kind() == SyntaxKind.DisableKeyword || previousToken1.Kind() == SyntaxKind.RestoreKeyword) &&
Completion\KeywordRecommenders\DisableKeywordRecommender.cs (1)
13: base(SyntaxKind.DisableKeyword, isValidInPreprocessorContext: true)
Completion\KeywordRecommenders\WarningsKeywordRecommender.cs (1)
26(previousToken1.Kind() == SyntaxKind.EnableKeyword || previousToken1.Kind() == SyntaxKind.DisableKeyword || previousToken1.Kind() == SyntaxKind.RestoreKeyword) &&
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
140var keyword = enable ? SyntaxKind.EnableKeyword : SyntaxKind.DisableKeyword;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
147else if (directive.SettingToken.IsKind(SyntaxKind.DisableKeyword)) 161else if (directive.SettingToken.IsKind(SyntaxKind.DisableKeyword))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (14)
Generated\Syntax.Test.xml.Generated.cs (4)
728=> InternalSyntaxFactory.PragmaWarningDirectiveTrivia(InternalSyntaxFactory.Token(SyntaxKind.HashToken), InternalSyntaxFactory.Token(SyntaxKind.PragmaKeyword), InternalSyntaxFactory.Token(SyntaxKind.WarningKeyword), InternalSyntaxFactory.Token(SyntaxKind.DisableKeyword), new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SeparatedSyntaxList<Syntax.InternalSyntax.ExpressionSyntax>(), InternalSyntaxFactory.Token(SyntaxKind.EndOfDirectiveToken), new bool()); 3797Assert.Equal(SyntaxKind.DisableKeyword, node.DisableOrRestoreKeyword.Kind); 10944=> SyntaxFactory.PragmaWarningDirectiveTrivia(SyntaxFactory.Token(SyntaxKind.HashToken), SyntaxFactory.Token(SyntaxKind.PragmaKeyword), SyntaxFactory.Token(SyntaxKind.WarningKeyword), SyntaxFactory.Token(SyntaxKind.DisableKeyword), new SeparatedSyntaxList<ExpressionSyntax>(), SyntaxFactory.Token(SyntaxKind.EndOfDirectiveToken), new bool()); 14013Assert.Equal(SyntaxKind.DisableKeyword, node.DisableOrRestoreKeyword.Kind());
LexicalAndXml\PreprocessorTests.cs (10)
276Assert.True(setting.Kind() == SyntaxKind.EnableKeyword || setting.Kind() == SyntaxKind.DisableKeyword || 3677DisableOrRestoreKind = SyntaxKind.DisableKeyword, 3694DisableOrRestoreKind = SyntaxKind.DisableKeyword 3725DisableOrRestoreKind = SyntaxKind.DisableKeyword, 3774DisableOrRestoreKind = SyntaxKind.DisableKeyword, 3790DisableOrRestoreKind = SyntaxKind.DisableKeyword, 3806DisableOrRestoreKind = SyntaxKind.DisableKeyword, 3885DisableOrRestoreKind = SyntaxKind.DisableKeyword, 3910DisableOrRestoreKind = SyntaxKind.DisableKeyword, 4055DisableOrRestoreKind = SyntaxKind.DisableKeyword
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
26public static readonly SyntaxToken DisableKeyword = Token(SyntaxKind.DisableKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
206isDisable = pragmaWarning.DisableOrRestoreKeyword.IsKind(SyntaxKind.DisableKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
322if (!IsFormatDirective(pragmaWarningDirectiveTrivia, SyntaxKind.DisableKeyword))