688 references to None
Microsoft.CodeAnalysis.CSharp (128)
Binder\Binder_Expressions.cs (1)
3078
if (argumentSyntax.RefOrOutKeyword.Kind() != SyntaxKind.
None
)
Binder\Binder_Lambda.cs (2)
186
if (isLastParameter && paramsKeyword.Kind() != SyntaxKind.
None
&& type.IsSZArray())
367
var isParams = paramsKeyword.Kind() != SyntaxKind.
None
;
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1384
if (baseTypeDeclaration is TypeDeclarationSyntax { SemicolonToken: { RawKind: (int)SyntaxKind.SemicolonToken }, OpenBraceToken: { RawKind: (int)SyntaxKind.
None
} } noBlockBodyTypeDeclarationWithSemicolon)
Binder\CatchClauseBinder.cs (1)
32
if ((declarationOpt != null) && (declarationOpt.Identifier.Kind() != SyntaxKind.
None
))
Compilation\CSharpCompilation.cs (2)
4215
if (syntaxKind == SyntaxKind.
None
)
4441
if (syntaxKind == SyntaxKind.
None
|| name is WellKnownMemberNames.TrueOperatorName or WellKnownMemberNames.FalseOperatorName)
CSharpExtensions.cs (5)
69
return (object)token.Language == (object)LanguageNames.CSharp ? (SyntaxKind)token.RawContextualKind : SyntaxKind.
None
;
192
return IsCSharpKind(rawKind) ? (SyntaxKind)rawKind : SyntaxKind.
None
;
201
return IsCSharpKind(rawKind) ? (SyntaxKind)rawKind : SyntaxKind.
None
;
210
return IsCSharpKind(rawKind) ? (SyntaxKind)rawKind : SyntaxKind.
None
;
219
return IsCSharpKind(rawKind) ? (SyntaxKind)rawKind : SyntaxKind.
None
;
Declarations\DeclarationTreeBuilder.cs (2)
373
var isGlobal = directive.GlobalKeyword.Kind() != SyntaxKind.
None
;
726
if (record.ClassOrStructKeyword.Kind() != SyntaxKind.
None
)
Parser\Blender.cs (1)
134
Debug.Assert(token.Kind() != SyntaxKind.
None
, "how could we not get a real token back?");
Parser\Blender.Cursor.cs (2)
48
this.CurrentNodeOrToken.Kind() == SyntaxKind.
None
||
182
for (var node = cursor.CurrentNodeOrToken; node.Kind() != SyntaxKind.
None
&& !SyntaxFacts.IsAnyToken(node.Kind()); node = cursor.CurrentNodeOrToken)
Parser\DocumentationCommentXmlTokens.cs (2)
40
return SyntaxFactory.Identifier(SyntaxKind.
None
, null, text, text, trailing: null);
45
return SyntaxFactory.Identifier(SyntaxKind.
None
, SyntaxFactory.Space, text, text, trailing: null);
Parser\LanguageParser.cs (12)
3273
if (token.Kind != SyntaxKind.
None
)
3540
SyntaxKind separatorKind = SyntaxKind.
None
;
3577
separatorKind = SyntaxKind.
None
;
4162
|| SyntaxFacts.GetAccessorDeclarationKind(this.CurrentToken.ContextualKind) != SyntaxKind.
None
4230
SyntaxKind closeKind = SyntaxKind.
None
)
7151
closeKind: SyntaxKind.
None
,
7644
var lessThanTokenError = WithAdditionalDiagnostics(SyntaxFactory.MissingToken(SyntaxKind.LessThanToken), GetExpectedTokenError(SyntaxKind.LessThanToken, SyntaxKind.
None
));
8514
if (SyntaxFacts.GetBaseTypeDeclarationKind(nextToken.Kind) != SyntaxKind.
None
)
8751
closeKind: SyntaxKind.
None
,
11025
if (operatorTokenKind == SyntaxKind.
None
)
11171
return (SyntaxKind.
None
, SyntaxKind.
None
);
Parser\Lexer.cs (20)
417
case SyntaxKind.
None
:
439
info.Kind = SyntaxKind.
None
;
440
info.ContextualKind = SyntaxKind.
None
;
1837
info.ContextualKind = SyntaxKind.
None
;
1873
if (info.Kind == SyntaxKind.
None
)
1887
info.Kind = SyntaxKind.
None
;
2673
info.Kind = SyntaxKind.
None
;
2680
Debug.Assert(info.Kind != SyntaxKind.
None
|| info.Text != null);
2681
return info.Kind != SyntaxKind.
None
;
2856
Debug.Assert(info.Kind != SyntaxKind.
None
|| info.Text != null);
2857
return info.Kind != SyntaxKind.
None
;
3161
if (errors == null && tagInfo.ContextualKind == SyntaxKind.
None
&& tagInfo.Kind == SyntaxKind.IdentifierToken)
3267
info.Kind = SyntaxKind.
None
;
3274
Debug.Assert(info.Kind != SyntaxKind.
None
|| info.Text != null);
3275
return info.Kind != SyntaxKind.
None
;
3418
Debug.Assert(info.Kind != SyntaxKind.
None
|| info.Text != null);
3419
return info.Kind != SyntaxKind.
None
;
3763
if (info.Kind != SyntaxKind.
None
)
3854
Debug.Assert(info.Kind != SyntaxKind.
None
|| info.Text != null);
3855
return info.Kind != SyntaxKind.
None
;
Parser\LexerCache.cs (3)
25
if (kind == SyntaxKind.
None
)
56
kind = SyntaxKind.
None
;
61
return kind != SyntaxKind.
None
;
Parser\SyntaxParser.cs (1)
276
return cn != null ? cn.Kind() : SyntaxKind.
None
;
SymbolDisplay\SymbolDisplayVisitor.cs (2)
143
if (kind is SyntaxKind.
None
&& isNamedTypeOrAliasName && StringComparer.Ordinal.Equals(identifier, "record"))
148
return kind == SyntaxKind.
None
? identifier : $"@{identifier}";
SymbolDisplay\SymbolDisplayVisitor.Members.cs (6)
336
tryGetUserDefinedOperatorTokenKind(symbol.MetadataName) == SyntaxKind.
None
)
531
if (operatorKind == SyntaxKind.
None
)
552
if (conversionKind == SyntaxKind.
None
)
681
Debug.Assert(operatorKind != SyntaxKind.
None
);
719
return SyntaxKind.
None
;
727
Debug.Assert(conversionKind != SyntaxKind.
None
);
Symbols\RefKindExtensions.cs (1)
31
case SyntaxKind.
None
:
Symbols\Source\AttributeLocation.cs (1)
112
if (kind == SyntaxKind.
None
)
Symbols\Source\LocalFunctionSymbol.cs (1)
414
if (parameter.VarianceKeyword.Kind() != SyntaxKind.
None
)
Symbols\Source\ParameterHelpers.cs (7)
55
hasParamsModifier: paramsKeyword.Kind() != SyntaxKind.
None
,
56
isExtensionMethodThis: ordinal == 0 && thisKeyword.Kind() != SyntaxKind.
None
,
145
if (thisKeyword.Kind() != SyntaxKind.
None
&& !allowThis)
157
if (paramsKeyword.Kind() != SyntaxKind.
None
158
|| refnessKeyword.Kind() != SyntaxKind.
None
159
|| thisKeyword.Kind() != SyntaxKind.
None
)
185
Debug.Assert(refnessKeyword.Kind() != SyntaxKind.
None
);
Symbols\Source\SourceLabelSymbol.cs (2)
60
if (tk.Kind() != SyntaxKind.
None
)
155
&& symbol._identifierNodeOrToken.Kind() != SyntaxKind.
None
Symbols\Source\SourceLocalSymbol.cs (1)
50
Debug.Assert(identifierToken.Kind() != SyntaxKind.
None
);
Symbols\Source\SourceNamedTypeSymbol.cs (1)
185
if (tp.VarianceKeyword.Kind() != SyntaxKind.
None
)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
1118
if (parameter.VarianceKeyword.Kind() != SyntaxKind.
None
)
Symbols\Source\SourcePropertySymbol.cs (1)
620
if (arglistToken.Kind() != SyntaxKind.
None
)
Symbols\Symbol.cs (1)
514
if (token.Kind() != SyntaxKind.
None
)
Syntax\CSharpLineDirectiveMap.cs (1)
144
if (token.Kind() == SyntaxKind.
None
)
Syntax\CSharpSyntaxRewriter.cs (3)
152
if (!alternate.IsNull && visited != null && !visited.IsKind(SyntaxKind.
None
))
267
if (alternate != null && visited.Kind() != SyntaxKind.
None
) //skip the null check since SyntaxToken is a value type
301
if (alternate != null && visited.Kind() != SyntaxKind.
None
)
Syntax\DirectiveTriviaSyntax.cs (2)
71
while (token.Kind() != SyntaxKind.
None
)
102
while (token.Kind() != SyntaxKind.
None
)
Syntax\InternalSyntax\CSharpSyntaxRewriter.cs (1)
57
Debug.Assert(visited != null && visited.Kind != SyntaxKind.
None
, "Cannot remove node using Syntax.InternalSyntax.SyntaxRewriter.");
Syntax\LookupPosition.cs (2)
95
return firstExcluded.Kind() == SyntaxKind.
None
|| position < firstExcluded.SpanStart;
195
constructorDecl.SemicolonToken.Kind() == SyntaxKind.
None
? constructorDecl.Body!.CloseBraceToken : constructorDecl.SemicolonToken);
Syntax\NullableContextStateMap.cs (1)
164
SyntaxKind.
None
=> new NullableContextState(position, setting, setting),
Syntax\SyntaxKindFacts.cs (24)
405
return GetPrefixUnaryExpression(token) != SyntaxKind.
None
;
410
return GetPrefixUnaryExpression(token) != SyntaxKind.
None
;
436
return SyntaxKind.
None
;
442
return GetPostfixUnaryExpression(token) != SyntaxKind.
None
;
447
return GetPostfixUnaryExpression(token) != SyntaxKind.
None
;
461
return SyntaxKind.
None
;
536
return GetPrimaryFunction(keyword) != SyntaxKind.
None
;
560
return SyntaxKind.
None
;
566
return GetLiteralExpression(token) != SyntaxKind.
None
;
585
_ => SyntaxKind.
None
,
591
return GetInstanceExpression(token) != SyntaxKind.
None
;
603
return SyntaxKind.
None
;
609
return GetBinaryExpression(token) != SyntaxKind.
None
;
614
return GetBinaryExpression(token) != SyntaxKind.
None
;
666
return SyntaxKind.
None
;
747
return SyntaxKind.
None
;
760
return SyntaxKind.
None
;
779
return SyntaxKind.
None
;
822
return SyntaxKind.
None
;
844
return SyntaxKind.
None
;
1015
return SyntaxKind.
None
;
1085
return SyntaxKind.
None
;
1163
return SyntaxKind.
None
;
1359
return SyntaxKind.
None
;
Syntax\SyntaxNodeRemover.cs (2)
196
if (result.Kind() != SyntaxKind.
None
&& _residualTrivia != null && _residualTrivia.Count > 0)
279
if (alternate != null && visited.Kind() != SyntaxKind.
None
)
Syntax\SyntaxNormalizer.cs (6)
86
if (token.Kind() == SyntaxKind.
None
|| (token.IsMissing && token.FullWidth == 0))
189
if (nextToken.Kind() == SyntaxKind.
None
)
216
case SyntaxKind.
None
:
1006
return SyntaxFacts.GetBinaryExpression(kind) != SyntaxKind.
None
;
1012
return SyntaxFacts.GetAssignmentExpression(kind) != SyntaxKind.
None
;
1166
case SyntaxKind.
None
:
Syntax\SyntaxTokenParser.cs (6)
62
/// of <see cref="SyntaxKind.
None
"/>, <see cref="SyntaxToken.IsMissing"/> set to <see langword="true"/>, and a parent of <see langword="null"/>. The
70
var containingToken = InternalSyntax.SyntaxFactory.MissingToken(leading: leadingTrivia.Node, SyntaxKind.
None
, trailing: null);
77
/// of <see cref="SyntaxKind.
None
"/>, <see cref="SyntaxToken.IsMissing"/> set to <see langword="true"/>, and a parent of <see langword="null"/>. The
85
var containingToken = InternalSyntax.SyntaxFactory.MissingToken(leading: null, SyntaxKind.
None
, trailing: trailingTrivia.Node);
127
/// will return <see cref="SyntaxKind.
None
"/>.
134
return contextualKind == Token.Kind() ? SyntaxKind.
None
: contextualKind;
Microsoft.CodeAnalysis.CSharp.CodeStyle (60)
src\Analyzers\CSharp\Analyzers\AddAccessibilityModifiers\CSharpAddAccessibilityModifiers.cs (1)
33
if (name.Kind() == SyntaxKind.
None
)
src\Analyzers\CSharp\Analyzers\OrderModifiers\CSharpOrderModifiersHelper.cs (1)
22
return (int)(kind == SyntaxKind.
None
? SyntaxFacts.GetContextualKeywordKind(trimmed) : kind);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
122
if (!directive.TargetToken.IsKind(SyntaxKind.
None
))
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
77
if (argument.RefKindKeyword.Kind() != SyntaxKind.
None
)
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\Utilities.cs (1)
29
for (var current = SyntaxKind.
None
; current <= SyntaxKind.ThrowExpression; current++)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
236
if (element.Identifier.IsKind(SyntaxKind.
None
))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
84
return firstToken.Kind() != SyntaxKind.
None
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SymbolDisplayPartExtensions.cs (1)
21
if (SyntaxFacts.GetKeywordKind(text) != SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxKindExtensions.cs (1)
74
return SyntaxKind.
None
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
73
if (prevToken.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (5)
70
SyntaxFacts.GetContextualKeywordKind(simpleNameText) != SyntaxKind.
None
;
79
modifierKind = SyntaxKind.
None
;
119
return modifierKind != SyntaxKind.
None
;
163
if (previousToken.Kind() == SyntaxKind.
None
)
271
if (next.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
107
if (token.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (3)
70
if (trivia2.IsKind(SyntaxKind.
None
))
98
var lines = (trivia1.IsKind(SyntaxKind.
None
) && this.Token1.IsKind(SyntaxKind.
None
)) ? 0 : 1;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (1)
66
for (var currentToken = token1; !currentToken.IsKind(SyntaxKind.
None
);)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.ComplexTrivia.cs (2)
55
var formatSpanEnd = commonToken2.Kind() == SyntaxKind.
None
? commonToken1.Span.End : commonToken2.Span.Start;
83
var firstTriviaInTree = this.Token1.Kind() == SyntaxKind.
None
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (2)
56
if (bracketOrBracePair.openBracketOrBrace.IsKind(SyntaxKind.
None
) ||
58
bracketOrBracePair.closeBracketOrBrace.IsKind(SyntaxKind.
None
))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (14)
24
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
39
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
63
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
77
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
92
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
128
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
138
if (anchorToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (2)
310
if (currentToken.Kind() == SyntaxKind.
None
)
317
case SyntaxKind.
None
:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
334
Debug.Assert(!startToken.IsKind(SyntaxKind.
None
) && !endToken.IsKind(SyntaxKind.
None
));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (6)
95
if (!firstToken.IsKind(SyntaxKind.
None
) || !lastToken.IsKind(SyntaxKind.
None
))
125
if (!tokens.firstToken.IsKind(SyntaxKind.
None
) || !tokens.lastToken.IsKind(SyntaxKind.
None
))
183
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (4)
49
Contract.ThrowIfTrue(startToken.Kind() is SyntaxKind.
None
or SyntaxKind.EndOfFileToken);
50
Contract.ThrowIfTrue(endToken.Kind() is SyntaxKind.
None
or SyntaxKind.EndOfFileToken);
80
Contract.ThrowIfTrue(token.Kind() is SyntaxKind.
None
or SyntaxKind.EndOfFileToken);
84
if (previousToken.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (2)
324
if (ordering.AscendingOrDescendingKeyword.Kind() == SyntaxKind.
None
)
328
else if (orderByClauseSyntax.Orderings[0].AscendingOrDescendingKeyword.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
89
var needsEscaping = SyntaxFacts.GetKeywordKind(identifier) != SyntaxKind.
None
;
607
argument.RefOrOutKeyword.Kind() == SyntaxKind.
None
&&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (4)
22
Contract.ThrowIfTrue(endToken.Kind() == SyntaxKind.
None
);
43
if (closeBrace.Kind() == SyntaxKind.
None
|| !AreTwoTokensOnSameLine(previousToken, closeBrace))
289
return previousToken.Kind() == SyntaxKind.
None
? token : previousToken;
311
if (previousToken.Kind() == SyntaxKind.
None
)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (28)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
233
if (mappedBinaryExpressionKind == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\OperatorGenerator.cs (1)
82
if (operatorSyntaxKind == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (2)
143
Debug.Assert(!endOfLine.IsKind(SyntaxKind.
None
));
144
if (!endOfLine.IsKind(SyntaxKind.
None
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (3)
519
public static bool IsAnyAccessorDeclarationContext(this SyntaxToken targetToken, int position, SyntaxKind kind = SyntaxKind.
None
)
526
public static bool IsAccessorDeclarationContext<TMemberNode>(this SyntaxToken targetToken, int position, SyntaxKind kind = SyntaxKind.
None
)
546
if (existingAccessor.Kind() != SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (5)
329
return modifierTokens.Contains(otherModifier) && IsLambdaDeclarationContext(syntaxTree, position, SyntaxKind.
None
, cancellationToken);
425
if (token.IsKind(SyntaxKind.
None
))
1061
previousModifier = SyntaxKind.
None
;
1143
previousModifier == SyntaxKind.
None
)
1984
if (token.IsKind(SyntaxKind.
None
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\StringExtensions.cs (2)
23
var needsEscaping = SyntaxFacts.GetKeywordKind(identifier) != SyntaxKind.
None
;
47
default, SyntaxKind.
None
, "@" + unescaped, unescaped, default);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (3)
59
if (token.Kind() == SyntaxKind.
None
)
82
if (token.Kind() == SyntaxKind.
None
)
163
if (token.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
100
if (token.IsMissing || token.IsKind(SyntaxKind.
None
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (4)
80
if (token.IsKind(SyntaxKind.
None
) ||
90
if (previousToken.Kind() == SyntaxKind.
None
|| previousToken.IsMissing)
110
return token.Kind() is SyntaxKind.
None
or SyntaxKind.EndOfDirectiveToken or SyntaxKind.EndOfFileToken;
142
constructorInitializer.ArgumentList.OpenParenToken.Kind() != SyntaxKind.
None
&&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (1)
77
Contract.ThrowIfTrue(token.Kind() == SyntaxKind.
None
);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (2)
85
if (braces.openBrace.Kind() == SyntaxKind.
None
&&
86
braces.closeBrace.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1609
var isAsync = anonymousFunction.AsyncKeyword.Kind() != SyntaxKind.
None
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (2)
23
if (SyntaxFacts.GetKeywordKind(syntaxToken.ValueText) == SyntaxKind.
None
&& SyntaxFacts.GetContextualKeywordKind(syntaxToken.ValueText) == SyntaxKind.
None
)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (15)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (4)
127
if (startToken.IsMissing || startToken.Kind() == SyntaxKind.
None
)
287
if (token.Kind() == SyntaxKind.
None
)
629
if (syntaxToken.IsMissing || syntaxToken.IsKind(SyntaxKind.
None
))
668
if (token.IsKind(SyntaxKind.
None
))
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (5)
763
return openBrace.IsKind(SyntaxKind.
None
) && closeBrace.IsKind(SyntaxKind.
None
)
908
.WithSemicolonToken(Token(SyntaxKind.
None
));
918
.WithSemicolonToken(Token(SyntaxKind.
None
));
928
.WithSemicolonToken(Token(SyntaxKind.
None
));
CompleteStatement\CompleteStatementCommandHandler.cs (6)
578
if (currentNode.GetParentheses() is ((not SyntaxKind.
None
) openParenthesis, (not SyntaxKind.
None
) closeParenthesis))
582
else if (currentNode.GetBrackets() is ((not SyntaxKind.
None
) openBracket, (not SyntaxKind.
None
) closeBracket))
586
else if (currentNode.GetBraces() is ((not SyntaxKind.
None
) openBrace, (not SyntaxKind.
None
) closeBrace))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (8)
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (8)
42
Assert.NotNull(await Record.ExceptionAsync(() => AutoFormatOnSemicolonAsync(code, expected, SyntaxKind.
None
)));
2016
await AutoFormatOnMarkerAsync(code, expected, SyntaxKind.StringLiteralToken, SyntaxKind.
None
);
2025
await AutoFormatOnMarkerAsync(code, expected, SyntaxKind.CharacterLiteralToken, SyntaxKind.
None
);
2034
await AutoFormatOnMarkerAsync(code, expected, SyntaxKind.CharacterLiteralToken, SyntaxKind.
None
);
2498
SyntaxKind.
None
);
2754
SyntaxKind.
None
);
3418
if (position == endToken.SpanStart && !endToken.GetPreviousToken().IsKind(SyntaxKind.
None
))
3433
Assert.Equal(SyntaxKind.
None
, startTokenKind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\OutVarTests.cs (1)
1336
if (((ArgumentSyntax)reference.Parent).RefOrOutKeyword.Kind() != SyntaxKind.
None
)
Microsoft.CodeAnalysis.CSharp.Features (77)
AddImport\CSharpAddImportFeatureService.cs (1)
404
if (SyntaxFacts.GetKeywordKind(part) != SyntaxKind.
None
)
BraceCompletion\StringLiteralBraceCompletionService.cs (1)
95
while (!token.IsKind(SyntaxKind.
None
) && !token.TrailingTrivia.Contains(t => t.IsEndOfLine()))
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (6)
100
if (firstToken.IsKind(SyntaxKind.
None
))
121
if (firstNonDirectiveToken.IsKind(SyntaxKind.
None
) && firstDirective is null)
176
else if (leadingDirective.SettingToken.IsKind(SyntaxKind.RestoreKeyword) && leadingDirective.TargetToken.IsKind(SyntaxKind.
None
))
220
if (firstToken.IsKind(SyntaxKind.
None
))
245
&& nullableDirective.TargetToken.IsKind(SyntaxKind.
None
))
248
if (firstSemanticToken.IsKind(SyntaxKind.
None
) || firstSemanticToken.SpanStart > nullableDirective.Span.End)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
113
if (argument.RefOrOutKeyword.Kind() != SyntaxKind.
None
)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
45
if (token.Kind() == SyntaxKind.
None
)
Completion\CompletionProviders\ImportCompletion\ExtensionMethodImportCompletionProvider.cs (1)
40
if (token.IsKind(SyntaxKind.
None
) || token.IsMissing)
Completion\CompletionProviders\ImportCompletion\TypeImportCompletionProvider.cs (1)
40
if (token.IsKind(SyntaxKind.
None
) || token.IsMissing)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (2)
135
return !syntaxToken.IsKind(SyntaxKind.
None
)
136
&& !touchingToken.IsKind(SyntaxKind.
None
)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
84
if (attachedToken.Kind() == SyntaxKind.
None
)
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (1)
84
if (token.Kind() == SyntaxKind.
None
)
Completion\KeywordRecommenders\InKeywordRecommender.cs (1)
39
if (previousModifier is SyntaxKind.
None
or SyntaxKind.ScopedKeyword)
Completion\KeywordRecommenders\NamespaceKeywordRecommender.cs (1)
91
if (token.Kind() == SyntaxKind.
None
)
Completion\KeywordRecommenders\OutKeywordRecommender.cs (1)
34
previousModifier is SyntaxKind.
None
or SyntaxKind.ScopedKeyword;
Completion\KeywordRecommenders\RefKeywordRecommender.cs (1)
126
if (previousModifier is SyntaxKind.
None
or SyntaxKind.ScopedKeyword)
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (1)
66
if (previousModifier is SyntaxKind.
None
or
Completion\KeywordRecommenders\UsingKeywordRecommender.cs (2)
96
if (token.Kind() == SyntaxKind.
None
)
139
if (previousToken.Kind() == SyntaxKind.
None
)
Completion\Providers\OutVariableArgumentProvider.cs (3)
44
if (SyntaxFacts.GetKeywordKind(name) != SyntaxKind.
None
45
|| SyntaxFacts.GetContextualKeywordKind(name) != SyntaxKind.
None
)
57
contextualKind: SyntaxKind.
None
,
Debugging\CSharpProximityExpressionsService.cs (1)
58
if (token.Kind() == SyntaxKind.CloseBraceToken && token.GetPreviousToken().Kind() != SyntaxKind.
None
)
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
82
catchClause.Declaration != null && catchClause.Declaration.Identifier.Kind() != SyntaxKind.
None
)
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
88
if (previousToken.Kind() != SyntaxKind.
None
)
EditAndContinue\BreakpointSpans.cs (1)
770
=> token2.IsKind(SyntaxKind.
None
) || token2.IsMissing ? token1 : token2;
EditAndContinue\SyntaxComparer.cs (4)
840
if (leftUsing.GlobalKeyword.IsKind(SyntaxKind.
None
) != rightUsing.GlobalKeyword.IsKind(SyntaxKind.
None
))
844
if (leftUsing.UnsafeKeyword.IsKind(SyntaxKind.
None
) != rightUsing.UnsafeKeyword.IsKind(SyntaxKind.
None
))
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (3)
259
SyntaxKind.OutKeyword : SyntaxKind.
None
;
278
if (kind == SyntaxKind.
None
)
580
var refOrOut = modifier == SyntaxKind.
None
? default : Token(modifier);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
122
if (kind == SyntaxKind.
None
)
ExtractMethod\CSharpSelectionResult.cs (1)
241
return SyntaxKind.
None
;
ExtractMethod\CSharpSelectionValidator.cs (4)
133
if (assign.Right.GetLastToken().Kind() == SyntaxKind.
None
)
193
if (firstTokenInSelection.Kind() == SyntaxKind.
None
|| lastTokenInSelection.Kind() == SyntaxKind.
None
)
474
if (lastToken.Kind() == SyntaxKind.
None
)
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (3)
97
SyntaxFacts.GetTypeDeclarationKind(kind) != SyntaxKind.
None
)
113
SyntaxFacts.GetTypeDeclarationKind(node.Kind()) != SyntaxKind.
None
)
128
if (SyntaxFacts.GetTypeDeclarationKind(node.Kind()) != SyntaxKind.
None
)
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
75
var end = !gotoStatement.CaseOrDefaultKeyword.IsKind(SyntaxKind.
None
)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (4)
261
.TryWithSemicolonToken(Token(SyntaxKind.
None
))
267
.WithSemicolonToken(Token(SyntaxKind.
None
))
273
.WithSemicolonToken(Token(SyntaxKind.
None
))
279
.WithSemicolonToken(Token(SyntaxKind.
None
))
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (2)
221
if (getMethodDeclaration.SemicolonToken.Kind() != SyntaxKind.
None
)
269
if (setMethodDeclaration.SemicolonToken.Kind() != SyntaxKind.
None
)
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (2)
344
_ => SyntaxKind.
None
,
347
if (operatorKind is SyntaxKind.
None
)
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
60
return !token.IsKind(SyntaxKind.
None
) &&
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (3)
286
return !token.IsKind(SyntaxKind.
None
) &&
335
return !token.IsKind(SyntaxKind.
None
) &&
370
return !token.IsKind(SyntaxKind.
None
) &&
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
63
return !token.IsKind(SyntaxKind.
None
) &&
SignatureHelp\InitializerExpressionSignatureHelpProvider.cs (1)
48
=> !token.IsKind(SyntaxKind.
None
) &&
SignatureHelp\SignatureHelpUtilities.cs (1)
135
return !token.IsKind(SyntaxKind.
None
) &&
src\Analyzers\CSharp\Analyzers\AddAccessibilityModifiers\CSharpAddAccessibilityModifiers.cs (1)
33
if (name.Kind() == SyntaxKind.
None
)
src\Analyzers\CSharp\Analyzers\OrderModifiers\CSharpOrderModifiersHelper.cs (1)
22
return (int)(kind == SyntaxKind.
None
? SyntaxFacts.GetContextualKeywordKind(trimmed) : kind);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
122
if (!directive.TargetToken.IsKind(SyntaxKind.
None
))
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
77
if (argument.RefKindKeyword.Kind() != SyntaxKind.
None
)
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\Utilities.cs (1)
29
for (var current = SyntaxKind.
None
; current <= SyntaxKind.ThrowExpression; current++)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
236
if (element.Identifier.IsKind(SyntaxKind.
None
))
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
233
if (mappedBinaryExpressionKind == SyntaxKind.
None
)
Structure\CSharpStructureHelpers.cs (4)
87
if (lastToken.Kind() == SyntaxKind.
None
)
95
if (nextToken.Kind() is not SyntaxKind.
None
and SyntaxKind.SemicolonToken)
237
if (startToken.IsKind(SyntaxKind.
None
) || endToken.IsKind(SyntaxKind.
None
))
Structure\Providers\AnonymousMethodExpressionStructureProvider.cs (1)
30
if (lastToken.Kind() == SyntaxKind.
None
)
Structure\Providers\BlockSyntaxStructureProvider.cs (1)
166
if (previousToken.IsKind(SyntaxKind.
None
))
Structure\Providers\ParenthesizedLambdaExpressionStructureProvider.cs (1)
35
if (lastToken.Kind() == SyntaxKind.
None
)
Structure\Providers\SimpleLambdaExpressionStructureProvider.cs (1)
35
if (lastToken.Kind() == SyntaxKind.
None
)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
DocumentationComments\CrefTests.cs (1)
6706
Assert.Equal(SyntaxKind.
None
, parameter.ReadOnlyKeyword.Kind());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (267)
Diagnostics\LineSpanDirectiveTests.cs (1)
466
Assert.NotEqual(SyntaxKind.
None
, directive.DirectiveNameToken.Kind());
Generated\Syntax.Test.xml.Generated.cs (54)
11151
Assert.Equal(SyntaxKind.
None
, node.Identifier.Kind());
11172
Assert.Equal(SyntaxKind.
None
, node.ReadOnlyKeyword.Kind());
11536
Assert.Equal(SyntaxKind.
None
, node.RefKindKeyword.Kind());
11909
Assert.Equal(SyntaxKind.
None
, node.AscendingOrDescendingKeyword.Kind());
12261
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
12272
Assert.Equal(SyntaxKind.
None
, node.AwaitKeyword.Kind());
12273
Assert.Equal(SyntaxKind.
None
, node.UsingKeyword.Kind());
12390
Assert.Equal(SyntaxKind.
None
, node.CaseOrDefaultKeyword.Kind());
12519
Assert.Equal(SyntaxKind.
None
, node.AwaitKeyword.Kind());
12538
Assert.Equal(SyntaxKind.
None
, node.AwaitKeyword.Kind());
12556
Assert.Equal(SyntaxKind.
None
, node.AwaitKeyword.Kind());
12655
Assert.Equal(SyntaxKind.
None
, node.OpenParenToken.Kind());
12657
Assert.Equal(SyntaxKind.
None
, node.CloseParenToken.Kind());
12773
Assert.Equal(SyntaxKind.
None
, node.Identifier.Kind());
12835
Assert.Equal(SyntaxKind.
None
, node.GlobalKeyword.Kind());
12837
Assert.Equal(SyntaxKind.
None
, node.StaticKeyword.Kind());
12838
Assert.Equal(SyntaxKind.
None
, node.UnsafeKeyword.Kind());
12860
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
12970
Assert.Equal(SyntaxKind.
None
, node.VarianceKeyword.Kind());
12989
Assert.Equal(SyntaxKind.
None
, node.OpenBraceToken.Kind());
12991
Assert.Equal(SyntaxKind.
None
, node.CloseBraceToken.Kind());
12992
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13010
Assert.Equal(SyntaxKind.
None
, node.OpenBraceToken.Kind());
13012
Assert.Equal(SyntaxKind.
None
, node.CloseBraceToken.Kind());
13013
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13031
Assert.Equal(SyntaxKind.
None
, node.OpenBraceToken.Kind());
13033
Assert.Equal(SyntaxKind.
None
, node.CloseBraceToken.Kind());
13034
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13047
Assert.Equal(SyntaxKind.
None
, node.ClassOrStructKeyword.Kind());
13053
Assert.Equal(SyntaxKind.
None
, node.OpenBraceToken.Kind());
13055
Assert.Equal(SyntaxKind.
None
, node.CloseBraceToken.Kind());
13056
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13071
Assert.Equal(SyntaxKind.
None
, node.OpenBraceToken.Kind());
13073
Assert.Equal(SyntaxKind.
None
, node.CloseBraceToken.Kind());
13074
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13173
Assert.Equal(SyntaxKind.
None
, node.QuestionToken.Kind());
13273
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13288
Assert.Equal(SyntaxKind.
None
, node.CheckedKeyword.Kind());
13293
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13308
Assert.Equal(SyntaxKind.
None
, node.CheckedKeyword.Kind());
13313
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13330
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13359
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13377
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13405
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13423
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13450
Assert.Equal(SyntaxKind.
None
, node.SemicolonToken.Kind());
13588
Assert.Equal(SyntaxKind.
None
, node.CheckedKeyword.Kind());
13602
Assert.Equal(SyntaxKind.
None
, node.CheckedKeyword.Kind());
13638
Assert.Equal(SyntaxKind.
None
, node.RefKindKeyword.Kind());
13639
Assert.Equal(SyntaxKind.
None
, node.ReadOnlyKeyword.Kind());
13966
Assert.Equal(SyntaxKind.
None
, node.File.Kind());
13997
Assert.Equal(SyntaxKind.
None
, node.CharacterOffset.Kind());
14087
Assert.Equal(SyntaxKind.
None
, node.TargetToken.Kind());
LexicalAndXml\DocumentationCommentLexerTestBase.cs (2)
115
internal static TokenDescription Token(SyntaxKind kind, string text = null, string valueText = null, SyntaxKind contextualKind = SyntaxKind.
None
)
117
string canonicalText = contextualKind == SyntaxKind.
None
LexicalAndXml\LexicalTests.cs (2)
51
if (result.Kind() == SyntaxKind.
None
)
64
if (result.Kind() == SyntaxKind.
None
)
LexicalAndXml\PreprocessorTests.cs (12)
247
Assert.Equal(SyntaxKind.
None
, ld.File.Kind());
251
Assert.NotEqual(SyntaxKind.
None
, ld.File.Kind());
274
target.Kind() == SyntaxKind.
None
);
309
if (SyntaxKind.
None
== expected.WarningOrChecksumKind)
318
if (SyntaxKind.
None
== expected.DisableOrRestoreKind)
4008
DisableOrRestoreKind = SyntaxKind.
None
,
4024
DisableOrRestoreKind = SyntaxKind.
None
4040
DisableOrRestoreKind = SyntaxKind.
None
4100
WarningOrChecksumKind = SyntaxKind.
None
,
4101
DisableOrRestoreKind = SyntaxKind.
None
4116
WarningOrChecksumKind = SyntaxKind.
None
,
4117
DisableOrRestoreKind = SyntaxKind.
None
LexicalAndXml\SyntaxTokenParserTests.cs (60)
39
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 22), """
44
AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(22, 3), """
49
AssertToken(expectedKind: SyntaxKind.OpenBraceToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(25, 3), """
54
AssertToken(expectedKind: SyntaxKind.CloseBraceToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(28, 3), """
59
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(31, 0), "", parser.ParseNextToken());
60
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(31, 0), "", parser.ParseNextToken());
78
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 54), """
89
AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(54, 3), """
94
AssertToken(expectedKind: SyntaxKind.OpenBraceToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(57, 3), """
99
AssertToken(expectedKind: SyntaxKind.CloseBraceToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(60, 3), """
104
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(63, 0), "", parser.ParseNextToken());
121
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 16), """
126
AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(16, 3), """
131
AssertToken(expectedKind: SyntaxKind.OpenBraceToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(19, 3), """
136
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(22, 18), """
143
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(40, 0), "", parser.ParseNextToken());
162
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(18, 22), """
169
AssertToken(expectedKind: SyntaxKind.OpenBraceToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(43, 3), """
174
AssertToken(expectedKind: SyntaxKind.CloseBraceToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(46, 3), """
187
AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(1, 4), """lass""", parser.ParseNextToken());
196
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(100, 0), "", parser.ParseNextToken());
205
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 6), "class ", parser.ParseNextToken());
223
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 16), """
229
AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(16, 3), """
244
AssertToken(expectedKind: SyntaxKind.OpenBraceToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(19, 3), """
249
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(22, 18), """
265
AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.
None
, new TextSpan(5, 11), "identifier ", parser.ParseNextToken());
266
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(16, 5), "class", parser.ParseNextToken());
276
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 0), "", result);
281
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 0), "", result);
285
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 6), "class ", parser.ParseNextToken());
295
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 11), "/* test */ ", result);
302
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(11, 0), "", intermediateResult);
307
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(11, 0), "", intermediateResult);
311
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(11, 6), "class ", parser.ParseNextToken());
314
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 17), "/* test */ class ", parser.ParseNextToken());
328
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 14), $"/* test */\r\n\r\n", result);
336
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(14, 0), "", intermediateResult);
341
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(14, 0), "", intermediateResult);
345
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(14, 6), "class ", parser.ParseNextToken());
348
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 20), "/* test */\r\n\r\nclass ", parser.ParseNextToken());
358
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 0), "", result);
362
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 6), "class ", parser.ParseNextToken());
372
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 11), "/* test */ ", result);
378
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(11, 6), "class ", parser.ParseNextToken());
381
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 17), "/* test */ class ", parser.ParseNextToken());
395
AssertToken(expectedKind: SyntaxKind.
None
, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 12), $"/* test */\r\n", result);
401
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(12, 8), "\r\nclass ", parser.ParseNextToken());
404
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.
None
, new TextSpan(0, 20), "/* test */\r\n\r\nclass ", parser.ParseNextToken());
Parsing\DeclarationParsingTests.cs (66)
1639
Assert.Equal(SyntaxKind.
None
, gn.Parameters[0].VarianceKeyword.Kind());
2513
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
2514
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
2515
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
2558
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
2559
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
2560
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
2604
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
2605
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
2606
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
2712
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
2713
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
2714
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
2777
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
2778
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
2779
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
2824
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
2825
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
2826
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
2874
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
2875
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
2876
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
2915
Assert.NotEqual(SyntaxKind.
None
, propertySyntax.ExpressionBody.ArrowToken.Kind());
3028
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
3029
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
3030
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
3090
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
3091
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
3092
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
3145
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
3146
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
3147
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
3208
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
3209
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
3210
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
3274
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
3275
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
3276
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
3345
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
3346
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
3347
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
3391
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
3392
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
3393
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
3451
Assert.NotEqual(SyntaxKind.
None
, ms.Body.OpenBraceToken.Kind());
3452
Assert.NotEqual(SyntaxKind.
None
, ms.Body.CloseBraceToken.Kind());
3453
Assert.Equal(SyntaxKind.
None
, ms.SemicolonToken.Kind());
3498
Assert.NotEqual(SyntaxKind.
None
, cs.OpenBraceToken.Kind());
3499
Assert.NotEqual(SyntaxKind.
None
, cs.CloseBraceToken.Kind());
3500
Assert.Equal(SyntaxKind.
None
, cs.SemicolonToken.Kind());
3533
Assert.NotEqual(SyntaxKind.
None
, cs.OpenBraceToken.Kind());
3534
Assert.NotEqual(SyntaxKind.
None
, cs.CloseBraceToken.Kind());
3535
Assert.Equal(SyntaxKind.
None
, cs.SemicolonToken.Kind());
3580
Assert.NotEqual(SyntaxKind.
None
, cs.OpenBraceToken.Kind());
3581
Assert.NotEqual(SyntaxKind.
None
, cs.CloseBraceToken.Kind());
3582
Assert.Equal(SyntaxKind.
None
, cs.SemicolonToken.Kind());
4383
Assert.Equal(SyntaxKind.
None
, ps.AccessorList.Accessors[0].SemicolonToken.Kind());
4390
Assert.Equal(SyntaxKind.
None
, ps.AccessorList.Accessors[1].SemicolonToken.Kind());
4521
Assert.Equal(SyntaxKind.
None
, ps.AccessorList.Accessors[0].SemicolonToken.Kind());
4577
Assert.Equal(SyntaxKind.
None
, es.AccessorList.Accessors[0].SemicolonToken.Kind());
4774
Assert.Equal(SyntaxKind.
None
, es.AccessorList.Accessors[0].SemicolonToken.Kind());
4781
Assert.Equal(SyntaxKind.
None
, es.AccessorList.Accessors[1].SemicolonToken.Kind());
4829
Assert.Equal(SyntaxKind.
None
, es.AccessorList.Accessors[0].SemicolonToken.Kind());
4836
Assert.Equal(SyntaxKind.
None
, es.AccessorList.Accessors[1].SemicolonToken.Kind());
4913
Assert.Equal(SyntaxKind.
None
, es.AccessorList.Accessors[0].SemicolonToken.Kind());
4920
Assert.Equal(SyntaxKind.
None
, es.AccessorList.Accessors[1].SemicolonToken.Kind());
Parsing\ExpressionParsingTests.cs (3)
2567
Assert.Equal(SyntaxKind.
None
, os.AscendingOrDescendingKeyword.Kind());
2611
Assert.Equal(SyntaxKind.
None
, os.AscendingOrDescendingKeyword.Kind());
2616
Assert.Equal(SyntaxKind.
None
, os.AscendingOrDescendingKeyword.Kind());
Parsing\ParsingErrorRecoveryTests.cs (42)
4589
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4614
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.Kind());
4642
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4669
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4697
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4724
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4752
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4781
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4810
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4840
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4869
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4897
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4924
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4951
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
4978
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5006
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5033
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5061
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5087
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5117
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5146
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5176
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5829
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5869
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5898
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5927
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5957
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
5986
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6019
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6046
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6073
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6100
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6128
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6155
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6185
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6216
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6244
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6292
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6326
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6358
Assert.NotEqual(SyntaxKind.
None
, ds.Declaration.Variables[0].Initializer.EqualsToken.Kind());
6509
Assert.Equal(SyntaxKind.
None
, acc.SemicolonToken.Kind());
6548
Assert.Equal(SyntaxKind.
None
, acc.SemicolonToken.Kind());
Parsing\StatementParsingTests.cs (3)
259
Assert.Equal(SyntaxKind.
None
, tt.Elements[1].Identifier.Kind());
1039
Assert.Equal(SyntaxKind.
None
, gs.CaseOrDefaultKeyword.Kind());
1274
Assert.Equal(SyntaxKind.
None
, ts.Catches[0].Declaration.Identifier.Kind());
Syntax\SyntaxAnnotationTests.cs (8)
693
if (!token.IsKind(SyntaxKind.
None
))
703
if (!trivia.IsKind(SyntaxKind.
None
))
734
if (token.IsKind(SyntaxKind.
None
))
744
if (trivia.IsKind(SyntaxKind.
None
))
783
if (token.Kind() == SyntaxKind.
None
)
794
if (trivia.IsKind(SyntaxKind.
None
))
834
if (token.IsKind(SyntaxKind.
None
))
844
if (trivia.IsKind(SyntaxKind.
None
))
Syntax\SyntaxFactoryTests.cs (2)
75
Assert.Equal(SyntaxKind.
None
, n.SemicolonToken.Kind());
95
Assert.Equal(SyntaxKind.
None
, c.SemicolonToken.Kind());
Syntax\SyntaxNodeTests.cs (12)
768
Assert.Equal(SyntaxKind.
None
, trivia.Kind());
986
while (token.Kind() != SyntaxKind.
None
)
1016
while (token.Kind() != SyntaxKind.
None
)
1041
while (token.Kind() != SyntaxKind.
None
)
1085
while (token.Kind() != SyntaxKind.
None
)
1116
while (token.Kind() != SyntaxKind.
None
)
1145
while (token.Kind() != SyntaxKind.
None
)
1192
while (token.Kind() != SyntaxKind.
None
)
1234
while (token.Kind() != SyntaxKind.
None
)
1279
for (var child = children[0]; child.Kind() != SyntaxKind.
None
; child = child.GetNextSibling())
1298
for (var child = children[children.Count - 1]; child.Kind() != SyntaxKind.
None
; child = child.GetPreviousSibling())
1347
Assert.NotEqual(SyntaxKind.
None
, parentTrivia.Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (96)
Classification\ClassificationHelpers.cs (1)
543
|| (wasKeyword && SyntaxFacts.GetContextualKeywordKind(text) != SyntaxKind.
None
)
Classification\Worker_Preprocesser.cs (1)
265
if (token.Kind() != SyntaxKind.
None
)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
308
if (operatorKind == SyntaxKind.
None
)
Formatting\CSharpSyntaxFormattingService.cs (2)
56
token.Kind() is SyntaxKind.EndOfFileToken or SyntaxKind.
None
||
311
is SyntaxKind.
None
Rename\CSharpRenameRewriterLanguageService.cs (2)
602
if (kind != SyntaxKind.
None
)
1124
if (kind != SyntaxKind.
None
)
Simplification\CSharpSimplificationService.cs (2)
103
if (SyntaxFacts.GetKeywordKind(syntaxToken.ValueText) == SyntaxKind.
None
&& SyntaxFacts.GetContextualKeywordKind(syntaxToken.ValueText) == SyntaxKind.
None
)
Simplification\CSharpSimplificationService.Expander.cs (1)
275
node.RefOrOutKeyword.Kind() == SyntaxKind.
None
)
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (1)
106
if (_simplifyAllDescendants && !_insideSpeculatedNode && !token.IsKind(SyntaxKind.
None
))
Simplification\Reducers\CSharpEscapingReducer.cs (1)
43
if (SyntaxFacts.GetKeywordKind(unescapedIdentifier) != SyntaxKind.
None
&& enclosingXmlNameAttr == null)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
57
_ => SyntaxKind.
None
,
60
if (kind != SyntaxKind.
None
)
Simplification\Simplifiers\NameSimplifier.cs (1)
506
if (SyntaxFacts.GetKeywordKind(newAttributeName) != SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
84
return firstToken.Kind() != SyntaxKind.
None
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SymbolDisplayPartExtensions.cs (1)
21
if (SyntaxFacts.GetKeywordKind(text) != SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxKindExtensions.cs (1)
74
return SyntaxKind.
None
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
73
if (prevToken.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (5)
70
SyntaxFacts.GetContextualKeywordKind(simpleNameText) != SyntaxKind.
None
;
79
modifierKind = SyntaxKind.
None
;
119
return modifierKind != SyntaxKind.
None
;
163
if (previousToken.Kind() == SyntaxKind.
None
)
271
if (next.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
107
if (token.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (3)
70
if (trivia2.IsKind(SyntaxKind.
None
))
98
var lines = (trivia1.IsKind(SyntaxKind.
None
) && this.Token1.IsKind(SyntaxKind.
None
)) ? 0 : 1;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (1)
66
for (var currentToken = token1; !currentToken.IsKind(SyntaxKind.
None
);)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.ComplexTrivia.cs (2)
55
var formatSpanEnd = commonToken2.Kind() == SyntaxKind.
None
? commonToken1.Span.End : commonToken2.Span.Start;
83
var firstTriviaInTree = this.Token1.Kind() == SyntaxKind.
None
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (2)
56
if (bracketOrBracePair.openBracketOrBrace.IsKind(SyntaxKind.
None
) ||
58
bracketOrBracePair.closeBracketOrBrace.IsKind(SyntaxKind.
None
))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (14)
24
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
39
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
63
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
77
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
92
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
128
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
138
if (anchorToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (2)
310
if (currentToken.Kind() == SyntaxKind.
None
)
317
case SyntaxKind.
None
:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
334
Debug.Assert(!startToken.IsKind(SyntaxKind.
None
) && !endToken.IsKind(SyntaxKind.
None
));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (6)
95
if (!firstToken.IsKind(SyntaxKind.
None
) || !lastToken.IsKind(SyntaxKind.
None
))
125
if (!tokens.firstToken.IsKind(SyntaxKind.
None
) || !tokens.lastToken.IsKind(SyntaxKind.
None
))
183
if (startToken.Kind() == SyntaxKind.
None
|| endToken.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (4)
49
Contract.ThrowIfTrue(startToken.Kind() is SyntaxKind.
None
or SyntaxKind.EndOfFileToken);
50
Contract.ThrowIfTrue(endToken.Kind() is SyntaxKind.
None
or SyntaxKind.EndOfFileToken);
80
Contract.ThrowIfTrue(token.Kind() is SyntaxKind.
None
or SyntaxKind.EndOfFileToken);
84
if (previousToken.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (2)
324
if (ordering.AscendingOrDescendingKeyword.Kind() == SyntaxKind.
None
)
328
else if (orderByClauseSyntax.Orderings[0].AscendingOrDescendingKeyword.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
89
var needsEscaping = SyntaxFacts.GetKeywordKind(identifier) != SyntaxKind.
None
;
607
argument.RefOrOutKeyword.Kind() == SyntaxKind.
None
&&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (4)
22
Contract.ThrowIfTrue(endToken.Kind() == SyntaxKind.
None
);
43
if (closeBrace.Kind() == SyntaxKind.
None
|| !AreTwoTokensOnSameLine(previousToken, closeBrace))
289
return previousToken.Kind() == SyntaxKind.
None
? token : previousToken;
311
if (previousToken.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\OperatorGenerator.cs (1)
82
if (operatorSyntaxKind == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (2)
143
Debug.Assert(!endOfLine.IsKind(SyntaxKind.
None
));
144
if (!endOfLine.IsKind(SyntaxKind.
None
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (3)
519
public static bool IsAnyAccessorDeclarationContext(this SyntaxToken targetToken, int position, SyntaxKind kind = SyntaxKind.
None
)
526
public static bool IsAccessorDeclarationContext<TMemberNode>(this SyntaxToken targetToken, int position, SyntaxKind kind = SyntaxKind.
None
)
546
if (existingAccessor.Kind() != SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (5)
329
return modifierTokens.Contains(otherModifier) && IsLambdaDeclarationContext(syntaxTree, position, SyntaxKind.
None
, cancellationToken);
425
if (token.IsKind(SyntaxKind.
None
))
1061
previousModifier = SyntaxKind.
None
;
1143
previousModifier == SyntaxKind.
None
)
1984
if (token.IsKind(SyntaxKind.
None
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\StringExtensions.cs (2)
23
var needsEscaping = SyntaxFacts.GetKeywordKind(identifier) != SyntaxKind.
None
;
47
default, SyntaxKind.
None
, "@" + unescaped, unescaped, default);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (3)
59
if (token.Kind() == SyntaxKind.
None
)
82
if (token.Kind() == SyntaxKind.
None
)
163
if (token.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
100
if (token.IsMissing || token.IsKind(SyntaxKind.
None
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (4)
80
if (token.IsKind(SyntaxKind.
None
) ||
90
if (previousToken.Kind() == SyntaxKind.
None
|| previousToken.IsMissing)
110
return token.Kind() is SyntaxKind.
None
or SyntaxKind.EndOfDirectiveToken or SyntaxKind.EndOfFileToken;
142
constructorInitializer.ArgumentList.OpenParenToken.Kind() != SyntaxKind.
None
&&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (1)
77
Contract.ThrowIfTrue(token.Kind() == SyntaxKind.
None
);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (2)
85
if (braces.openBrace.Kind() == SyntaxKind.
None
&&
86
braces.closeBrace.Kind() == SyntaxKind.
None
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1609
var isAsync = anonymousFunction.AsyncKeyword.Kind() != SyntaxKind.
None
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (2)
23
if (SyntaxFacts.GetKeywordKind(syntaxToken.ValueText) == SyntaxKind.
None
&& SyntaxFacts.GetContextualKeywordKind(syntaxToken.ValueText) == SyntaxKind.
None
)
Microsoft.CodeAnalysis.UnitTests (4)
CommonSyntaxTests.cs (4)
26
if (kind != CS.SyntaxKind.
None
&& kind != CS.SyntaxKind.List)
198
Assert.Equal(CSharp.SyntaxKind.
None
, CSharp.CSharpExtensions.Kind(node));
200
Assert.Equal(CSharp.SyntaxKind.
None
, CSharp.CSharpExtensions.Kind(token));
202
Assert.Equal(CSharp.SyntaxKind.
None
, CSharp.CSharpExtensions.Kind(trivia));
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.NodeLocator.cs (1)
166
if (significantTrivia.Kind() != SyntaxKind.
None
)
System.Text.Json.SourceGeneration (2)
Helpers\RoslynExtensions.cs (2)
227
=> SyntaxFacts.GetKeywordKind(symbol.Name) != SyntaxKind.
None
|| SyntaxFacts.GetContextualKeywordKind(symbol.Name) != SyntaxKind.
None
;