43 references to DisableKeyword
Microsoft.CodeAnalysis.CSharp (11)
Parser\DirectiveParser.cs (5)
546
SyntaxKind.
DisableKeyword
=> EatToken(),
548
_ => EatToken(SyntaxKind.
DisableKeyword
, ErrorCode.ERR_NullableDirectiveQualifierExpected, reportError: isActive)
576
if (this.CurrentToken.Kind == SyntaxKind.
DisableKeyword
|| this.CurrentToken.Kind == SyntaxKind.RestoreKeyword)
632
style = this.EatToken(SyntaxKind.
DisableKeyword
, ErrorCode.WRN_IllegalPPWarning, reportError: isActive);
678
var style = this.EatToken(SyntaxKind.
DisableKeyword
, reportError: false);
Syntax\CSharpPragmaWarningStateMap.cs (1)
102
SyntaxKind.
DisableKeyword
=> PragmaWarningState.Disabled,
Syntax\NullableContextStateMap.cs (1)
157
SyntaxKind.
DisableKeyword
=> NullableContextState.State.Disabled,
Syntax\SyntaxKindFacts.cs (4)
100
case SyntaxKind.
DisableKeyword
:
132
case SyntaxKind.
DisableKeyword
:
1147
return SyntaxKind.
DisableKeyword
;
1687
case SyntaxKind.
DisableKeyword
:
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
147
else if (directive.SettingToken.IsKind(SyntaxKind.
DisableKeyword
))
161
else if (directive.SettingToken.IsKind(SyntaxKind.
DisableKeyword
))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
26
public static readonly SyntaxToken DisableKeyword = Token(SyntaxKind.
DisableKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
206
isDisable = pragmaWarning.DisableOrRestoreKeyword.IsKind(SyntaxKind.
DisableKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
322
if (!IsFormatDirective(pragmaWarningDirectiveTrivia, SyntaxKind.
DisableKeyword
))
Microsoft.CodeAnalysis.CSharp.Features (10)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (2)
241
var toggledKeywordKind = currentKeyword.Kind() == SyntaxKind.
DisableKeyword
? SyntaxKind.RestoreKeyword : SyntaxKind.
DisableKeyword
;
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
51
if (token.Kind() is not (SyntaxKind.EnableKeyword or SyntaxKind.RestoreKeyword or SyntaxKind.
DisableKeyword
or SyntaxKind.NullableKeyword or SyntaxKind.HashToken) ||
138
if (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)
140
var keyword = enable ? SyntaxKind.EnableKeyword : SyntaxKind.
DisableKeyword
;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
147
else if (directive.SettingToken.IsKind(SyntaxKind.
DisableKeyword
))
161
else 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());
3797
Assert.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());
14013
Assert.Equal(SyntaxKind.
DisableKeyword
, node.DisableOrRestoreKeyword.Kind());
LexicalAndXml\PreprocessorTests.cs (10)
276
Assert.True(setting.Kind() == SyntaxKind.EnableKeyword || setting.Kind() == SyntaxKind.
DisableKeyword
||
3677
DisableOrRestoreKind = SyntaxKind.
DisableKeyword
,
3694
DisableOrRestoreKind = SyntaxKind.
DisableKeyword
3725
DisableOrRestoreKind = SyntaxKind.
DisableKeyword
,
3774
DisableOrRestoreKind = SyntaxKind.
DisableKeyword
,
3790
DisableOrRestoreKind = SyntaxKind.
DisableKeyword
,
3806
DisableOrRestoreKind = SyntaxKind.
DisableKeyword
,
3885
DisableOrRestoreKind = SyntaxKind.
DisableKeyword
,
3910
DisableOrRestoreKind = SyntaxKind.
DisableKeyword
,
4055
DisableOrRestoreKind = SyntaxKind.
DisableKeyword
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
26
public static readonly SyntaxToken DisableKeyword = Token(SyntaxKind.
DisableKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
206
isDisable = pragmaWarning.DisableOrRestoreKeyword.IsKind(SyntaxKind.
DisableKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
322
if (!IsFormatDirective(pragmaWarningDirectiveTrivia, SyntaxKind.
DisableKeyword
))