199 references to Add
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
StringCopyPaste\StringInfo.cs (2)
209result.Add(TextSpan.FromBounds(currentPosition, content.SpanStart)); 215result.Add(TextSpan.FromBounds(currentPosition, end));
StringCopyPaste\UnknownSourcePasteProcessor.cs (1)
94textChanges.Add(new TextChange(
Microsoft.CodeAnalysis.CSharp.Features (49)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.NameGenerator.cs (5)
54result.Add(GetWords(0, breakCount, breaks, baseName, pluralize)); 59result.Add(GetLongestForwardSubsequence(length, breaks, baseName, pluralize)); 62result.Add(GetLongestBackwardSubsequence(length, breaks, baseName, pluralize)); 89result.Add(text.Pluralize()); 93result.Add(text);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (22)
1121result.Add((oldSynthesizedAutoProperty, newSynthesizedAutoProperty, editKind)); 1122result.Add((oldSynthesizedAutoProperty?.GetMethod, newSynthesizedAutoProperty?.GetMethod, editKind)); 1123result.Add((oldSynthesizedAutoProperty?.SetMethod, newSynthesizedAutoProperty?.SetMethod, editKind)); 1146result.Add((oldSymbol, newSymbol, isTypeConstraint ? EditKind.Update : editKind)); 1160result.Add((oldSymbol, newSymbol, EditKind.Update)); 1166result.Add((oldSymbol, newSymbol, EditKind.Reorder)); 1195result.Add((oldPropertySymbol, newPropertySymbol, editKind)); 1204result.Add((oldPropertySymbol.GetMethod, newPropertySymbol.GetMethod, editKind)); 1213result.Add((oldPropertySymbol.SetMethod, newPropertySymbol.SetMethod, editKind)); 1226result.Add((oldEventSymbol, newEventSymbol, editKind)); 1233result.Add((oldEventSymbol.AddMethod, newEventSymbol.AddMethod, editKind)); 1242result.Add((oldEventSymbol.RemoveMethod, newEventSymbol.RemoveMethod, editKind)); 1265result.Add((oldSymbol, newSymbol, EditKind.Update)); 1281result.Add((oldPrimaryConstructor, newPrimaryConstructor, EditKind.Update)); 1291result.Add((oldCopyConstructor, newCopyConstructor, EditKind.Update)); 1323result.Add((oldSymbol, newSymbol, editKind)); 1324result.Add((oldGetterSymbol, newGetterSymbol, editKind)); 1331result.Add((oldSymbol, newSymbol, EditKind.Update)); 1338result.Add((oldSymbol, newSymbol, EditKind.Update)); 1346result.Add((oldSymbol, newSymbol, EditKind.Update)); 1365result.Add((oldSymbol, newSymbol, editKind)); 1374result.Add((oldSymbol, newSymbol, editKind));
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (3)
106nestedActions.Add(codeAction); 111nestedActions.Add(CodeAction.Create( 119nestedActions.Add(CodeAction.Create(
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
206result.Add(parameter);
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (3)
75result.Add(generator.FieldDeclaration(propertyBackingField, initializer)); 81result.Add(GetGetMethod( 92result.Add(GetSetMethod(
SignatureHelp\LightweightOverloadResolution.cs (2)
71argumentToParameterMap.Add(-1); 152specified.Add(false);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
129diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation())); 161diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation()));
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
121fieldsArray.Add((field, variableDeclarator, currentOption!));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (3)
123result.Add(new(spreadElement.Expression, UseSpread: true)); 127result.Add(new(expressionElement.Expression, UseSpread: false)); 133result.Add(new(argument.Expression, match.UseSpread));
StringIndentation\CSharpStringIndentationService.cs (2)
90result.Add(new StringIndentationRegion(indentSpan)); 123result.Add(new StringIndentationRegion(indentSpan, builder.ToImmutable()));
Structure\Providers\BlockSyntaxStructureProvider.cs (3)
59subHeadings.Add((GetTextSpan(elseBlock), GetHintSpan(elseBlock), BlockTypes.Conditional)); 77subHeadings.Add((GetTextSpan(catchClause.Block), GetHintSpan(catchClause.Block), BlockTypes.Statement)); 81subHeadings.Add((GetTextSpan(finallyBlock), GetHintSpan(finallyBlock), BlockTypes.Statement));
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (2)
176result.Add(CodeAction.Create( 185result.Add(CodeAction.Create(
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaListExtensions.cs (2)
51currentLine.Add(trivia); 62result.Add(currentLine.ToImmutableAndClear());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
919variables.Add((ILocalSymbol)model.GetRequiredDeclaredSymbol(singleVariableDesignation, CancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConversionGenerator.cs (3)
112tokens.Add(PublicKeyword); 114tokens.Add(StaticKeyword); 117tokens.Add(AbstractKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1481result.Add(new TypeInferenceInfo(field.Type)); 1484result.Add(new TypeInferenceInfo(property.Type));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Utilities\PatternMatcherTests.cs (1)
439result.Add(identifier.Substring(span.Start, span.Length));
Microsoft.CodeAnalysis.Features (92)
Completion\Providers\AbstractAwaitCompletionProvider.cs (4)
100builder.Add(KeyValuePair.Create(Position, position.ToString())); 101builder.Add(KeyValuePair.Create(LeftTokenPosition, leftToken.SpanStart.ToString())); 105builder.Add(KeyValuePair.Create(MakeContainerAsync, string.Empty)); 109builder.Add(KeyValuePair.Create(AddAwaitAtCurrentPosition, string.Empty));
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
183symbolListBuilder.Add(symbol);
Completion\Providers\Scripting\AbstractLoadDirectiveCompletionProvider.cs (4)
24builder.Add('"'); 27builder.Add('/'); 31builder.Add('/'); 32builder.Add('\\');
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (4)
75result.Add(CreateCodeAction(value.ToString(), FeaturesResources.Convert_to_decimal)); 78result.Add(CreateCodeAction(binaryPrefix + Convert.ToString(value, toBase: 2), FeaturesResources.Convert_to_binary)); 81result.Add(CreateCodeAction(hexPrefix + value.ToString("X"), FeaturesResources.Convert_to_hex)); 86result.Add(CreateCodeAction(prefix + number.Replace(DigitSeparator, string.Empty), FeaturesResources.Remove_separators));
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (4)
130scopes.Add(CreateAction(document, span, Scope.ContainingMember, isRecord)); 139scopes.Add(CreateAction(document, span, Scope.ContainingType, isRecord)); 154scopes.Add(CreateAction(document, span, Scope.ContainingProject, isRecord)); 155scopes.Add(CreateAction(document, span, Scope.DependentProjects, isRecord));
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (3)
3563result.Add((oldSymbol, null, EditKind.Delete)); 3564result.Add((null, newSymbol, EditKind.Insert)); 3568result.Add((oldSymbol, newSymbol, EditKind.Update));
EmbeddedLanguages\Classification\AbstractFallbackEmbeddedLanguageClassifier.cs (3)
23array.Add(info.SyntaxKinds.CharacterLiteralToken); 24array.Add(info.SyntaxKinds.StringLiteralToken); 25array.Add(info.SyntaxKinds.InterpolatedStringTextToken);
EmbeddedLanguages\EmbeddedLanguageInfo.cs (1)
34array.Add(syntaxFacts.SyntaxKinds.StringLiteralToken);
FindUsages\DefinitionItem.DetachedDefinitionItem.cs (2)
88converted.Add(documentSpan.Value); 91convertedClassifiedSpans.Add(null);
FindUsages\DefinitionItemFactory.cs (2)
215metadataLocations.Add(new AssemblyLocation(containingAssembly.Identity.Name, containingAssembly.Identity.Version, info.ReferencedThrough.Value.FilePath)); 241source.Add(new DocumentSpan(document, location.SourceSpan));
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (2)
286result.Add(new FieldDelegatingCodeAction(this, document, state, addNullChecks)); 288result.Add(new ConstructorDelegatingCodeAction(this, document, state, addNullChecks));
Highlighting\Keywords\AbstractKeywordHighlighter.cs (2)
95tokens.Add(token); 102tokens.Add(previous);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (3)
117result.Add(CodeAction.Create( 126result.Add(CodeAction.Create( 131result.Add(CodeAction.Create(
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (6)
161actionsBuilder.Add(CreateNewCodeAction(FeaturesResources.and_update_call_sites_directly, allOccurrences: false, IntroduceParameterCodeActionKind.Refactor)); 162actionsBuilderAllOccurrences.Add(CreateNewCodeAction(FeaturesResources.and_update_call_sites_directly, allOccurrences: true, IntroduceParameterCodeActionKind.Refactor)); 170actionsBuilder.Add(CreateNewCodeAction( 172actionsBuilderAllOccurrences.Add(CreateNewCodeAction( 178actionsBuilder.Add(CreateNewCodeAction( 180actionsBuilderAllOccurrences.Add(CreateNewCodeAction(
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
179result.Add(projectId);
NavigateTo\NavigateToSearcher.cs (5)
295result.Add([_activeDocument.Project]); 303buffer.Add(doc.Project); 307result.Add(buffer.ToImmutableAndClear()); 313buffer.Add(project); 317result.Add(buffer.ToImmutableAndClear());
QuickInfo\CommonQuickInfoProvider.cs (2)
54result.Add(token); 60result.Add(token);
QuickInfo\IndentationHelper.cs (2)
64adjustedClassifiedSpans.Add(new(spanClassificationType, spanBeforeDeletion)); 76adjustedClassifiedSpans.Add(new(spanClassificationType, span));
QuickInfo\Presentation\QuickInfoContentBuilder.cs (12)
49elements.Add(null!); 56firstLineElements.Add(s_glyphToElementMap[symbolGlyph]); 61firstLineElements.Add(s_glyphToElementMap[Glyph.CompletionWarning]); 75firstLineElements.Add(element); 81elements.Add(element); 111elements.Add(element); 123elements.Add(element); 149textRuns.Add(new QuickInfoClassifiedTextRun( 157textRuns.Add(new QuickInfoClassifiedTextRun( 168elements.Add(new QuickInfoClassifiedTextElement(textRuns.ToImmutableAndClear())); 175elements.Add(new QuickInfoOnTheFlyDocsElement(context.Document, quickInfoItem.OnTheFlyDocsInfo)); 233remainingSections.Add(section);
QuickInfo\Presentation\TaggedTextExtensions.cs (10)
138_runs.Add(run); 146_lines.Add(ClassifiedText(_runs.ToImmutableAndClear())); 172_lines.Add(ClassifiedText(_runs.ToImmutableAndClear())); 176newElements.Add(ClassifiedText(PlainText(text))); 181newElements.Add(StackedContainer(nestedElements)); 185newElements.Add( 191_lines.Add(WrappedContainer(newElements.ToImmutableAndClear())); 198_lines.Add(ClassifiedText(_runs.ToImmutableAndClear())); 218_paragraphs.Add(_lines[0]); 225_paragraphs.Add(container);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
105matchKinds.Add(syntaxKinds.Convert<TSyntaxKind>(syntaxKinds.ObjectCreationExpression)); 107matchKinds.Add(syntaxKinds.Convert<TSyntaxKind>(syntaxKinds.ImplicitObjectCreationExpression.Value));
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (4)
75matchKinds.Add(syntaxKinds.Convert<TSyntaxKind>(syntaxKinds.ObjectCreationExpression)); 77matchKinds.Add(syntaxKinds.Convert<TSyntaxKind>(syntaxKinds.ImplicitObjectCreationExpression.Value)); 154locations.Add(location1); 158locations.Add(syntaxTree.GetLocation(TextSpan.FromBounds(match.Initializer.FullSpan.End, match.Statement.Span.End)));
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
97actions.Add(CodeAction.Create(
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
316builder.Add(CodeAction.Create(nestedNonCascadingTitle, nonCascadingActions, isInlinable: false)); 323builder.Add(CodeAction.Create(nestedCascadingTitle, cascadingActions, isInlinable: false));
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
118result.Add(current.Name);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (3)
96result.Add(CodeAction.Create( 105result.Add(CodeAction.Create( 112result.Add(CodeAction.Create(
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
164operations.Add(codeAction); 168operations.Add(factory.CreateSymbolRenamedOperation(_symbol, _newName, _startingSolution, newSolution));
SymbolSearch\Windows\SymbolSearchUpdateEngine.cs (2)
145results.Add(createResult(database, symbol)); 264result.Add(current.Name.ToString());
Wrapping\AbstractCodeActionComputer.cs (2)
292result.Add(wrappingActions[0]); 302result.Add(CodeAction.Create(
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\Completion\CompletionResultFactory.cs (1)
225result.Add(lspTag);
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Host\RemoteWorkspace.InFlightSolution.cs (1)
183solutions.Add(_disconnectedSolutionTask);
Services\DiagnosticAnalyzer\RemoteDiagnosticAnalyzerService.cs (1)
97builder.Add(data);
Microsoft.CodeAnalysis.Workspaces (43)
CodeActions\CodeAction.cs (2)
435result.Add(new ApplyChangesOperation(await PostProcessChangesAsync( 440result.Add(op);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (5)
278aliasSymbols.Add(symbol); 775additionalProperties.Add((key, symbol.Name)); 786additionalProperties.Add((ContainingTypeInfoPropertyName, containingType.Name)); 792additionalProperties.Add((ContainingMemberInfoPropertyName, containingSymbol.Name)); 880result.Add(alias);
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (3)
64names.Add(symbol.Name); 65names.Add(GetMemberNameWithoutInterfaceName(symbol.DeclaringMethod.Name)); 73names.Add(symbol.ContainingType.Name);
FindSymbols\SymbolTree\SymbolTreeInfo.cs (1)
516builder.Add(namedType);
FindSymbols\SyntaxTree\SyntaxTreeIndex_Forwarders.cs (1)
68result.Add(alias);
Options\GlobalOptionService.cs (2)
100values.Add(value); 111values.Add(GetOption_NoLock(ref _currentValues, optionKey, persisters));
PatternMatching\PatternMatcher.cs (4)
362matches.Add(match.Value); 393matches.Add(result.Value); 408tempMatches.Add(result.Value); 588matchSpans.Add(new TextSpan(candidateHump.Start, patternChunkCharacterSpan.Length));
src\Dependencies\Collections\TemporaryArrayExtensions.cs (2)
145array.Add(value.Value); 154array.Add(value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.cs (1)
64builder.Add(currentNodeValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
77words.Add(name.Substring(part.Start, part.Length));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\RefactoringHelpers\AbstractRefactoringHelpers.cs (1)
32result.Add(node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
128result.Add(new string(_concatenatedLowerCaseWords, characterSpan.Start, characterSpan.Length));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
38result.Add(data);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
35parts.Add(span);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (4)
94equivalenceVisitors.Add(new(this, compareMethodTypeParametersByIndex)); 95getHashCodeVisitors.Add(new(this, compareMethodTypeParametersByIndex)); 220builder.Add(namedType); 225builder.Add(candidateType);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (4)
168statements.Add(ifStatement); 169statements.Add(localDeclaration); 180statements.Add(localDeclaration); 207statements.Add(factory.ReturnStatement(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
40servicesOfMatchingType.Add(entry);
Utilities\SpellChecker.cs (1)
36similarWords.Add(current);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (4)
206generatedDocumentsBuilder.Add(generatedDocument); 217generatedDocumentsBuilder.Add(existingDocument 323generatedDocumentsBuilder.Add(newDocument); 336generatedDocumentsBuilder.Add(
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (1)
96generators.Add(generator);
Workspace\Solution\SolutionState.cs (1)
501languageCountDeltas.Add((language, amount));
Workspace\Solution\TextDocumentStates.cs (1)
338temporaryArray.Add(value);