77 references to AsyncLazy
Microsoft.CodeAnalysis.CSharp.Features (1)
Copilot\CSharpImplementNotImplementedExceptionFixProvider.cs (1)
67var lazy = AsyncLazy.Create(GetDocumentUpdater(context));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (4)
121var baseActiveStatements = AsyncLazy.Create(activeStatementMap ?? ActiveStatementsMap.Empty); 122var lazyCapabilities = AsyncLazy.Create(capabilities); 745var baseActiveStatements = AsyncLazy.Create(ActiveStatementsMap.Empty); 746var capabilities = AsyncLazy.Create(EditAndContinueTestVerifier.Net5RuntimeCapabilities);
Microsoft.CodeAnalysis.Features (21)
AddImport\SearchScopes\SourceSymbolsProjectSearchScope.cs (1)
51=> AsyncLazy.Create(static async (project, c) =>
Completion\SharedSyntaxContextsWithSpeculativeModel.cs (1)
46return self._cache.GetOrAdd(document, d => AsyncLazy.Create(static (arg, cancellationToken)
DesignerAttribute\DesignerAttributeDiscoveryService.cs (3)
97metadataId, _ => AsyncLazy.Create(static (arg, cancellationToken) => 140var lazyProjectVersion = AsyncLazy.Create(static (frozenProject, c) => 188var lazyProjectVersion = AsyncLazy.Create(static (project, c) =>
Diagnostics\Service\DiagnosticAnalyzerService_CompilationWithAnalyzersPair.cs (1)
66lazy = AsyncLazy.Create(
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (1)
201var lazyResults = AsyncLazy.Create(
EditAndContinue\EditSession.cs (3)
104? AsyncLazy.Create(static (self, cancellationToken) => 107: AsyncLazy.Create(ActiveStatementsMap.Empty)); 109Capabilities = AsyncLazy.Create(static (self, cancellationToken) =>
EncapsulateField\EncapsulateFieldResult.cs (1)
16private readonly AsyncLazy<Solution> _lazySolution = AsyncLazy.Create(getSolutionAsync);
Extensions\ExtensionFolder.cs (2)
44_lazyAssemblyLoader = AsyncLazy.Create(cancellationToken => 126AsyncLazy.Create(
Extensions\ExtensionMessageHandlerService.cs (1)
196static (messageName, arg) => AsyncLazy.Create(
ExtractMethod\ExtractMethodResult.cs (1)
37_lazyData = AsyncLazy.Create(getDocumentAsync);
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
181static t => AsyncLazy.Create(static (t, c) =>
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
463var lazySemanticModel = AsyncLazy.Create(
Wrapping\BinaryExpression\BinaryExpressionCodeActionComputer.cs (1)
65_smartIndentTrivia = AsyncLazy.Create(async cancellationToken => new SyntaxTriviaList(generator.Whitespace(
Wrapping\ChainedExpression\ChainedExpressionCodeActionComputer.cs (1)
87_smartIndentTrivia = AsyncLazy.Create(async cancellationToken => new SyntaxTriviaList(generator.Whitespace(
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (2)
91_singleIndentationTrivia = AsyncLazy.Create(async cancellationToken => generator.Whitespace(await GetSingleIndentationAsync(cancellationToken).ConfigureAwait(false))); 92_braceIndentationTrivia = AsyncLazy.Create(async cancellationToken => generator.Whitespace(await GetBraceTokenIndentationAsync(cancellationToken).ConfigureAwait(false)));
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\EditAndContinueTestVerifier.cs (2)
162var lazyCapabilities = AsyncLazy.Create(requiredCapabilities); 190var lazyOldActiveStatementMap = AsyncLazy.Create(expectedResult.ActiveStatements.OldStatementsMap);
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\Diagnostics\DiagnosticSources\AbstractWorkspaceDocumentDiagnosticSource.cs (1)
70_ => AsyncLazy.Create(
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\ClientOptionsProvider.cs (1)
20var lazyOptions = ImmutableInterlocked.GetOrAdd(ref _cache, languageServices.Language, _ => AsyncLazy.Create(
Microsoft.CodeAnalysis.Workspaces (37)
Diagnostics\Extensions.cs (1)
479static project => AsyncLazy.Create(
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (2)
66var lazyCompilation = AsyncLazy.Create(static (project, cancellationToken) => 119var lazyAssembly = AsyncLazy.Create(static async (arg, cancellationToken) =>
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
51tuple = new((checksum, AsyncLazy.Create(CreateIndexAsync, project)));
FindSymbols\FindReferences\FindReferenceCache.cs (1)
30var lazy = s_cache.GetValue(document, static document => AsyncLazy.Create(ComputeCacheAsync, document));
FindSymbols\SymbolTree\SymbolTreeInfo.cs (1)
127query, AsyncLazy.Create((IAssemblySymbol?)assembly), filter, cancellationToken);
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (2)
161id => AsyncLazy.Create(static (arg, c) => 181metadataId => AsyncLazy.Create(static (arg, cancellationToken) =>
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
75static p => AsyncLazy.Create(
Workspace\Solution\AnalyzerConfigDocumentState.cs (1)
26_lazyAnalyzerConfig = lazyAnalyzerConfig ?? AsyncLazy.Create(
Workspace\Solution\Document.cs (1)
602var newAsyncLazy = AsyncLazy.Create(static async (arg, cancellationToken) =>
Workspace\Solution\DocumentState.cs (1)
542AsyncLazy.Create(
Workspace\Solution\DocumentState_LinkedFileReuse.cs (1)
117var lazyComputation = AsyncLazy.Create(
Workspace\Solution\ProjectState.AnalyzerConfigOptionsCache.cs (1)
37public readonly AsyncLazy<Value> Lazy = AsyncLazy.Create(
Workspace\Solution\ProjectState.cs (9)
108_lazyLatestDocumentVersion = AsyncLazy.Create(static async (self, c) => await ComputeLatestDocumentVersionAsync(self.DocumentStates, self.AdditionalDocumentStates, c).ConfigureAwait(false), arg: this); 109_lazyLatestDocumentTopLevelChangeVersion = AsyncLazy.Create(static (self, c) => ComputeLatestDocumentTopLevelChangeVersionAsync(self.DocumentStates, self.AdditionalDocumentStates, c), arg: this); 151AsyncLazy.Create(static (self, cancellationToken) => self.ComputeChecksumsAsync(cancellationToken), arg: this), 168AsyncLazy.Create(static (self, cancellationToken) => self.ComputeContentHashToDocumentIdAsync(cancellationToken), arg: this), 246return AsyncLazy.Create(static (arg, cancellationToken) => 252return AsyncLazy.Create(static (arg, cancellationToken) => 1085dependentDocumentVersion = AsyncLazy.Create(static async (arg, cancellationToken) => 1091dependentDocumentVersion = AsyncLazy.Create( 1109dependentSemanticVersion = AsyncLazy.Create(static (arg, cancellationToken) =>
Workspace\Solution\Solution.cs (3)
52AsyncLazy.Create(synchronousComputeFunction: static (self, c) => 1548=> AsyncLazy.Create(synchronousComputeFunction: static (arg, cancellationToken) => 1560solution._documentIdToFrozenSolution.Add(documentId, AsyncLazy.Create(solution));
Workspace\Solution\SolutionCompilationState.cs (2)
74_lazyChecksums = AsyncLazy.Create(static async (self, cancellationToken) => 81AsyncLazy.Create(synchronousComputeFunction: static (self, c) =>
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (2)
1029AsyncLazy.Create(static (arg, c) => 1068AsyncLazy.Create(static (arg, c) =>
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
211compilation => AsyncLazy.Create(static (arg, cancellationToken) =>
Workspace\Solution\SolutionCompilationState_Checksum.cs (1)
80checksums = AsyncLazy.Create(static async (arg, cancellationToken) =>
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (1)
126_ => AsyncLazy.Create(
Workspace\Solution\SolutionState.cs (1)
101_lazyChecksums = AsyncLazy.Create(static (self, c) =>
Workspace\Solution\SolutionState_Checksum.cs (1)
74checksums = AsyncLazy.Create(
Workspace\Solution\TextDocumentState.cs (1)
45_lazyChecksums = AsyncLazy.Create(static (self, cancellationToken) => self.ComputeChecksumsAsync(cancellationToken), arg: this);
Workspace\Solution\VersionSource\SimpleTreeAndVersionSource.cs (1)
43=> new(AsyncLazy.Create(source));
Microsoft.CodeAnalysis.Workspaces.UnitTests (10)
UtilityTest\AsyncLazyTests.cs (10)
25var lazy = AsyncLazy.Create(static c => Task.FromResult(5)); 43var lazy = AsyncLazy.Create( 162lazy = AsyncLazy.Create( 199var lazy = AsyncLazy.Create(static (cancellationTokenSource, c) => Task.Run((Func<object>)(() => 243var lazy = AsyncLazy.Create( 266var lazy = AsyncLazy.Create(static c => Task.FromResult(new object())); 291? AsyncLazy.Create(asynchronousComputeFunction) 292: AsyncLazy.Create(asynchronousComputeFunction, synchronousComputeFunction); 313var lazy = AsyncLazy.Create( 371var lazy = AsyncLazy.Create(