1 instantiation of SourceGeneratedDocument
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
475(documentId, stateAndProject) => new SourceGeneratedDocument(stateAndProject.project, stateAndProject.state);
76 references to SourceGeneratedDocument
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
306IsInSourceGeneratedDocument = _document.Document is SourceGeneratedDocument;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
75if (document is SourceGeneratedDocument)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
483if (document is SourceGeneratedDocument)
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
483if (document is SourceGeneratedDocument)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
456foreach (var generatedDocument in await document.Project.GetSourceGeneratedDocumentsAsync(cancellationToken).ConfigureAwait(false))
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
628Assert.IsType<SourceGeneratedDocument>(document);
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
RazorProjectExtensions.cs (1)
21internal static async ValueTask<IEnumerable<SourceGeneratedDocument>> GetSourceGeneratedDocumentsForGeneratorAsync(this Project project, string assemblyName, string assemblyPath, Version assemblyVersion, string typeName, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (6)
EditAndContinue\CommittedSolution.cs (2)
182var sourceGeneratedDocument = await solution.GetSourceGeneratedDocumentAsync(documentId, cancellationToken).ConfigureAwait(false); 190if (currentDocument is SourceGeneratedDocument)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
386foreach (var document in await project.GetSourceGeneratedDocumentsAsync(_shutdownToken).ConfigureAwait(false))
Navigation\INavigableItem.cs (1)
60SourceGeneratedDocumentIdentity: (document as SourceGeneratedDocument)?.Identity,
Rename\SymbolicRenameInfo.cs (1)
224if (sourceDocument is SourceGeneratedDocument)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
306IsInSourceGeneratedDocument = _document.Document is SourceGeneratedDocument;
Microsoft.CodeAnalysis.Features.UnitTests (3)
EditAndContinue\CompileTimeSolutionProviderTests.cs (1)
67var sourceGeneratedDoc = (await compileTimeSolution.Projects.Single().GetSourceGeneratedDocumentsAsync()).Single();
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
291var generatedDocument = (await solution.Projects.Single().GetSourceGeneratedDocumentsAsync()).Single(); 1115var generatedDocument = (await solution.Projects.Single().GetSourceGeneratedDocumentsAsync()).Single();
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Extensions\Extensions.cs (2)
29return document is SourceGeneratedDocument sourceGeneratedDocument 42Contract.ThrowIfTrue(document is SourceGeneratedDocument);
Handler\Diagnostics\DiagnosticSources\AbstractWorkspaceDocumentDiagnosticSource.cs (1)
44if (Document is SourceGeneratedDocument sourceGeneratedDocument)
Handler\SourceGenerators\SourceGeneratedDocumentGetTextHandler.cs (1)
51Contract.ThrowIfFalse(document is SourceGeneratedDocument);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (7)
Workspaces\LspWorkspaceManagerTests.cs (7)
707var sourceGeneratedDocument = await OpenDocumentAndVerifyLspTextAsync(sourceGeneratorDocumentUri, testLspServer, generatorText) as SourceGeneratedDocument; 724var sourceGeneratedDocument = await OpenDocumentAndVerifyLspTextAsync(sourceGeneratorDocumentUri, testLspServer, lspGeneratedText) as SourceGeneratedDocument; 740var sourceGeneratedDocument = await OpenDocumentAndVerifyLspTextAsync(sourceGeneratorDocumentUri, testLspServer, generatorText) as SourceGeneratedDocument; 748AssertEx.NotNull(sourceGeneratedDocument as SourceGeneratedDocument);
Microsoft.CodeAnalysis.Workspaces (18)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
239if (document is not SourceGeneratedDocument) 248if (location.Document is SourceGeneratedDocument)
Shared\Extensions\ProjectExtensions.cs (1)
51var document = await project.GetSourceGeneratedDocumentAsync(documentId, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
75if (document is SourceGeneratedDocument)
Workspace\Solution\Project.cs (10)
30private ImmutableDictionary<DocumentId, SourceGeneratedDocument> _idToSourceGeneratedDocumentMap = ImmutableDictionary<DocumentId, SourceGeneratedDocument>.Empty; 285public async ValueTask<IEnumerable<SourceGeneratedDocument>> GetSourceGeneratedDocumentsAsync(CancellationToken cancellationToken = default) 299foreach (var document in await GetSourceGeneratedDocumentsAsync(cancellationToken).ConfigureAwait(false)) 303public async ValueTask<SourceGeneratedDocument?> GetSourceGeneratedDocumentAsync(DocumentId documentId, CancellationToken cancellationToken = default) 315if (_idToSourceGeneratedDocumentMap.TryGetValue(documentId, out var sourceGeneratedDocument)) 327internal SourceGeneratedDocument GetOrCreateSourceGeneratedDocument(SourceGeneratedDocumentState state) 338internal SourceGeneratedDocument? TryGetSourceGeneratedDocumentForAlreadyGeneratedId(DocumentId documentId) 350if (_idToSourceGeneratedDocumentMap.TryGetValue(documentId, out var document)) 474private static readonly Func<DocumentId, (SourceGeneratedDocumentState state, Project project), SourceGeneratedDocument> s_createSourceGeneratedDocumentFunction =
Workspace\Solution\Solution.cs (2)
296public ValueTask<SourceGeneratedDocument?> GetSourceGeneratedDocumentAsync(DocumentId documentId, CancellationToken cancellationToken) 327var generatedDocument = this.GetRequiredProject(documentState.Id.ProjectId).TryGetSourceGeneratedDocumentForAlreadyGeneratedId(documentState.Id);
Workspace\Workspace_Editor.cs (2)
443SourceGeneratedDocument document) 467internal void OnSourceGeneratedDocumentClosed(SourceGeneratedDocument document)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace`1.cs (1)
535var document = await CurrentSolution.GetSourceGeneratedDocumentAsync(documentId, CancellationToken.None);
Microsoft.CodeAnalysis.Workspaces.UnitTests (19)
SolutionTests\SolutionWithSourceGeneratorTests.cs (19)
72var generatedDocument = Assert.Single(await project.GetSourceGeneratedDocumentsAsync()); 275Assert.IsType<SourceGeneratedDocument>(project.GetDocument(generatedSyntaxTree)); 325Assert.IsType<SourceGeneratedDocument>(project.GetDocument(tree)); 370var generatedDocumentBeforeChange = Assert.Single(await projectBeforeChange.GetSourceGeneratedDocumentsAsync()); 377var generatedDocumentAfterChange = Assert.Single(await projectAfterChange.GetSourceGeneratedDocumentsAsync()); 449var generatedDocument = Assert.IsType<SourceGeneratedDocument>(project.GetDocument(syntaxTree)); 472var generatedDocument = Assert.IsType<SourceGeneratedDocument>(project.GetDocument(syntaxTree)); 594var generatedDocument = Assert.Single(await project.GetSourceGeneratedDocumentsAsync()); 599generatedDocument = Assert.IsType<SourceGeneratedDocument>(differentOpenTextContainer.CurrentText.GetOpenDocumentInCurrentContextWithChanges()); 618var generatedDocument = Assert.Single(await workspace.CurrentSolution.Projects.Single().GetSourceGeneratedDocumentsAsync()); 623generatedDocument = Assert.IsType<SourceGeneratedDocument>(differentOpenTextContainer.CurrentText.GetOpenDocumentInCurrentContextWithChanges()); 638var generatedDocument = Assert.Single(await originalAdditionalFile.Project.GetSourceGeneratedDocumentsAsync()); 647generatedDocument = Assert.IsType<SourceGeneratedDocument>(differentOpenTextContainer.CurrentText.GetOpenDocumentInCurrentContextWithChanges()); 674generatedDocument = Assert.IsType<SourceGeneratedDocument>(differentOpenTextContainer.CurrentText.GetOpenDocumentInCurrentContextWithChanges()); 696var generatedDocument = Assert.Single(await project.GetSourceGeneratedDocumentsAsync()); 873var sourceGeneratedDocument = Assert.Single(await project.GetSourceGeneratedDocumentsAsync()); 931var sourceGeneratedDocument = Assert.Single(await project.GetSourceGeneratedDocumentsAsync());
Microsoft.VisualStudio.LanguageServices (8)
CodeModel\IProjectCodeModel.cs (1)
12EnvDTE.FileCodeModel CreateFileCodeModel(CodeAnalysis.SourceGeneratedDocument sourceGeneratedDocument);
CodeModel\IProjectCodeModelFactory.cs (1)
15EnvDTE.FileCodeModel CreateFileCodeModel(SourceGeneratedDocument sourceGeneratedDocument);
ProjectSystem\VisualStudioWorkspaceImpl.cs (1)
302if (document is SourceGeneratedDocument sourceGeneratedDocument)
Workspace\SourceGeneratedFileManager.cs (4)
105public Func<CancellationToken, Task<bool>> GetNavigationCallback(SourceGeneratedDocument document, TextSpan sourceSpan) 303var sourceGeneratedDocument = (SourceGeneratedDocument?)_textBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 332SourceGeneratedDocument? generatedDocument = null;
Workspace\VisualStudioDocumentNavigationService.cs (1)
203var generatedDocument = await project.GetSourceGeneratedDocumentAsync(documentId, cancellationToken).ConfigureAwait(false);
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Venus\DocumentServiceTests.vb (1)
116Dim document = Assert.IsType(Of SourceGeneratedDocument)(Await workspace.CurrentSolution.GetDocumentAsync(sourceGeneratedDocumentId, includeSourceGenerated:=True))
Roslyn.VisualStudio.Next.UnitTests (2)
Services\ServiceHubServicesTests.cs (2)
481var localDoc = localGeneratedDocs[i]; 482var remoteDoc = remoteGeneratedDocs[i];