275 references to SpecializedTasks
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.Features (5)
Microsoft.CodeAnalysis.EditorFeatures (8)
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (10)
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (16)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (12)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Microsoft.CodeAnalysis.Features (48)
Microsoft.CodeAnalysis.LanguageServer.Protocol (11)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (5)
Microsoft.CodeAnalysis.VisualBasic.Features (20)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
Microsoft.CodeAnalysis.Workspaces (77)
Workspace\Host\PersistentStorage\AbstractPersistentStorage.cs (18)
60=> IsDisabled ? SpecializedTasks.False : ChecksumMatchesAsync(projectKey, project: null, name, checksum, cancellationToken);
63=> IsDisabled ? SpecializedTasks.False : ChecksumMatchesAsync(documentKey, document: null, name, checksum, cancellationToken);
66=> IsDisabled ? SpecializedTasks.Null<Stream>() : ReadStreamAsync(projectKey, project: null, name, checksum, cancellationToken);
69=> IsDisabled ? SpecializedTasks.Null<Stream>() : ReadStreamAsync(documentKey, document: null, name, checksum, cancellationToken);
72=> IsDisabled ? SpecializedTasks.False : WriteStreamAsync(projectKey, project: null, name, stream, checksum, cancellationToken);
75=> IsDisabled ? SpecializedTasks.False : WriteStreamAsync(documentKey, document: null, name, stream, checksum, cancellationToken);
78=> IsDisabled ? SpecializedTasks.False : ChecksumMatchesAsync(ProjectKey.ToProjectKey(project), project, name, checksum, cancellationToken);
81=> IsDisabled ? SpecializedTasks.False : ChecksumMatchesAsync(DocumentKey.ToDocumentKey(document), document, name, checksum, cancellationToken);
84=> IsDisabled ? SpecializedTasks.Null<Stream>() : ReadStreamAsync(ProjectKey.ToProjectKey(project), project, name, checksum, cancellationToken);
87=> IsDisabled ? SpecializedTasks.Null<Stream>() : ReadStreamAsync(DocumentKey.ToDocumentKey(document), document, name, checksum, cancellationToken);
90=> IsDisabled ? SpecializedTasks.Null<Stream>() : ReadStreamAsync(name, checksum: null, cancellationToken);
93=> IsDisabled ? SpecializedTasks.Null<Stream>() : ReadStreamAsync(project, name, checksum: null, cancellationToken);
96=> IsDisabled ? SpecializedTasks.Null<Stream>() : ReadStreamAsync(document, name, checksum: null, cancellationToken);
99=> IsDisabled ? SpecializedTasks.False : WriteStreamAsync(ProjectKey.ToProjectKey(project), project, name, stream, checksum, cancellationToken);
102=> IsDisabled ? SpecializedTasks.False : WriteStreamAsync(DocumentKey.ToDocumentKey(document), document, name, stream, checksum, cancellationToken);
105=> IsDisabled ? SpecializedTasks.False : WriteStreamAsync(name, stream, checksum: null, cancellationToken);
108=> IsDisabled ? SpecializedTasks.False : WriteStreamAsync(project, name, stream, checksum: null, cancellationToken);
111=> IsDisabled ? SpecializedTasks.False : WriteStreamAsync(document, name, stream, checksum: null, cancellationToken);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (25)
UtilityTest\SpecializedTasksTests.cs (25)
29Assert.Throws<ArgumentNullException>(() => SpecializedTasks.WhenAll<int>((IEnumerable<ValueTask<int>>)null!));
36var whenAll = SpecializedTasks.WhenAll(SpecializedCollections.EmptyEnumerable<ValueTask<int>>());
45var whenAll = SpecializedTasks.WhenAll(new[] { new ValueTask<int>(0), new ValueTask<int>(1) });
54var whenAll = SpecializedTasks.WhenAll(new[] { new ValueTask<int>(Task.FromCanceled<int>(new CancellationToken(true))) });
64var whenAll = SpecializedTasks.WhenAll(new[] { new ValueTask<int>(completionSource.Task) });
81Assert.Throws<ArgumentNullException>("func", () => SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(null!, transform, arg, cancellationToken));
82Assert.Throws<ArgumentNullException>("transform", () => SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync<StateType, IntermediateType, ResultType>(func, null!, arg, cancellationToken));
94var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
116var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
137var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
167var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
193var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
224var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
250var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
284var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
317var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
351var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
377var exception = Assert.Throws<InvalidOperationException>(() => SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken));
398var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
426var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
454var exception = Assert.Throws<InvalidOperationException>(() => SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken));
478var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
509var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
529var exception = Assert.Throws<InvalidOperationException>(() => SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken));
549var task = SpecializedTasks.TransformWithoutIntermediateCancellationExceptionAsync(func, transform, arg, cancellationToken).Preserve();
Microsoft.VisualStudio.LanguageServices (8)
Microsoft.VisualStudio.LanguageServices.CodeLens (2)
Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests (3)
MockDocumentNavigationServiceFactory.cs (3)
36public Task<bool> CanNavigateToLineAndOffsetAsync(Workspace workspace, DocumentId documentId, int lineNumber, int offset, CancellationToken cancellationToken) => SpecializedTasks.True;
38public Task<bool> CanNavigateToPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, CancellationToken cancellationToken) => SpecializedTasks.True;
40public Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken) => SpecializedTasks.True;
Microsoft.VisualStudio.LanguageServices.UnitTests (7)