125 references to NewKeyword
Microsoft.CodeAnalysis.CSharp (51)
_generated\0\Syntax.xml.Main.Generated.cs (16)
3302if (newKeyword.Kind() != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 3309=> SyntaxFactory.ImplicitObjectCreationExpression(SyntaxFactory.Token(SyntaxKind.NewKeyword), argumentList, initializer); 3313=> SyntaxFactory.ImplicitObjectCreationExpression(SyntaxFactory.Token(SyntaxKind.NewKeyword), SyntaxFactory.ArgumentList(), default); 3318if (newKeyword.Kind() != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 3325=> SyntaxFactory.ObjectCreationExpression(SyntaxFactory.Token(SyntaxKind.NewKeyword), type, argumentList, initializer); 3329=> SyntaxFactory.ObjectCreationExpression(SyntaxFactory.Token(SyntaxKind.NewKeyword), type, default, default); 3358if (newKeyword.Kind() != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 3366=> SyntaxFactory.AnonymousObjectCreationExpression(SyntaxFactory.Token(SyntaxKind.NewKeyword), SyntaxFactory.Token(SyntaxKind.OpenBraceToken), initializers, SyntaxFactory.Token(SyntaxKind.CloseBraceToken)); 3371if (newKeyword.Kind() != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 3378=> SyntaxFactory.ArrayCreationExpression(SyntaxFactory.Token(SyntaxKind.NewKeyword), type, initializer); 3382=> SyntaxFactory.ArrayCreationExpression(SyntaxFactory.Token(SyntaxKind.NewKeyword), type, default); 3387if (newKeyword.Kind() != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 3396=> SyntaxFactory.ImplicitArrayCreationExpression(SyntaxFactory.Token(SyntaxKind.NewKeyword), SyntaxFactory.Token(SyntaxKind.OpenBracketToken), commas, SyntaxFactory.Token(SyntaxKind.CloseBracketToken), initializer); 3400=> SyntaxFactory.ImplicitArrayCreationExpression(SyntaxFactory.Token(SyntaxKind.NewKeyword), SyntaxFactory.Token(SyntaxKind.OpenBracketToken), default(SyntaxTokenList), SyntaxFactory.Token(SyntaxKind.CloseBracketToken), initializer); 5320if (newKeyword.Kind() != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 5328=> SyntaxFactory.ConstructorConstraint(SyntaxFactory.Token(SyntaxKind.NewKeyword), SyntaxFactory.Token(SyntaxKind.OpenParenToken), SyntaxFactory.Token(SyntaxKind.CloseParenToken));
_generated\1\Syntax.xml.Internal.Generated.cs (12)
29928if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 29949if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 30001if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 30015if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 30036if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 32411if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 35355if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 35376if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 35428if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 35442if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 35463if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword)); 37838if (newKeyword.Kind != SyntaxKind.NewKeyword) throw new ArgumentException(nameof(newKeyword));
Parser\LanguageParser.cs (16)
348case SyntaxKind.NewKeyword: 1324case SyntaxKind.NewKeyword: 2333case SyntaxKind.NewKeyword: 2350SyntaxKind.NewKeyword => 2449case SyntaxKind.NewKeyword: 2672case SyntaxKind.NewKeyword: 8968Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NewKeyword); 11161case SyntaxKind.NewKeyword: 11435case SyntaxKind.NewKeyword: 12096case SyntaxKind.NewKeyword: 13272Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NewKeyword); 13345return this.CurrentToken.Kind == SyntaxKind.NewKeyword && this.PeekToken(1).Kind == SyntaxKind.OpenBraceToken; 13351var @new = this.EatToken(SyntaxKind.NewKeyword); 13410SyntaxToken @new = this.EatToken(SyntaxKind.NewKeyword); 13640Debug.Assert(this.CurrentToken.Kind is SyntaxKind.NewKeyword or SyntaxKind.StackAllocKeyword); 13646var @new = this.EatToken(SyntaxKind.NewKeyword);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (1)
974AddKeyword(SyntaxKind.NewKeyword);
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
56return SyntaxFacts.IsInNamespaceOrTypeContext(startNode as ExpressionSyntax) || token.IsKind(SyntaxKind.NewKeyword) || this.InNamespaceOrType;
Symbols\Source\ModifierUtils.cs (2)
319return SyntaxFacts.GetText(SyntaxKind.NewKeyword); 381case SyntaxKind.NewKeyword:
Syntax\SyntaxKindFacts.cs (2)
983return SyntaxKind.NewKeyword; 1684case SyntaxKind.NewKeyword:
Syntax\SyntaxNormalizer.cs (1)
995case SyntaxKind.NewKeyword:
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
65public static readonly SyntaxToken NewKeyword = Token(SyntaxKind.NewKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
166SyntaxKind.NewKeyword,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
94case SyntaxKind.NewKeyword:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
364if (previousToken.Kind() == SyntaxKind.NewKeyword)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
126SyntaxKind.NewKeyword => Modifiers.New,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
73public int NewKeyword => (int)SyntaxKind.NewKeyword;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1938if (token.IsKind(SyntaxKind.NewKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
431if (previousToken.Kind() == SyntaxKind.NewKeyword &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
19SyntaxKind.NewKeyword, 36SyntaxKind.NewKeyword, 54SyntaxKind.NewKeyword,
Microsoft.CodeAnalysis.CSharp.Features (37)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
109if (token.IsKind(SyntaxKind.NewKeyword) && token.Parent.IsKind(SyntaxKind.ObjectCreationExpression))
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
646case SyntaxKind.NewKeyword:
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
51if (newToken.Kind() == SyntaxKind.NewKeyword)
Completion\KeywordRecommenders\AbstractKeywordRecommender.cs (3)
18SyntaxKind.NewKeyword, 29SyntaxKind.NewKeyword, 40SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\ClassKeywordRecommender.cs (1)
16SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\ConstKeywordRecommender.cs (2)
16SyntaxKind.NewKeyword, 25SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\EventKeywordRecommender.cs (1)
17SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (2)
18SyntaxKind.NewKeyword, 32SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\FixedKeywordRecommender.cs (1)
16SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\NewKeywordRecommender.cs (1)
15internal sealed class NewKeywordRecommender() : AbstractSyntacticSingleKeywordRecommender(SyntaxKind.NewKeyword)
Completion\KeywordRecommenders\ReadOnlyKeywordRecommender.cs (1)
18SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\RecordKeywordRecommender.cs (1)
16SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\RefKeywordRecommender.cs (3)
27SyntaxKind.NewKeyword, 48SyntaxKind.NewKeyword, 66SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\SealedKeywordRecommender.cs (3)
18SyntaxKind.NewKeyword, 29SyntaxKind.NewKeyword, 40SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\StaticKeywordRecommender.cs (4)
18SyntaxKind.NewKeyword, 31SyntaxKind.NewKeyword, 46SyntaxKind.NewKeyword, 61SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (3)
18SyntaxKind.NewKeyword, 33SyntaxKind.NewKeyword, 49SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\VirtualKeywordRecommender.cs (2)
18SyntaxKind.NewKeyword, 29SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (1)
17SyntaxKind.NewKeyword,
Completion\KeywordRecommenders\VolatileKeywordRecommender.cs (1)
17SyntaxKind.NewKeyword,
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
191=> field.DeclaringSyntaxReferences.Any(static d => d.GetSyntax().GetAncestor<FieldDeclarationSyntax>().Modifiers.Any(SyntaxKind.NewKeyword));
LanguageServices\CSharpStructuralTypeDisplayService.cs (1)
37members.Add(Keyword(SyntaxFacts.GetText(SyntaxKind.NewKeyword)));
SignatureHelp\AbstractGenericNameSignatureHelpProvider.cs (1)
257parts.Add(Keyword(SyntaxKind.NewKeyword));
Snippets\CSharpClassSnippetProvider.cs (1)
23SyntaxKind.NewKeyword,
Microsoft.CodeAnalysis.CSharp.Workspaces (11)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
65public static readonly SyntaxToken NewKeyword = Token(SyntaxKind.NewKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
166SyntaxKind.NewKeyword,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
94case SyntaxKind.NewKeyword:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
364if (previousToken.Kind() == SyntaxKind.NewKeyword)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
126SyntaxKind.NewKeyword => Modifiers.New,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
73public int NewKeyword => (int)SyntaxKind.NewKeyword;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1938if (token.IsKind(SyntaxKind.NewKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
431if (previousToken.Kind() == SyntaxKind.NewKeyword &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
19SyntaxKind.NewKeyword, 36SyntaxKind.NewKeyword, 54SyntaxKind.NewKeyword,
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\Legacy\NativeCSharpTokenizer.cs (1)
36CSharpSyntaxKind.NewKeyword,
Microsoft.Gen.Logging (1)
Parsing\Parser.LogProperties.cs (1)
241if (ParserUtilities.PropertyHasModifier(property, SyntaxKind.NewKeyword, _cancellationToken))
Microsoft.Interop.ComInterfaceGenerator (2)
ComInterfaceGenerator.cs (1)
366new SyntaxTokenList(syntax.Modifiers.Where(static m => !m.IsKind(SyntaxKind.NewKeyword) && !m.IsKind(SyntaxKind.PartialKeyword) && !m.IsKind(SyntaxKind.VirtualKeyword))).StripAccessibilityModifiers(),
ComMethodInfo.cs (1)
151bool shadowsBaseMethod = comMethodDeclaringSyntax.Modifiers.Any(SyntaxKind.NewKeyword);
Roslyn.Diagnostics.CSharp.Analyzers (11)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
65public static readonly SyntaxToken NewKeyword = Token(SyntaxKind.NewKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
166SyntaxKind.NewKeyword,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
94case SyntaxKind.NewKeyword:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
364if (previousToken.Kind() == SyntaxKind.NewKeyword)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
126SyntaxKind.NewKeyword => Modifiers.New,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
73public int NewKeyword => (int)SyntaxKind.NewKeyword;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1938if (token.IsKind(SyntaxKind.NewKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
431if (previousToken.Kind() == SyntaxKind.NewKeyword &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
19SyntaxKind.NewKeyword, 36SyntaxKind.NewKeyword, 54SyntaxKind.NewKeyword,