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