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