85 references to Add
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
212
modifiers = modifiers.
Add
(anonymousFunction.AsyncKeyword);
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
212
modifiers = modifiers.
Add
(anonymousFunction.AsyncKeyword);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (3)
Syntax\SyntaxNodeTests.cs (1)
3466
var newModifiers = method.Modifiers.
Add
(SyntaxFactory.Token(default(SyntaxTriviaList), SyntaxKind.UnsafeKeyword, SyntaxFactory.TriviaList(SyntaxFactory.Space)));
Syntax\SyntaxTokenListTests.cs (2)
208
var newList = list.
Add
(tokenD);
235
Assert.Throws<ArgumentOutOfRangeException>(() => list.
Add
(default(SyntaxToken)));
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
201
modifiers = modifiers.
Add
(ParamsKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (2)
85
list = list.
Add
(ThisKeyword);
90
list = list.
Add
(ParamsKeyword);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (32)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (3)
122
newFunctionNode = newFunctionNode.WithModifiers(methodStatementNode.Modifiers.
Add
(iteratorToken))
124
newFunctionNode = methodStatementNode.WithModifiers(methodStatementNode.Modifiers.
Add
(iteratorToken))
134
Dim newHeader = lambdaNode.SubOrFunctionHeader.WithModifiers(lambdaNode.SubOrFunctionHeader.Modifiers.
Add
(iteratorToken))
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (3)
116
subStatement.Modifiers.
Add
(s_asyncToken),
139
Dim newModifiers = modifiers.
Add
(s_asyncToken)
155
Dim newModifiers = header.Modifiers.
Add
(s_asyncToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
81
modifiers = modifiers.
Add
(SyntaxFactory.Token(SyntaxKind.ByRefKeyword))
85
modifiers = modifiers.
Add
(SyntaxFactory.Token(SyntaxKind.OptionalKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (24)
370
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.PartialKeyword))
374
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.DefaultKeyword))
379
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.FriendKeyword))
381
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.PublicKeyword))
383
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.PrivateKeyword))
385
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword))
387
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.FriendKeyword)).
Add
(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword))
389
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.PrivateKeyword)).
Add
(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword))
398
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.MustInheritKeyword))
400
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.MustOverrideKeyword))
405
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.ShadowsKeyword))
410
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.NotInheritableKeyword))
412
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.NotOverridableKeyword))
417
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.OverridesKeyword))
421
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.OverridableKeyword))
425
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.SharedKeyword))
429
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.AsyncKeyword))
433
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.ConstKeyword))
437
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword))
441
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.WriteOnlyKeyword))
450
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.WithEventsKeyword))
454
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.DimKeyword))
Microsoft.CodeAnalysis.VisualBasic.Features (7)
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (1)
82
Dim modifiers = getMethodStatement.Modifiers.
Add
(SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword))
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (3)
122
newFunctionNode = newFunctionNode.WithModifiers(methodStatementNode.Modifiers.
Add
(iteratorToken))
124
newFunctionNode = methodStatementNode.WithModifiers(methodStatementNode.Modifiers.
Add
(iteratorToken))
134
Dim newHeader = lambdaNode.SubOrFunctionHeader.WithModifiers(lambdaNode.SubOrFunctionHeader.Modifiers.
Add
(iteratorToken))
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (3)
116
subStatement.Modifiers.
Add
(s_asyncToken),
139
Dim newModifiers = modifiers.
Add
(s_asyncToken)
155
Dim newModifiers = header.Modifiers.
Add
(s_asyncToken)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (31)
CodeGeneration\VisualBasicSyntaxGenerator.vb (5)
736
modifierList = modifierList.
Add
(SyntaxFactory.Token(
826
modifiers = modifiers.
Add
(SyntaxFactory.Token(SyntaxKind.ParamArrayKeyword))
842
tokens = tokens.
Add
(SyntaxFactory.Token(SyntaxKind.OptionalKeyword))
846
tokens = tokens.
Add
(SyntaxFactory.Token(SyntaxKind.ByRefKeyword))
2545
newTokens = newTokens.
Add
(SyntaxFactory.Token(SyntaxKind.DimKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
81
modifiers = modifiers.
Add
(SyntaxFactory.Token(SyntaxKind.ByRefKeyword))
85
modifiers = modifiers.
Add
(SyntaxFactory.Token(SyntaxKind.OptionalKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (24)
370
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.PartialKeyword))
374
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.DefaultKeyword))
379
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.FriendKeyword))
381
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.PublicKeyword))
383
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.PrivateKeyword))
385
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword))
387
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.FriendKeyword)).
Add
(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword))
389
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.PrivateKeyword)).
Add
(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword))
398
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.MustInheritKeyword))
400
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.MustOverrideKeyword))
405
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.ShadowsKeyword))
410
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.NotInheritableKeyword))
412
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.NotOverridableKeyword))
417
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.OverridesKeyword))
421
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.OverridableKeyword))
425
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.SharedKeyword))
429
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.AsyncKeyword))
433
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.ConstKeyword))
437
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword))
441
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.WriteOnlyKeyword))
450
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.WithEventsKeyword))
454
_list = _list.
Add
(SyntaxFactory.Token(SyntaxKind.DimKeyword))
Microsoft.Interop.SourceGeneration (7)
Marshalling\MarshallerHelpers.cs (7)
419
tokens = tokens.
Add
(Token(SyntaxKind.ScopedKeyword));
427
tokens = tokens.
Add
(Token(SyntaxKind.InKeyword));
430
tokens = tokens.
Add
(Token(SyntaxKind.RefKeyword));
434
tokens = tokens.
Add
(Token(SyntaxKind.OutKeyword));
437
tokens = tokens.
Add
(Token(SyntaxKind.RefKeyword));
438
tokens = tokens.
Add
(Token(SyntaxKind.ReadOnlyKeyword));
447
tokens = tokens.
Add
(Token(SyntaxKind.ThisKeyword));