76 references to SpecializedCollections
Microsoft.CodeAnalysis.CSharp.Features (9)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
352var attributeValues = SpecializedCollections.EmptyEnumerable<string?>();
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (2)
152var prefixParts = SpecializedCollections.SingletonEnumerable(new SymbolDisplayPart(SymbolDisplayPartKind.Punctuation, null, "(")).ToTaggedText(); 153var suffixParts = SpecializedCollections.SingletonEnumerable(new SymbolDisplayPart(SymbolDisplayPartKind.Punctuation, null, ")")).ToTaggedText();
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (6)
156var codeBlocks = SpecializedCollections.SingletonEnumerable(t.EqualsValue).Concat(attributes); 193var codeBlocks = SpecializedCollections.SingletonEnumerable(decl.Initializer).Concat(attributes); 228var codeBlocks = SpecializedCollections.SingletonEnumerable(t.Initializer).Concat(attributes); 350SpecializedCollections.EmptyEnumerable<SyntaxNode>(); 353SpecializedCollections.SingletonEnumerable(parameter.Default).Concat(GetAttributes(parameter.AttributeLists)); 358SpecializedCollections.EmptyEnumerable<SyntaxNode>();
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (4)
257validTypeDeclarations ??= SpecializedCollections.EmptySet<SyntaxKind>(); 294validModifiers ??= SpecializedCollections.EmptySet<SyntaxKind>(); 543validTypeDeclarations ??= SpecializedCollections.EmptySet<SyntaxKind>(); 591validModifiers ??= SpecializedCollections.EmptySet<SyntaxKind>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (2)
59reservedNames ??= SpecializedCollections.EmptyList<string>(); 82reservedNames ??= SpecializedCollections.EmptyList<string>();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (1)
27? SpecializedCollections.SingletonEnumerable(sourceCodeKind.Value)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeFixes\CodeFixServiceTests.cs (4)
52var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => workspace.Services.GetRequiredService<IErrorLoggerService>())); 344var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => new TestErrorLogger())); 735? SpecializedCollections.SingletonEnumerable(new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(() => vsixFixer, new CodeChangeProviderMetadata(name: nameof(VsixCodeFixProvider), languages: LanguageNames.CSharp))) 742var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => workspace.Services.GetRequiredService<IErrorLoggerService>()));
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
Editor\FSharpNavigationBarItem.cs (1)
38this.ChildItems = childItems ?? SpecializedCollections.EmptyList<FSharpNavigationBarItem>();
Internal\Editor\FSharpNavigationBarItemService.cs (1)
62=> (items ?? SpecializedCollections.EmptyList<FSharpNavigationBarItem>()).Where(x => x.Spans.Any()).SelectAsArray(x => ConvertToNavigationBarItem(x, textVersion));
Microsoft.CodeAnalysis.Features (17)
EditAndContinue\DeclarationBodyMap.cs (2)
15SpecializedCollections.EmptyReadOnlyDictionary<SyntaxNode, SyntaxNode>(), 16SpecializedCollections.EmptyReadOnlyDictionary<SyntaxNode, SyntaxNode>(),
EditAndContinue\Utilities\BidirectionalMap.cs (2)
17public static readonly BidirectionalMap<T> Empty = new(SpecializedCollections.EmptyReadOnlyDictionary<T, T>(), SpecializedCollections.EmptyReadOnlyDictionary<T, T>());
ExtractInterface\ExtractInterfaceCodeAction.cs (1)
37var operations = SpecializedCollections.EmptyEnumerable<CodeActionOperation>();
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
75var emptyList = SpecializedCollections.EmptyEnumerable<SyntaxTrivia>();
GenerateType\AbstractGenerateTypeService.CodeAction.cs (1)
174var operations = SpecializedCollections.EmptyEnumerable<CodeActionOperation>();
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (2)
71SpecializedCollections.EmptyDictionary<INamedTypeSymbol, string>(), 72SpecializedCollections.EmptyList<SymbolDisplayPart>());
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.cs (1)
50return SpecializedCollections.EmptyDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>();
Navigation\NavigableItemFactory.cs (2)
48var generatedSourceLocations = candidateLocationGroups.SingleOrDefault(g => g.Key) ?? SpecializedCollections.EmptyEnumerable<Location>(); 49var nonGeneratedSourceLocations = candidateLocationGroups.SingleOrDefault(g => !g.Key) ?? SpecializedCollections.EmptyEnumerable<Location>();
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
403: SpecializedCollections.SingletonEnumerable(argument);
SignatureHelp\AbstractSignatureHelpProvider.cs (1)
182? SpecializedCollections.EmptyList<SymbolDisplayPart>()
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
52var spans = SpecializedCollections.SingletonEnumerable(span);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
173reservedNames ??= SpecializedCollections.EmptyList<string>();
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
35return GetDeclarationInfo(model, node, getSymbol, SpecializedCollections.SingletonEnumerable(executableCodeBlock), cancellationToken);
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Handler\Completion\CompletionCapabilityHelper.cs (3)
48SupportedItemKinds = completionSetting?.CompletionItemKind?.ValueSet?.ToSet() ?? SpecializedCollections.EmptySet<CompletionItemKind>(); 49SupportedItemTags = completionSetting?.CompletionItem?.TagSupport?.ValueSet?.ToSet() ?? SpecializedCollections.EmptySet<CompletionItemTag>(); 50SupportedInsertTextModes = completionSetting?.CompletionItem?.InsertTextModeSupport?.ValueSet?.ToSet() ?? SpecializedCollections.EmptySet<InsertTextMode>();
Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
43var formattingChanges = Formatter.GetFormattedTextChanges(root, SpecializedCollections.SingletonEnumerable(formattingSpan), services, formattingOptions, cancellationToken);
Microsoft.CodeAnalysis.Workspaces (21)
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
430return SpecializedCollections.EmptySet<ProjectId>();
Formatting\Formatter.cs (1)
308? SpecializedCollections.EmptyList<TextChange>()
Recommendations\AbstractRecommendationService.cs (1)
52return SpecializedCollections.EmptySet<INamedTypeSymbol>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (2)
90=> _elements is null ? SpecializedCollections.EmptyEnumerator<T>() : ((IEnumerable<T>)_elements).GetEnumerator(); 99=> (IReadOnlySet<T>?)_set ?? SpecializedCollections.EmptyReadOnlySet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (4)
79return SpecializedCollections.EmptyBoxedImmutableArray<T>(); 84return array.IsDefaultOrEmpty ? SpecializedCollections.EmptyBoxedImmutableArray<T>() : (IReadOnlyList<T>)items; 89return SpecializedCollections.EmptyBoxedImmutableArray<T>(); 328return SpecializedCollections.EmptyEnumerable<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.cs (2)
38var operations = SpecializedCollections.SingletonEnumerable(rootOperation); 52var operations = SpecializedCollections.SingletonEnumerable(localFunctionOperation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
155var operations = SpecializedCollections.SingletonEnumerable(basicBlock.BranchValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyDictionaryExtensions.cs (1)
28case T s: return SpecializedCollections.SingletonEnumerable(s);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (3)
185public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(SpecializedCollections.EmptyEnumerable<T>()); 187public static readonly Task<IList<T>> EmptyList = Task.FromResult(SpecializedCollections.EmptyList<T>()); 188public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult(SpecializedCollections.EmptyReadOnlyList<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceInfo.cs (1)
26var info = new CodeGenerationNamespaceInfo(imports ?? SpecializedCollections.EmptyList<ISymbol>());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceSymbol.cs (1)
16private readonly IList<INamespaceOrTypeSymbol> _members = members ?? SpecializedCollections.EmptyList<INamespaceOrTypeSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
177ignoreErrorCode ??= SpecializedCollections.EmptyList<string>();
Workspace\Solution\ProjectInfo.cs (1)
256analyzerConfigDocuments: SpecializedCollections.EmptyBoxedImmutableArray<DocumentInfo>(),
Workspace\Solution\SolutionState.cs (1)
117projectIds: SpecializedCollections.EmptyBoxedImmutableArray<ProjectId>(),
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (9)
Workspaces\TestHostProject`1.cs (9)
113_analyzerReferences = analyzerReferences ?? SpecializedCollections.EmptyEnumerable<AnalyzerReference>(); 115this.AdditionalDocuments = additionalDocuments ?? SpecializedCollections.EmptyEnumerable<TDocument>(); 116this.AnalyzerConfigDocuments = analyzerConfigDocuments ?? SpecializedCollections.EmptyEnumerable<TDocument>(); 117ProjectReferences = SpecializedCollections.EmptyEnumerable<ProjectReference>(); 149this.Documents = documents ?? SpecializedCollections.EmptyEnumerable<TDocument>(); 150this.AdditionalDocuments = additionalDocuments ?? SpecializedCollections.EmptyEnumerable<TDocument>(); 151this.AnalyzerConfigDocuments = analyzerConfigDocuments ?? SpecializedCollections.EmptyEnumerable<TDocument>(); 152ProjectReferences = projectReferences != null ? projectReferences.Select(p => new ProjectReference(p.Id)) : SpecializedCollections.EmptyEnumerable<ProjectReference>(); 154_analyzerReferences = analyzerReferences ?? SpecializedCollections.EmptyEnumerable<AnalyzerReference>();
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
CodeCleanup\CodeCleanupTests.cs (1)
380var expectedResult = namedSpans.TryGetValue("r", out var spans) ? spans : SpecializedCollections.EmptyEnumerable<TextSpan>();
UtilityTest\SpecializedTasksTests.cs (1)
37var whenAll = SpecializedTasks.WhenAll(SpecializedCollections.EmptyEnumerable<ValueTask<int>>());
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
ReferenceCodeLensProvider.cs (1)
299Entries = entries ?? SpecializedCollections.EmptyList<CodeLensDetailEntryDescriptor>(),