1 instantiation of DocumentId
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\DocumentId.cs (1)
57return new DocumentId(projectId, id, isSourceGenerated, debugName);
2334 references to DocumentId
AnalyzerRunner (3)
DiagnosticAnalyzerRunner.cs (3)
104var documentPerformance = new Dictionary<DocumentId, DocumentAnalyzerPerformance>(); 113foreach (var documentId in project.DocumentIds) 178private static async Task<DocumentAnalyzerPerformance> TestDocumentPerformanceAsync(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, Project project, DocumentId documentId, Options analyzerOptionsInternal, CancellationToken cancellationToken)
IdeCoreBenchmarks (10)
FormatterBenchmarks.cs (2)
47var documentId = DocumentId.CreateNewId(projectId);
ProjectOperationBenchmarks.cs (4)
72var documentId = DocumentId.CreateNewId(projectId, documentName); 84foreach (var _ in Project.DocumentIds) 108var documentId = Project.DocumentIds.FirstOrDefault();
RenameBenchmarks.cs (2)
41var documentId = DocumentId.CreateNewId(projectId);
SwitchStatementBenchmarks.cs (2)
63var documentId = DocumentId.CreateNewId(projectId);
Microsoft.Analyzers.Extra (2)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
321RemapAsync(Solution sol, DocumentId docId, ExpressionSyntax invocationExpression) 542var invocationDocId = invocationDoc.Id;
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
494foreach (var documentId in project.DocumentIds)
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
495foreach (var documentId in project.DocumentIds)
Microsoft.AspNetCore.Analyzer.Testing (4)
DiagnosticProject.cs (2)
79var documentId = DocumentId.CreateNewId(testProject, debugName: newFileName);
DiagnosticVerifier.cs (2)
180var documentId = DocumentId.CreateNewId(projectId, debugName: newFileName);
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Helpers\DiagnosticVerifier.Helper.cs (2)
163var documentId = DocumentId.CreateNewId(projectId, debugName: newFileName);
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Helpers\DiagnosticVerifier.Helper.cs (2)
163var documentId = DocumentId.CreateNewId(projectId, debugName: newFileName);
Microsoft.CodeAnalysis.CodeStyle.Fixes (11)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
221foreach (var linkedDocumentId in document.GetLinkedDocumentIds())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (7)
16public static IEnumerable<DocumentId> GetChangedDocuments(this Solution? newSolution, Solution oldSolution) 24foreach (var documentId in projectChanges.GetChangedDocuments()) 32public static TextDocument? GetTextDocument(this Solution solution, DocumentId? documentId) 49public static Document GetRequiredDocument(this Solution solution, DocumentId documentId) 73public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 76public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 79public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Rename\Annotations\RenameDeclarationLocationReference.cs (2)
18public readonly DocumentId DocumentId; 36public RenameDeclarationLocationReference(DocumentId documentId, TextSpan textSpan, bool overriddenFromMetadata, int declaringSyntaxReferencesCount)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
28internal readonly record struct ParsedDocument(DocumentId Id, SourceText Text, SyntaxNode Root, HostLanguageServices HostLanguageServices)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (41)
CodeActions\AddUsing\AddUsingNuGetTests.cs (7)
60installerServiceMock.Setup(s => s.TryInstallPackageAsync(It.IsAny<Workspace>(), It.IsAny<DocumentId>(), It.IsAny<string>(), "NuGetPackage", It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<IProgress<CodeAnalysisProgress>>(), It.IsAny<CancellationToken>())) 93installerServiceMock.Setup(s => s.TryInstallPackageAsync(It.IsAny<Workspace>(), It.IsAny<DocumentId>(), It.IsAny<string>(), "NuGetPackage", It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<IProgress<CodeAnalysisProgress>>(), It.IsAny<CancellationToken>())) 124installerServiceMock.Setup(s => s.TryInstallPackageAsync(It.IsAny<Workspace>(), It.IsAny<DocumentId>(), It.IsAny<string>(), "NuGetPackage", It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<IProgress<CodeAnalysisProgress>>(), It.IsAny<CancellationToken>())) 155installerServiceMock.Setup(s => s.TryInstallPackageAsync(It.IsAny<Workspace>(), It.IsAny<DocumentId>(), It.IsAny<string>(), "NuGetPackage", It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<IProgress<CodeAnalysisProgress>>(), It.IsAny<CancellationToken>())) 254installerServiceMock.Setup(s => s.TryInstallPackageAsync(It.IsAny<Workspace>(), It.IsAny<DocumentId>(), It.IsAny<string>(), "NuGetPackage", /*versionOpt*/ null, It.IsAny<bool>(), It.IsAny<IProgress<CodeAnalysisProgress>>(), It.IsAny<CancellationToken>())) 288installerServiceMock.Setup(s => s.TryInstallPackageAsync(It.IsAny<Workspace>(), It.IsAny<DocumentId>(), It.IsAny<string>(), "NuGetPackage", "1.0", It.IsAny<bool>(), It.IsAny<IProgress<CodeAnalysisProgress>>(), It.IsAny<CancellationToken>())) 321installerServiceMock.Setup(s => s.TryInstallPackageAsync(It.IsAny<Workspace>(), It.IsAny<DocumentId>(), It.IsAny<string>(), "NuGetPackage", "1.0", It.IsAny<bool>(), It.IsAny<IProgress<CodeAnalysisProgress>>(), It.IsAny<CancellationToken>()))
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
917var documentToModifyId = workspace.Documents[0].Id;
CodeActions\PreviewTests.cs (1)
73solution = solution.AddDocument(DocumentId.CreateNewId(_oldDocument.Project.Id, AddedDocumentName), AddedDocumentName, AddedDocumentText);
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (2)
70var oldDocumentId = oldDocument.Id; 159var refDocumentId = refDocument?.Id;
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
170var documentId = workspace.GetDocumentId(hostDocument);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (3)
2469var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument").Id; 2722var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument2").Id; 2777var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument").Id;
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
164var additionalDocId = DocumentId.CreateNewId(workspace.CurrentSolution.Projects.Single().Id);
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (3)
41.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", "public class Goo { }") 42.AddAdditionalDocument(DocumentId.CreateNewId(projectId), "add.txt", "text") 43.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From(""), filePath: EditorconfigPath)));
Formatting\CodeCleanupTests.TestFixers.cs (2)
116return solution.AddDocument(DocumentId.CreateNewId(project.Id), "new.cs", SourceText.From("")); 172return solution.AddDocument(DocumentId.CreateNewId(project.Id), "new.cs", SourceText.From(""));
Formatting\RazorLineFormattingOptionsTests.cs (1)
58DocumentId.CreateNewId(project.Id),
MoveToNamespace\MoveToNamespaceTests.cs (1)
1424foreach (var id in workspace.Documents.Select(d => d.Id))
PdbSourceDocument\NullResultMetadataAsSourceFileProvider.cs (1)
51public bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, Text.SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
PdbSourceDocument\PdbSourceDocumentTests.cs (4)
975var result = service.TryAddDocumentToWorkspace(requestPath, new StaticSourceTextContainer(SourceText.From(string.Empty)), out var documentId); 998var openResult = service.TryAddDocumentToWorkspace(file.FilePath, new StaticSourceTextContainer(SourceText.From(string.Empty)), out var documentId); 1049var openResult = service.TryAddDocumentToWorkspace(fileOne.FilePath, new StaticSourceTextContainer(SourceText.From(string.Empty)), out var documentId); 1060Assert.Throws<System.InvalidOperationException>(() => service.TryAddDocumentToWorkspace(fileTwo.FilePath, new StaticSourceTextContainer(SourceText.From(string.Empty)), out var documentIdTwo));
QuickInfo\SemanticQuickInfoSourceTests.cs (3)
44var documentId = testDocument.Id; 121var documentId = sourceDocument.Id; 273var documentId = sourceDocument.Id;
Rename\CSharpInlineRenameServiceTests.cs (1)
63var documentId = workspace.Documents.Single().Id;
Workspaces\WorkspaceTests_EditorFeatures.cs (8)
761var newSolution = oldSolution.AddDocument(DocumentId.CreateNewId(project1.Id), "Doc2", SourceText.From(doc2Text)); 884var sourceGeneratedDocumentId = workspace.GetDocumentIdInCurrentContext(document.GetOpenTextContainer()); 1235var newDocId = DocumentId.CreateNewId(project.Id); 1271var newDocId = DocumentId.CreateNewId(project.Id); 1418var originalDocumentId = workspace.GetOpenDocumentIds().Single(id => !workspace.GetTestDocument(id).IsLinkFile); 1419var linkedDocumentId = workspace.GetOpenDocumentIds().Single(id => workspace.GetTestDocument(id).IsLinkFile);
Microsoft.CodeAnalysis.CSharp.Features (3)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
72var updatedDocumentRoots = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
39protected override async Task<ImmutableArray<(DocumentId, SyntaxNode)>> GetValidContainersFromAllLinkedDocumentsAsync(
ExtractInterface\CSharpExtractInterfaceService.cs (1)
67Solution unformattedSolution, IReadOnlyList<DocumentId> documentIds,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (17)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (17)
306var documentId = oldDocument.Id; 371var documentId = oldDocument.Id; 432var documentId = oldDocument.Id; 468var documentId = oldDocument.Id; 514var documentId = oldDocument.Id; 546var documentId = oldDocument.Id; 583var documentId = oldDocument.Id; 622var documentId = oldDocument.Id; 664var newDocId = DocumentId.CreateNewId(oldProject.Id); 677foreach (var changedDocumentId in changedDocuments) 710var newDocId = DocumentId.CreateNewId(oldProject.Id); 723foreach (var changedDocumentId in changedDocuments) 743var documentId = DocumentId.CreateNewId(oldProject.Id); 798var documentId = oldProject.Documents.Single().Id;
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Rename\CSharpRenameRewriterLanguageService.cs (1)
50private readonly DocumentId _documentId;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SymbolEditorTests.cs (1)
38DocumentId.CreateNewId(pid),
Microsoft.CodeAnalysis.EditorFeatures (94)
Classification\Syntactic\SyntacticClassificationTaggerProvider.ClassifiedLineCache.cs (3)
57private DocumentId? _documentId; 88DocumentId documentId, 112DocumentId documentId,
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (3)
272var documentId = args.NewActiveContextDocumentId; 273var bufferDocumentId = _workspace.GetDocumentIdInCurrentContext(_subjectBuffer.AsTextContainer()); 291var documentId = _workspace.GetDocumentIdInCurrentContext(_subjectBuffer.AsTextContainer());
EditAndContinue\ActiveStatementTrackingService.cs (4)
55public ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken) 93public ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken) 215foreach (var id in openDocumentIds) 313public async ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
EditAndContinue\ActiveStatementTrackingSpan.cs (2)
11internal readonly struct ActiveStatementTrackingSpan(ITrackingSpan trackingSpan, ActiveStatementId id, ActiveStatementFlags flags, DocumentId? unmappedDocumentId) 16public readonly DocumentId? UnmappedDocumentId = unmappedDocumentId;
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (2)
56protected async Task NavigateToPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, CancellationToken cancellationToken) 71internal virtual Task<(DocumentId documentId, int position, int virtualSpace)> GetNavigationLocationAsync(
Extensibility\NavigationBar\NavigationBarProjectItem.cs (2)
15DocumentId documentId, 22public DocumentId DocumentId { get; } = documentId;
ExternalAccess\IntelliCode\IntentProcessor.cs (3)
95using var _ = PooledDictionary<DocumentId, ImmutableArray<TextChange>>.GetInstance(out var results); 96foreach (var changedDocumentId in processorResult.ChangedDocuments) 112DocumentId changedDocumentId,
ExternalAccess\VSTypeScript\Api\IVSTypeScriptInlineRenameReplacementInfo.cs (3)
28public abstract IEnumerable<DocumentId> DocumentIds { get; } 33public abstract IEnumerable<VSTypeScriptInlineRenameReplacementWrapper> GetReplacements(DocumentId documentId); 35IEnumerable<InlineRenameReplacement> IInlineRenameReplacementInfo.GetReplacements(DocumentId documentId)
ExternalAccess\VSTypeScript\Api\VSTypeScriptExtensions.cs (1)
16public static void ApplyTextChanges(this Workspace workspace, DocumentId id, IEnumerable<TextChange> textChanges, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\Api\VSTypeScriptInlineRenameInfo.cs (2)
53bool IInlineRenameInfo.TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 56bool IInlineRenameInfo.TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText)
ExternalAccess\VSTypeScript\Api\VSTypeScriptRenameOperationProvider.cs (1)
11public static CodeActionOperation CreateRenameOperation(DocumentId documentId, int position)
InlineRename\AbstractEditorInlineRenameService.FailureInlineRenameInfo.cs (2)
48public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) => false; 50public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) => false;
InlineRename\AbstractEditorInlineRenameService.InlineRenameReplacementInfo.cs (4)
24public IEnumerable<DocumentId> DocumentIds => _conflicts.DocumentIds; 30public IEnumerable<InlineRenameReplacement> GetReplacements(DocumentId documentId) 38private IEnumerable<InlineRenameReplacement> GetNonComplexifiedReplacements(DocumentId documentId) 58private IEnumerable<InlineRenameReplacement> GetComplexifiedReplacements(DocumentId documentId)
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (2)
142public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 148public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText)
InlineRename\IEditorInlineRenameService.cs (4)
121IEnumerable<DocumentId> DocumentIds { get; } 126IEnumerable<InlineRenameReplacement> GetReplacements(DocumentId documentId); 235bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText); 241bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText);
InlineRename\InlineRenameSession.cs (1)
213foreach (var d in Workspace.GetOpenDocumentIds())
IntelliSense\NavigationActionFactory.cs (1)
48DocumentId documentId,
Interactive\InteractiveSession.cs (3)
209var newSubmissionDocumentId = DocumentId.CreateNewId(_currentSubmissionProjectId, newSubmissionProjectName); 233DocumentId.CreateNewId(initializationScriptProjectId, debugName: initializationScriptPath),
Interactive\InteractiveWorkspace.cs (3)
15private DocumentId? _openDocumentId; 28public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer) 35protected override void ApplyDocumentTextChanged(DocumentId document, SourceText newText)
IRefactorNotifyService.cs (2)
25bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure); 35bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure);
Navigation\IDocumentNavigationServiceExtensions.cs (7)
31this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, TextSpan textSpan, NavigationOptions options, bool allowInvalidSpan, CancellationToken cancellationToken) 38this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, TextSpan textSpan, NavigationOptions options, CancellationToken cancellationToken) 45this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken) 52this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, NavigationOptions options, CancellationToken cancellationToken) 59this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, int position, CancellationToken cancellationToken) 65this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, int position, NavigationOptions options, CancellationToken cancellationToken) 73this IDocumentNavigationService service, IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, int lineNumber, int offset, NavigationOptions options, CancellationToken cancellationToken)
Preview\AbstractPreviewFactoryService.cs (9)
93foreach (var documentId in projectChanges.GetChangedDocuments(onlyGetDocumentsWithTextChanges: true, ignoreUnchangeableDocuments)) 100foreach (var documentId in projectChanges.GetAddedDocuments()) 107foreach (var documentId in projectChanges.GetRemovedDocuments()) 114foreach (var documentId in projectChanges.GetChangedAdditionalDocuments()) 121foreach (var documentId in projectChanges.GetAddedAdditionalDocuments()) 128foreach (var documentId in projectChanges.GetRemovedAdditionalDocuments()) 135foreach (var documentId in projectChanges.GetChangedAnalyzerConfigDocuments()) 142foreach (var documentId in projectChanges.GetAddedAnalyzerConfigDocuments()) 149foreach (var documentId in projectChanges.GetRemovedAnalyzerConfigDocuments())
Preview\SolutionPreviewItem.cs (4)
16/// <param name="documentId"><see cref="DocumentId"/> for the <see cref="Document"/> being visualized in the supplied <paramref name="lazyPreview"/></param> 21internal class SolutionPreviewItem(ProjectId? projectId, DocumentId? documentId, Func<CancellationToken, Task<object?>> lazyPreview) 24public readonly DocumentId? DocumentId = documentId; 28public SolutionPreviewItem(ProjectId? projectId, DocumentId? documentId, string text)
Preview\SolutionPreviewResult.cs (1)
32public async Task<IReadOnlyList<object>?> GetPreviewsAsync(DocumentId? preferredDocumentId = null, ProjectId? preferredProjectId = null, CancellationToken cancellationToken = default)
Remote\SolutionChecksumUpdater.cs (2)
161private void OnActiveDocumentChanged(object? sender, DocumentId? e) 187var activeDocument = _documentTrackingService.TryGetActiveDocument();
RenameTracking\RenameTrackingTaggerProvider.cs (3)
61internal static void ResetRenameTrackingState(Workspace workspace, DocumentId documentId) 64internal static bool ResetVisibleRenameTrackingState(Workspace workspace, DocumentId documentId) 67internal static bool ResetRenameTrackingStateWorker(Workspace workspace, DocumentId documentId, bool visible)
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (2)
205private async Task<ISymbol> TryGetSymbolAsync(Solution solutionWithOriginalName, DocumentId documentId, CancellationToken cancellationToken) 258IEnumerable<DocumentId> changedDocuments,
SemanticSearch\SemanticSearchEditorWorkspace.cs (2)
27private DocumentId? _queryDocumentId; 44protected override void ApplyDocumentTextChanged(DocumentId documentId, SourceText newText)
Shared\Extensions\IRefactorNotifyServiceExtensions.cs (2)
14IEnumerable<DocumentId> changedDocuments, 33IEnumerable<DocumentId> changedDocuments,
Shared\Extensions\WorkspaceExtensions.cs (2)
32internal static void ApplyTextChanges(this Workspace workspace, DocumentId id, IEnumerable<TextChange> textChanges, CancellationToken cancellationToken) 39private static Solution UpdateDocument(this Solution solution, DocumentId id, IEnumerable<TextChange> textChanges, CancellationToken cancellationToken)
Shared\Preview\PreviewWorkspace.cs (5)
44public new void OpenDocument(DocumentId documentId, bool activate = true) 48public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer) 73public override void CloseDocument(DocumentId documentId) 82public override void CloseAdditionalDocument(DocumentId documentId) 91public override void CloseAnalyzerConfigDocument(DocumentId documentId)
Shared\Tagging\EventSources\TaggerEventSources.ParseOptionChangedEventSource.cs (1)
33var documentId = workspace.GetDocumentIdInCurrentContext(SubjectBuffer.AsTextContainer());
Shared\Utilities\RenameTrackingDismisser.cs (4)
12internal static void DismissRenameTracking(Workspace workspace, DocumentId documentId) 15internal static void DismissRenameTracking(Workspace workspace, IEnumerable<DocumentId> documentIds) 17foreach (var docId in documentIds) 23internal static bool DismissVisibleRenameTracking(Workspace workspace, DocumentId documentId)
Undo\IWorkspaceGlobalUndoTransaction.cs (1)
19void AddDocument(DocumentId id);
Undo\NoOpGlobalUndoServiceFactory.cs (1)
64public void AddDocument(DocumentId id)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (47)
Completion\AbstractCompletionProviderTests.cs (4)
813var documentId = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").Id; 869var documentId = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").Id; 899var currentContextDocumentId = testWorkspace.GetDocumentIdInCurrentContext(textContainer); 1093var documentId = workspace.GetDocumentId(hostDocument);
Diagnostics\MockDiagnosticAnalyzerService.cs (5)
58public Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 61public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 64public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
DocumentTracking\FirstDocumentIsActiveAndVisibleDocumentTrackingService.cs (3)
23public event EventHandler<DocumentId?> ActiveDocumentChanged { add { } remove { } } 25public DocumentId TryGetActiveDocument() 28public ImmutableArray<DocumentId> GetVisibleDocuments()
DocumentTracking\TestDocumentTrackingService.cs (5)
17private DocumentId? _activeDocumentId; 19public event EventHandler<DocumentId?>? ActiveDocumentChanged; 21public void SetActiveDocument(DocumentId? newActiveDocumentId) 27public DocumentId? TryGetActiveDocument() 30public ImmutableArray<DocumentId> GetVisibleDocuments()
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
406var generatedDocumentId = DocumentId.CreateNewId(workspace.CurrentSolution.ProjectIds.First());
NavigateTo\AbstractNavigateToTests.cs (3)
241public event EventHandler<DocumentId> ActiveDocumentChanged { add { } remove { } } 243public DocumentId TryGetActiveDocument() 246public ImmutableArray<DocumentId> GetVisibleDocuments()
Rename\RenamerTests.cs (8)
45var documentIdToDocumentInfoMap = new List<(DocumentId, DocumentWithInfo)>(); 56var documentId = DocumentId.CreateNewId(projectId); 180var documentIdToDocumentInfoMap = new List<(DocumentId, DocumentWithInfo)>(); 189var documentId = DocumentId.CreateNewId(projectId); 223var documentId = DocumentId.CreateNewId(projectId);
RenameTracking\MockRefactorNotifyService.cs (2)
22public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 34public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure)
SignatureHelp\AbstractSignatureHelpProviderTests.cs (2)
349var documentId = testWorkspace.Documents.First(d => d.Name == "SourceDocument").Id; 468var documentId = testWorkspace.Documents.Where(d => d.Name == "SourceDocument").Single().Id;
TaskList\AbstractTaskListTests.cs (1)
36var documentId = hostDocument.Id;
Workspaces\EditorTestHostDocument.cs (1)
86DocumentId? id = null,
Workspaces\EditorTestWorkspace.cs (8)
53DocumentId? id = null, 135protected override void ApplyDocumentTextChanged(DocumentId document, SourceText newText) 142protected override void ApplyAdditionalDocumentTextChanged(DocumentId document, SourceText newText) 149protected override void ApplyAnalyzerConfigDocumentTextChanged(DocumentId document, SourceText newText) 156public override void OpenDocument(DocumentId documentId, bool activate = true) 166public override void OpenAdditionalDocument(DocumentId documentId, bool activate = true) 176public override void OpenAnalyzerConfigDocument(DocumentId documentId, bool activate = true) 186public void OpenSourceGeneratedDocument(DocumentId documentId)
Workspaces\TestFormattingRuleFactoryServiceFactory.cs (3)
38public bool ShouldUseBaseIndentation(DocumentId documentId) 41public bool ShouldNotFormatOrCommitOnPaste(DocumentId documentId) 54public IEnumerable<TextChange> FilterFormattedChanges(DocumentId document, TextSpan span, IList<TextChange> changes)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (10)
Utilities\GoToHelpers\MockDocumentNavigationService.vb (5)
21Public _documentId As DocumentId 28Public Function CanNavigateToPositionAsync(workspace As Workspace, documentId As DocumentId, position As Integer, virtualSpace As Integer, allowInvalidPosition As Boolean, cancellationToken As CancellationToken) As Task(Of Boolean) Implements IDocumentNavigationService.CanNavigateToPositionAsync 32Public Function CanNavigateToSpanAsync(workspace As Workspace, documentId As DocumentId, textSpan As TextSpan, allowInvalidSpan As Boolean, cancellationToken As CancellationToken) As Task(Of Boolean) Implements IDocumentNavigationService.CanNavigateToSpanAsync 36Public Function GetLocationForPositionAsync(workspace As Workspace, documentId As DocumentId, position As Integer, virtualSpace As Integer, allowInvalidPosition As Boolean, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements IDocumentNavigationService.GetLocationForPositionAsync 47Public Function GetLocationForSpanAsync(workspace As Workspace, documentId As DocumentId, textSpan As TextSpan, allowInvalidSpan As Boolean, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements IDocumentNavigationService.GetLocationForSpanAsync
Utilities\MockDocumentNavigationServiceProvider.vb (5)
34Public ProvidedDocumentId As DocumentId 45Public Function CanNavigateToPosition(workspace As Workspace, documentId As DocumentId, position As Integer, virtualSpace As Integer, allowInvalidPosition As Boolean, cancellationToken As CancellationToken) As Task(Of Boolean) Implements IDocumentNavigationService.CanNavigateToPositionAsync 53Public Function CanNavigateToSpanAsync(workspace As Workspace, documentId As DocumentId, textSpan As TextSpan, allowInvalidSpan As Boolean, cancellationToken As CancellationToken) As Task(Of Boolean) Implements IDocumentNavigationService.CanNavigateToSpanAsync 60Public Function GetLocationForPositionAsync(workspace As Workspace, documentId As DocumentId, position As Integer, virtualSpace As Integer, allowInvalidPosition As Boolean, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements IDocumentNavigationService.GetLocationForPositionAsync 68Public Function GetLocationForSpanAsync(workspace As Workspace, documentId As DocumentId, textSpan As TextSpan, allowInvalidSpans As Boolean, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements IDocumentNavigationService.GetLocationForSpanAsync
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (18)
CodeGeneration\CodeGenerationTests.cs (2)
630var documentId = DocumentId.CreateNewId(projectId);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
310DocumentId.CreateNewId(projectId), 389DocumentId.CreateNewId(projectId),
Diagnostics\DiagnosticDataTests.cs (1)
185var documentId = hostDocument.Id;
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
65var documentId = workspace.Documents[0].Id;
EditAndContinue\EditAndContinueLanguageServiceTests.cs (4)
115DocumentId documentId; 119.AddDocument(documentId = DocumentId.CreateNewId(projectId), "test.cs", SourceText.From("class C { }", Encoding.UTF8), filePath: "test.cs")); 242var documentId = DocumentId.CreateNewId(projectId);
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (2)
77var documentId = workspace.Documents.Single(d => !d.IsLinkFile).Id; 80var linkedDocumentId = workspace.Documents.Single(d => d.IsLinkFile).Id;
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
303Assert.True(_metadataAsSourceService.TryAddDocumentToWorkspace(file.FilePath, stringText.Container, out var _));
SymbolFinder\DependentTypeFinderTests.cs (2)
31var did = DocumentId.CreateNewId(pid);
TextEditor\OpenDocumentTests.cs (3)
38var documentIds = new List<DocumentId>(); 42var documentId = DocumentId.CreateNewId(projectId);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (4)
Interactive\InteractiveDocumentNavigationService.cs (2)
27public override Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken) 30public override async Task<INavigableLocation?> GetLocationForSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken)
Interactive\InteractiveGlobalUndoServiceFactory.cs (1)
77public void AddDocument(DocumentId id)
Suggestions\SuggestedActionWithNestedFlavors.cs (1)
158var preferredDocumentId = Workspace.GetDocumentIdInCurrentContext(SubjectBuffer.AsTextContainer());
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (8)
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
45Dim newSln = workspace.CurrentSolution.AddAdditionalDocument(DocumentId.CreateNewId(project.Id), "App.Config", SourceText.From("false"))
Diagnostics\DiagnosticProviderTests.vb (5)
298Dim documentId As DocumentId 328Private Shared Function GetDocumentId(workspace As EditorTestWorkspace, document As String) As DocumentId 334Private Shared Function SourceError(id As String, message As String, docId As DocumentId, projId As ProjectId, mappedLine As Integer, originalLine As Integer, mappedColumn As Integer, 339Private Shared Function SourceWarning(id As String, message As String, docId As DocumentId, projId As ProjectId, mappedLine As Integer, originalLine As Integer, mappedColumn As Integer, 344Private Shared Function CreateDiagnostic(id As String, message As String, severity As DiagnosticSeverity, docId As DocumentId, projId As ProjectId, mappedLine As Integer, originalLine As Integer, mappedColumn As Integer,
Diagnostics\DiagnosticServiceTests.vb (1)
54Public Overrides Function LoadTextAndVersionAsync(workspace As Workspace, documentId As DocumentId, cancellationToken As CancellationToken) As Task(Of TextAndVersion)
Rename\InlineRenameTests.vb (1)
246Optional fileToRename As DocumentId = Nothing) As Task
Microsoft.CodeAnalysis.ExternalAccess.Copilot (2)
Internal\RelatedDocuments\CSharpCopilotRelatedDocumentsService.cs (1)
26public ValueTask GetRelatedDocumentIdsAsync(Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken)
RelatedDocuments\ICopilotRelatedDocumentsService.cs (1)
16Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.ExternalAccess.Debugger (1)
GlassTestsHotReloadService.cs (1)
37captureMatchingDocuments: ImmutableArray<DocumentId>.Empty,
Microsoft.CodeAnalysis.ExternalAccess.FSharp (24)
Diagnostics\IFSharpDiagnosticAnalyzerService.cs (1)
16void Reanalyze(Workspace workspace, IEnumerable<ProjectId> projectIds = null, IEnumerable<DocumentId> documentIds = null, bool highPriority = false);
Editor\IFSharpEditorInlineRenameService.cs (4)
33IEnumerable<DocumentId> DocumentIds { get; } 38IEnumerable<FSharpInlineRenameReplacement> GetReplacements(DocumentId documentId); 135bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText); 141bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText);
Editor\IFSharpIndentationService.cs (1)
64FSharpIndentationResult? GetDesiredIndentation(HostLanguageServices services, SourceText text, DocumentId documentId, string path, int lineNumber, FSharpIndentationOptions options);
Editor\InlineRename\FSharpInlineRenameInfo.cs (2)
57bool IInlineRenameInfo.TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 60bool IInlineRenameInfo.TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText)
Editor\InlineRename\FSharpInlineRenameReplacementInfo.cs (3)
30public abstract IEnumerable<DocumentId> DocumentIds { get; } 35public abstract IEnumerable<FSharpInlineRenameReplacement> GetReplacements(DocumentId documentId); 37IEnumerable<InlineRenameReplacement> IInlineRenameReplacementInfo.GetReplacements(DocumentId documentId)
Internal\Diagnostics\FSharpDiagnosticAnalyzerService.cs (1)
28public void Reanalyze(Workspace workspace, IEnumerable<ProjectId> projectIds = null, IEnumerable<DocumentId> documentIds = null, bool highPriority = false)
Internal\Editor\FSharpEditorInlineRenameService.cs (4)
77public IEnumerable<DocumentId> DocumentIds => _info.DocumentIds; 79public IEnumerable<InlineRenameReplacement> GetReplacements(DocumentId documentId) 170public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 175public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText)
Navigation\FSharpDocumentNavigationService.cs (4)
23public bool CanNavigateToSpan(Workspace workspace, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken) 30public bool CanNavigateToPosition(Workspace workspace, DocumentId documentId, int position, int virtualSpace, CancellationToken cancellationToken) 37public bool TryNavigateToSpan(Workspace workspace, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken) 45public bool TryNavigateToPosition(Workspace workspace, DocumentId documentId, int position, int virtualSpace, CancellationToken cancellationToken)
Navigation\IFSharpDocumentNavigationService.cs (4)
17bool CanNavigateToSpan(Workspace workspace, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken); 19bool CanNavigateToPosition(Workspace workspace, DocumentId documentId, int position, int virtualSpace, CancellationToken cancellationToken); 22bool TryNavigateToSpan(Workspace workspace, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken); 24bool TryNavigateToPosition(Workspace workspace, DocumentId documentId, int position, int virtualSpace, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
Workspace\OmniSharpDocumentId.cs (2)
11public static DocumentId CreateFromSerialized(ProjectId projectId, Guid id, bool isSourceGenerated, string? debugName) 12=> DocumentId.CreateFromSerialized(projectId, id, isSourceGenerated, debugName);
Microsoft.CodeAnalysis.ExternalAccess.Razor (6)
Remote\JsonSerializableDocumentId.cs (3)
17public static implicit operator JsonSerializableDocumentId(DocumentId documentId) 22public static implicit operator DocumentId(JsonSerializableDocumentId serializableDocumentId) 24return DocumentId.CreateFromSerialized(CodeAnalysis.ProjectId.CreateFromSerialized(serializableDocumentId.ProjectId), serializableDocumentId.Id);
SolutionExtensions.cs (1)
15public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, Uri documentUri)
Testing\AbstractRazorLanguageServerFactoryWrapper.cs (1)
21DocumentId id,
Testing\RazorTestLanguageServerFactory.cs (1)
46DocumentId id,
Microsoft.CodeAnalysis.Features (338)
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
97DocumentId changedDocumentId, 102private readonly DocumentId _changedDocumentId = changedDocumentId;
AddImport\Remote\IRemoteMissingImportDiscoveryService.cs (2)
27Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DocumentId documentId, TextSpan span, string diagnosticId, int maxResults, 31Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DocumentId id, TextSpan span, ImmutableArray<string> diagnosticIds,
ChangeSignature\AbstractChangeSignatureService.cs (9)
255var nodesToUpdate = new Dictionary<DocumentId, List<SyntaxNode>>(); 337if (!TryGetNodeWithEditableSignatureOrAttributes(def, currentSolution, out var nodeToUpdate, out var documentId)) 361if (!TryGetNodeWithEditableSignatureOrAttributes(location.Location, currentSolution, out var nodeToUpdate2, out var documentId2)) 377var updatedRoots = new Dictionary<DocumentId, SyntaxNode>(); 378foreach (var docId in nodesToUpdate.Keys) 416var changedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync( 443private static void AddUpdatableNodeToDictionaries(Dictionary<DocumentId, List<SyntaxNode>> nodesToUpdate, DocumentId documentId, SyntaxNode nodeToUpdate, Dictionary<SyntaxNode, ISymbol> definitionToUse, ISymbol symbolWithSemanticParameters) 454private static bool TryGetNodeWithEditableSignatureOrAttributes(Location location, Solution solution, out SyntaxNode nodeToUpdate, out DocumentId documentId)
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
330var id = DocumentId.CreateNewId(project.Id);
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (9)
248private static async Task<IReadOnlyDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>>> GetDocumentIdToChangedDocumentsAsync( 254var documentIdToChangedDocuments = new ConcurrentDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>>(); 270private static async Task<ImmutableArray<(DocumentId documentId, SourceText newText)>> GetDocumentIdToFinalTextAsync( 272IReadOnlyDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>> documentIdToChangedDocuments, 283var documentIdToFinalText = new ConcurrentDictionary<DocumentId, SourceText>(); 298ConcurrentDictionary<DocumentId, SourceText> documentIdToFinalText, 340private static readonly Func<DocumentId, ConcurrentBag<(CodeAction, Document)>> s_getValue = 345ConcurrentDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>> documentIdToChangedDocuments, 369foreach (var documentId in documentIdsWithChanges)
CodeLens\CodeLensReferencesService.cs (6)
42private static async Task<T?> FindAsync<T>(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, 89public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults, CancellationToken cancellationToken) 148var documentId = solution.GetDocument(location.SourceTree)?.Id; 202public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken) 259public Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken) 275public async Task<string> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CodeLens\ICodeLensReferencesService.cs (4)
23Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, CancellationToken cancellationToken); 28Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken); 33Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken); 38Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
CodeLens\IRemoteCodeLensReferencesService.cs (4)
16ValueTask<ReferenceCount?> GetReferenceCountAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, int maxResultCount, CancellationToken cancellationToken); 17ValueTask<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken); 18ValueTask<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken); 19ValueTask<string> GetFullyQualifiedNameAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (5)
48var newDocumentId = DocumentId.CreateNewId(projectToBeUpdated.Id, FileName); 76Solution solution, DocumentId sourceDocumentId, DocumentId documentWithMovedTypeId) 111private async Task<Document> AddNewDocumentWithSingleTypeDeclarationAsync(DocumentId newDocumentId)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (14)
95protected abstract Task<ImmutableArray<(DocumentId id, SyntaxNode container)>> GetValidContainersFromAllLinkedDocumentsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 222using var _ = PooledHashSet<DocumentId>.GetInstance(out var referenceDocuments); 267protected async Task<ImmutableArray<(DocumentId, SyntaxNode)>> TryGetApplicableContainersFromAllDocumentsAsync( 269ImmutableArray<DocumentId> ids, 279using var _1 = ArrayBuilder<(DocumentId, SyntaxNode)>.GetInstance(ids.Length, out var containers); 310protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken) 345protected static bool IsSupportedLinkedDocument(Document document, out ImmutableArray<DocumentId> allDocumentIds) 426private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync( 428DocumentId id, 486var fixedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync( 757ImmutableArray<DocumentId> ids, 761using var _1 = PooledHashSet<DocumentId>.GetInstance(out var linkedDocumentsToSkip); 764foreach (var id in ids) 774var changedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (2)
41var newDocumentId = DocumentId.CreateNewId(document.Project.Id, document.Name);
CodeRefactorings\SyncNamespace\SyncNamespaceDocumentsNotInSolutionException.cs (2)
11internal sealed class SyncNamespaceDocumentsNotInSolutionException(ImmutableArray<DocumentId> documentIds) : Exception 13private readonly ImmutableArray<DocumentId> _documentIds = documentIds;
Common\DocumentNavigationOperation.cs (2)
20public class DocumentNavigationOperation(DocumentId documentId, int position = 0) : CodeActionOperation 22internal DocumentId DocumentId { get; } = documentId ?? throw new ArgumentNullException(nameof(documentId));
Common\StartInlineRenameSessionOperation.cs (2)
20internal sealed class StartInlineRenameSessionOperation(DocumentId documentId, int position) : CodeActionOperation 22public DocumentId DocumentId { get; } = documentId ?? throw new ArgumentNullException(nameof(documentId));
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
32foreach (var documentId in solution.GetRelatedDocumentIds(originatingDocument.Id))
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (2)
218foreach (var relatedId in relatedDocumentIds) 230async Task<CompletionDescription?> TryGetDescriptionAsync(DocumentId documentId)
Completion\Providers\AbstractSymbolCompletionProvider.cs (7)
309using var _ = PooledDictionary<DocumentId, int>.GetInstance(out var documentIdToIndex); 311foreach (var documentId in relatedDocumentIds) 337ImmutableArray<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)> linkedContextSymbolLists) 353private async Task<ImmutableArray<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)>> GetPerContextSymbolsAsync( 354CompletionContext completionContext, Document document, CompletionOptions options, IEnumerable<DocumentId> relatedDocuments, CancellationToken cancellationToken) 358return await ProducerConsumer<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)>.RunParallelAsync( 398ImmutableArray<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)> linkedContextSymbolLists)
Completion\Providers\ImportCompletionProvider\IRemoteExtensionMethodImportCompletionService.cs (1)
15DocumentId documentId,
Completion\Providers\SymbolCompletionItem.cs (1)
150foreach (var id in linkedIds)
Completion\SharedSyntaxContextsWithSpeculativeModel.cs (1)
21private readonly Lazy<ImmutableArray<DocumentId>> _lazyRelatedDocumentIds;
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (2)
251(DocumentId documentId, TextSpan span) renamedToken, 590var docId = currentDoc.Id;
ConvertTupleToStruct\IRemoteConvertTupleToStructCodeRefactoringService.cs (5)
17DocumentId documentId, 26ImmutableArray<(DocumentId, ImmutableArray<TextChange>)> documentTextChanges, 27(DocumentId, TextSpan) renamedToken) 30public readonly ImmutableArray<(DocumentId, ImmutableArray<TextChange>)> DocumentTextChanges = documentTextChanges; 33public readonly (DocumentId, TextSpan) RenamedToken = renamedToken;
DesignerAttribute\DesignerAttributeData.cs (1)
25public DocumentId DocumentId;
DesignerAttribute\DesignerAttributeDiscoveryService.cs (6)
60private readonly ConcurrentDictionary<DocumentId, (string? category, VersionStamp projectVersion)> _documentToLastReportedInformation = []; 121DocumentId priorityDocumentId, 237foreach (var documentId in project.DocumentIds) 267Project project, DocumentId documentId, string filePath, bool hasDesignerCategoryType, string? existingCategory) 285bool hasDesignerCategoryType, Project project, DocumentId documentId, string? existingCategory, CancellationToken cancellationToken) 399var priorityDocumentId = activeDocument.Id;
DesignerAttribute\IDesignerAttributeDiscoveryService.cs (1)
27ValueTask ProcessPriorityDocumentAsync(Solution solution, DocumentId priorityDocumentId, ICallback callback, CancellationToken cancellationToken);
DesignerAttribute\IRemoteDesignerAttributeDiscoveryService.cs (1)
27ValueTask DiscoverDesignerAttributesAsync(RemoteServiceCallbackId callbackId, Checksum solutionChecksum, DocumentId priorityDocument, CancellationToken cancellationToken);
Diagnostics\CodeAnalysisDiagnosticAnalyzerService.cs (1)
140public Task<ImmutableArray<DiagnosticData>> GetLastComputedDocumentDiagnosticsAsync(DocumentId documentId, CancellationToken cancellationToken)
Diagnostics\DiagnosticArguments.cs (2)
43public DocumentId? DocumentId; 89DocumentId? documentId,
Diagnostics\DiagnosticsUpdatedArgs.cs (4)
24public readonly DocumentId? DocumentId; 30DocumentId? documentId, 47DocumentId? documentId, 56DocumentId? documentId)
Diagnostics\ICodeAnalysisDiagnosticAnalyzerService.cs (1)
42Task<ImmutableArray<DiagnosticData>> GetLastComputedDocumentDiagnosticsAsync(DocumentId documentId, CancellationToken cancellationToken);
Diagnostics\IDiagnosticAnalyzerService.cs (5)
49Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 79Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocumentIds, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 167this IDiagnosticAnalyzerService service, Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
DocumentHighlighting\IRemoteDocumentHighlightsService.cs (4)
16Checksum solutionChecksum, DocumentId documentId, int position, ImmutableArray<DocumentId> documentIdsToSearch, HighlightingOptions options, CancellationToken cancellationToken); 20internal readonly struct SerializableDocumentHighlights(DocumentId documentId, ImmutableArray<HighlightSpan> highlightSpans) 23public readonly DocumentId DocumentId = documentId;
DocumentIdSpan.cs (2)
18internal readonly record struct DocumentIdSpan(DocumentId documentId, TextSpan sourceSpan) 21public readonly DocumentId DocumentId = documentId;
EditAndContinue\ActiveStatementProvider.cs (1)
14internal delegate ValueTask<ImmutableArray<ActiveStatementSpan>> ActiveStatementSpanProvider(DocumentId? documentId, string filePath, CancellationToken cancellationToken);
EditAndContinue\ActiveStatementSpan.cs (1)
26[property: DataMember(Order = 3)] DocumentId? UnmappedDocumentId = null);
EditAndContinue\CommittedSolution.cs (10)
89private readonly Dictionary<DocumentId, DocumentState> _documentState = []; 93public CommittedSolution(DebuggingSession debuggingSession, Solution solution, IEnumerable<KeyValuePair<DocumentId, DocumentState>> initialDocumentStates) 101internal void Test_SetDocumentState(DocumentId documentId, DocumentState state) 110internal ImmutableArray<(DocumentId id, DocumentState state)> Test_GetDocumentStates() 127public ImmutableArray<DocumentId> GetDocumentIdsWithFilePath(string path) 130public bool ContainsDocument(DocumentId documentId) 140public async Task<(Document? Document, DocumentState State)> GetDocumentAndStateAsync(DocumentId documentId, Document? currentDocument, CancellationToken cancellationToken, bool reloadOutOfSyncDocument = false) 347internal static async Task<IEnumerable<KeyValuePair<DocumentId, DocumentState>>> GetMatchingDocumentsAsync( 363return Array.Empty<DocumentId?>(); 369return Array.Empty<DocumentId?>();
EditAndContinue\DebuggingSession.cs (7)
111IEnumerable<KeyValuePair<DocumentId, CommittedSolution.DocumentState>> initialDocumentStates, 615public async ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 632var documentId = documentIds[i]; 656using var _3 = PooledDictionary<ActiveStatement, ArrayBuilder<(DocumentId unmappedDocumentId, LinePositionSpan span)>>.GetInstance( 676await foreach (var documentId in EditSession.GetChangedDocumentsAsync(oldProject, newProject, cancellationToken).ConfigureAwait(false)) 736DocumentId? unmappedDocumentId; 808await foreach (var unmappedDocumentId in EditSession.GetChangedDocumentsAsync(oldProject, newProject, cancellationToken).ConfigureAwait(false))
EditAndContinue\DocumentAnalysisResults.cs (4)
19public DocumentId DocumentId { get; } 108DocumentId documentId, 191public static DocumentAnalysisResults SyntaxErrors(DocumentId documentId, string filePath, ImmutableArray<RudeEditDiagnostic> rudeEdits, Diagnostic? syntaxError, TimeSpan elapsedTime, bool hasChanges) 210public static DocumentAnalysisResults Unchanged(DocumentId documentId, string filePath, TimeSpan elapsedTime)
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (1)
27private readonly Dictionary<DocumentId, (AsyncLazy<DocumentAnalysisResults> results, Project baseProject, Document document, ImmutableArray<ActiveStatementLineSpan> activeStatementSpans)> _analyses = [];
EditAndContinue\EditAndContinueService.cs (4)
139ImmutableArray<DocumentId> captureMatchingDocuments, 148IEnumerable<KeyValuePair<DocumentId, CommittedSolution.DocumentState>> initialDocumentStates; 184private static IEnumerable<(Project, IEnumerable<DocumentState>)> GetDocumentStatesGroupedByProject(Solution solution, ImmutableArray<DocumentId> documentIds) 252public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
EditAndContinue\EditSession.cs (4)
270var documentId = newDocumentIds.First(); 482/// Enumerates <see cref="DocumentId"/>s of changed (not added or removed) <see cref="Document"/>s (not additional nor analyzer config). 484internal static async IAsyncEnumerable<DocumentId> GetChangedDocumentsAsync(Project oldProject, Project newProject, [EnumeratorCancellation] CancellationToken cancellationToken) 812using var _6 = ArrayBuilder<(DocumentId, ImmutableArray<RudeEditDiagnostic>)>.GetInstance(out var documentsWithRudeEdits);
EditAndContinue\IActiveStatementSpanFactory.cs (2)
24/// Returns <see cref="DocumentId"/> of the unmapped document containing the active statement (i.e. the document that has the #line directive mapping the statement to one of the specified <paramref name="documentIds"/>), 27ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken);
EditAndContinue\IActiveStatementSpanLocator.cs (1)
18ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken);
EditAndContinue\IEditAndContinueService.cs (2)
27ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Solution solution, IManagedHotReloadService debuggerService, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken); 31ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken);
EditAndContinue\Remote\ActiveStatementSpanProviderCallback.cs (1)
20public async ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(DocumentId? documentId, string filePath, CancellationToken cancellationToken)
EditAndContinue\Remote\IRemoteEditAndContinueService.cs (5)
25ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(RemoteServiceCallbackId callbackId, DocumentId? documentId, string filePath, CancellationToken cancellationToken); 29ValueTask<ImmutableArray<DiagnosticData>> GetDocumentDiagnosticsAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DocumentId documentId, CancellationToken cancellationToken); 38ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken); 49ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Checksum solutionChecksum, DebuggingSessionId sessionId, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken); 50ValueTask<ImmutableArray<ActiveStatementSpan>> GetAdjustedActiveStatementSpansAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DebuggingSessionId sessionId, DocumentId documentId, CancellationToken cancellationToken);
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (1)
136public async ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
EditAndContinue\Remote\RemoteEditAndContinueServiceProxy.cs (1)
32public ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(RemoteServiceCallbackId callbackId, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
EditAndContinue\SolutionUpdate.cs (3)
16ImmutableArray<(DocumentId DocumentId, ImmutableArray<RudeEditDiagnostic> Diagnostics)> documentsWithRudeEdits, 23public readonly ImmutableArray<(DocumentId DocumentId, ImmutableArray<RudeEditDiagnostic> Diagnostics)> DocumentsWithRudeEdits = documentsWithRudeEdits; 28ImmutableArray<(DocumentId, ImmutableArray<RudeEditDiagnostic>)> documentsWithRudeEdits,
EditAndContinue\TraceLog.cs (1)
90public static implicit operator Arg(DocumentId value) => new(value.DebugName);
EncapsulateField\AbstractEncapsulateFieldService.cs (5)
123var result = await client.TryInvokeAsync<IRemoteEncapsulateFieldService, ImmutableArray<(DocumentId, ImmutableArray<TextChange>)>>( 279Func<DocumentId, TextSpan, bool> filter, 296private static bool IntersectsWithAny(DocumentId documentId, TextSpan span, ISet<(DocumentId documentId, TextSpan span)> constructorLocations) 310private ISet<(DocumentId documentId, TextSpan span)> GetConstructorLocations(Solution solution, INamedTypeSymbol containingType)
EncapsulateField\IRemoteEncapsulateFieldService.cs (2)
16ValueTask<ImmutableArray<(DocumentId, ImmutableArray<TextChange>)>> EncapsulateFieldsAsync( 18DocumentId documentId,
ExternalAccess\UnitTesting\API\INewUnitTestingIncrementalAnalyzerImplementation.cs (1)
22void RemoveDocument(DocumentId documentId);
ExternalAccess\UnitTesting\API\NewUnitTestingIncrementalAnalyzer.cs (1)
39public Task RemoveDocumentAsync(DocumentId documentId, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingIncrementalAnalyzer.cs (1)
25Task RemoveDocumentAsync(DocumentId documentId, CancellationToken cancellationToken);
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingSolutionCrawlerService.cs (2)
16/// Ask solution crawler to re-analyze given <see cref="ProjectId"/>s or/and <see cref="DocumentId"/>s 19void Reanalyze(string? workspaceKind, SolutionServices services, IUnitTestingIncrementalAnalyzer analyzer, IEnumerable<ProjectId>? projectIds = null, IEnumerable<DocumentId>? documentIds = null);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerLogger.cs (1)
155CountLogAggregator<object> logAggregator, string language, DocumentId? documentId, UnitTestingInvocationReasons reasons, bool lowPriority, SyntaxPath? activeMember, bool added)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
128public void Reanalyze(string? workspaceKind, SolutionServices services, IUnitTestingIncrementalAnalyzer analyzer, IEnumerable<ProjectId>? projectIds, IEnumerable<DocumentId>? documentIds)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerService.cs (1)
30public void Reanalyze(string? workspaceKind, SolutionServices services, IUnitTestingIncrementalAnalyzer analyzer, IEnumerable<ProjectId>? projectIds = null, IEnumerable<DocumentId>? documentIds = null)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (19)
263private void EnqueueFullDocumentEvent(Solution solution, DocumentId documentId, UnitTestingInvocationReasons invocationReasons, string eventName) 275private void EnqueueDocumentChangedEvent(Solution oldSolution, Solution newSolution, DocumentId documentId, string eventName) 325private async Task EnqueueDocumentWorkItemAsync(Project project, DocumentId documentId, TextDocument? document, UnitTestingInvocationReasons invocationReasons, SyntaxNode? changedMember = null) 350private static Document GetRequiredDocument(Project project, DocumentId documentId, Document? document) 367foreach (var documentId in project.DocumentIds) 370foreach (var documentId in project.AdditionalDocumentIds) 373foreach (var documentId in project.AnalyzerConfigDocumentIds) 396IUnitTestingIncrementalAnalyzer analyzer, Project project, DocumentId documentId, Document? document, UnitTestingInvocationReasons invocationReasons) 411foreach (var addedDocumentId in projectChanges.GetAddedDocuments()) 414foreach (var changedDocumentId in projectChanges.GetChangedDocuments()) 420foreach (var removedDocumentId in projectChanges.GetRemovedDocuments()) 523public UnitTestingReanalyzeScope(IEnumerable<ProjectId>? projectIds = null, IEnumerable<DocumentId>? documentIds = null) 531foreach (var documentId in documentIds) 574case DocumentId documentId: 622case DocumentId documentId: 633public IEnumerable<(Project project, DocumentId documentId)> GetDocumentIds(Solution solution) 644foreach (var documentId in project.DocumentIds) 662foreach (var documentId in project.DocumentIds) 668case DocumentId documentId:
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncDocumentWorkItemQueue.cs (10)
16private sealed class UnitTestingAsyncDocumentWorkItemQueue(UnitTestingSolutionCrawlerProgressReporter progressReporter) : UnitTestingAsyncWorkItemQueue<DocumentId>(progressReporter) 18private readonly Dictionary<ProjectId, Dictionary<DocumentId, UnitTestingWorkItem>> _documentWorkQueue = []; 22protected override bool TryTake_NoLock(DocumentId key, out UnitTestingWorkItem workInfo) 33SharedPools.BigDefault<Dictionary<DocumentId, UnitTestingWorkItem>>().ClearAndFree(documentMap); 53var documentId = GetBestDocumentId_NoLock(preferableProjectId); 62private DocumentId GetBestDocumentId_NoLock( 74DocumentId? lowPriorityDocumentId = null; 98var key = item.DocumentId; 115documentMap = SharedPools.BigDefault<Dictionary<DocumentId, UnitTestingWorkItem>>().AllocateAndClear(); 140SharedPools.BigDefault<Dictionary<DocumentId, UnitTestingWorkItem>>().ClearAndFree(map);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (1)
247if (documentOrProjectId is DocumentId documentId)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (6)
34private readonly ConcurrentDictionary<DocumentId, /*unused*/ object?> _higherPriorityDocumentsNotProcessed; 54_higherPriorityDocumentsNotProcessed = new ConcurrentDictionary<DocumentId, object?>(concurrencyLevel: 2, capacity: 20); 89private void AddHigherPriorityDocument(DocumentId id) 180var documentId = workItem.DocumentId; 289private Task RemoveDocumentAsync(DocumentId documentId, CancellationToken cancellationToken) 292private static async Task RemoveDocumentAsync(ImmutableArray<IUnitTestingIncrementalAnalyzer> analyzers, DocumentId documentId, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (8)
31private static readonly Func<int, DocumentId, bool, string> s_enqueueLogger = (tick, documentId, hint) => $"Tick:{tick}, {documentId}, {documentId.ProjectId}, hint:{hint}"; 39private readonly Dictionary<DocumentId, UnitTestingData> _pendingWork = []; 183var documentId = solution.GetDocumentId(location.SourceTree, projectId); 243public void Enqueue(Project project, DocumentId documentId, Document? document, SyntaxPath? changedMember) 308private readonly struct UnitTestingData(Project project, DocumentId documentId, Document? document, SyntaxPath? changedMember, IAsyncToken asyncToken) 310private readonly DocumentId _documentId = documentId; 382public async Task EnqueueWorkItemAsync(Project project, DocumentId documentId, Document? document) 435foreach (var documentId in project.DocumentIds)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingWorkItem.cs (4)
26public readonly DocumentId? DocumentId; 56DocumentId? documentId, 82public UnitTestingWorkItem(DocumentId documentId, string language, UnitTestingInvocationReasons invocationReasons, bool isLowPriority, SyntaxPath? activeMember, IAsyncToken asyncToken) 87public UnitTestingWorkItem(DocumentId documentId, string language, UnitTestingInvocationReasons invocationReasons, bool isLowPriority, IUnitTestingIncrementalAnalyzer? analyzer, IAsyncToken asyncToken)
ExternalAccess\VSTypeScript\Api\IVSTypeScriptDiagnosticAnalyzerService.cs (1)
17void Reanalyze(Workspace? workspace = null, IEnumerable<ProjectId>? projectIds = null, IEnumerable<DocumentId>? documentIds = null, bool highPriority = false);
ExternalAccess\VSTypeScript\Api\VSTypeScriptDiagnosticsUpdatedArgsWrapper.cs (1)
16public DocumentId? DocumentId
ExternalAccess\VSTypeScript\Api\VSTypeScriptDocumentNavigationServiceWrapper.cs (3)
25public bool TryNavigateToPosition(Workspace workspace, DocumentId documentId, int position, int virtualSpace = 0, OptionSet? options = null) 29public bool TryNavigateToPosition(Workspace workspace, DocumentId documentId, int position, int virtualSpace, OptionSet? options, CancellationToken cancellationToken) 41public bool TryNavigateToPosition(Workspace workspace, DocumentId documentId, int position, int virtualSpace, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptDiagnosticAnalyzerService.cs (1)
22public void Reanalyze(Workspace? workspace, IEnumerable<ProjectId>? projectIds, IEnumerable<DocumentId>? documentIds, bool highPriority)
ExtractInterface\AbstractExtractInterfaceService.cs (5)
40IReadOnlyList<DocumentId> documentId, 283private static async Task<Solution> GetFormattedSolutionAsync(Solution unformattedSolution, IEnumerable<DocumentId> documentIds, CancellationToken cancellationToken) 289foreach (var documentId in documentIds) 315ImmutableArray<DocumentId> documentIds, 332foreach (var documentId in documentIds)
ExtractInterface\ExtractInterfaceResult.cs (2)
9internal sealed class ExtractInterfaceResult(bool succeeded, Solution updatedSolution = null, DocumentId navigationDocumentId = null) 13public DocumentId NavigationDocumentId { get; } = navigationDocumentId;
FullyQualify\IRemoteFullyQualifyService.cs (1)
13ValueTask<FullyQualifyFixData?> GetFixDataAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan span, CancellationToken cancellationToken);
GenerateType\AbstractGenerateTypeService.Editor.cs (4)
272var newDocumentId = DocumentId.CreateNewId(projectToBeUpdated.Id, debugName: documentName); 348var documentId = DocumentId.CreateNewId(projectToBeUpdated.Id, documentName);
InheritanceMargin\IRemoteInheritanceMarginService.cs (1)
16DocumentId documentId,
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
341var calleeDocumentId = solution.GetDocumentId(calleeMethodNode.SyntaxTree);
Intents\IntentResult.cs (2)
13internal readonly struct IntentProcessorResult(Solution solution, ImmutableArray<DocumentId> changedDocuments, string title, string actionName) 23public readonly ImmutableArray<DocumentId> ChangedDocuments = changedDocuments;
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
245var changedRoots = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
LegacySolutionEvents\IRemoteLegacySolutionEventsAggregationService.cs (1)
24ValueTask OnWorkspaceChangedAsync(Checksum oldSolutionChecksum, Checksum newSolutionChecksum, WorkspaceChangeKind kind, ProjectId? projectId, DocumentId? documentId, CancellationToken cancellationToken);
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (3)
61private IBidirectionalMap<MetadataAsSourceGeneratedFileInfo, DocumentId> _openedDocumentIds = BidirectionalMap<MetadataAsSourceGeneratedFileInfo, DocumentId>.Empty; 292public bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
MetadataAsSource\IMetadataAsSourceFileProvider.cs (1)
40bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId);
MetadataAsSource\IMetadataAsSourceFileService.cs (1)
39bool TryAddDocumentToWorkspace(string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId);
MetadataAsSource\MetadataAsSourceFileService.cs (1)
166public bool TryAddDocumentToWorkspace(string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (5)
58public (ProjectInfo, DocumentId) GetProjectInfoAndDocumentId(SolutionServices services, bool loadFileFromDisk) 68var assemblyInfoDocumentId = DocumentId.CreateNewId(projectId); 84var generatedDocumentId = DocumentId.CreateNewId(projectId);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (2)
165DocumentId sourceDocId, 166DocumentId newTypeDocId,
MoveToNamespace\MoveToNamespaceResult.cs (2)
18public DocumentId UpdatedDocumentId { get; } 25DocumentId updatedDocumentId,
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
56foreach (var linkedDocumentId in document.GetLinkedDocumentIds())
NavigateTo\IRemoteNavigateToSearchService.cs (2)
20ValueTask SearchDocumentAsync(Checksum solutionChecksum, DocumentId documentId, string searchPattern, ImmutableArray<string> kinds, RemoteServiceCallbackId callbackId, CancellationToken cancellationToken); 21ValueTask SearchProjectsAsync(Checksum solutionChecksum, ImmutableArray<ProjectId> projectIds, ImmutableArray<DocumentId> priorityDocumentIds, string searchPattern, ImmutableArray<string> kinds, RemoteServiceCallbackId callbackId, CancellationToken cancellationToken);
NavigateTo\RoslynNavigateToItem.cs (2)
68public DocumentId DocumentId => this.DocumentKey.Id; 104private readonly (DocumentId id, IReadOnlyList<string> folders)? _activeDocument;
Navigation\IDocumentNavigationService.cs (12)
19Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken); 25Task<bool> CanNavigateToPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken); 27Task<INavigableLocation?> GetLocationForSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken); 28Task<INavigableLocation?> GetLocationForPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken); 33public virtual Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken) 36public virtual Task<bool> CanNavigateToPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken) 39public virtual Task<INavigableLocation?> GetLocationForSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken) 42public virtual Task<INavigableLocation?> GetLocationForPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken) 48public static Task<bool> CanNavigateToSpanAsync(this IDocumentNavigationService service, Workspace workspace, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken) 51public static Task<bool> CanNavigateToPositionAsync(this IDocumentNavigationService service, Workspace workspace, DocumentId documentId, int position, CancellationToken cancellationToken) 54public static Task<INavigableLocation?> GetLocationForSpanAsync(this IDocumentNavigationService service, Workspace workspace, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken) 57public static Task<INavigableLocation?> GetLocationForPositionAsync(this IDocumentNavigationService service, Workspace workspace, DocumentId documentId, int position, CancellationToken cancellationToken)
Navigation\INavigableItem.cs (1)
51public record NavigableDocument(NavigableProject Project, string Name, string? FilePath, IReadOnlyList<string> Folders, DocumentId Id, SourceGeneratedDocumentIdentity? SourceGeneratedDocumentIdentity, Workspace? Workspace)
NavigationBar\AbstractNavigationBarItemService.cs (2)
28var documentId = document.Id; 82var documentId = solution.GetDocumentId(navigationLocation.SourceTree);
NavigationBar\IRemoteNavigationBarItemService.cs (1)
17Checksum solutionChecksum, DocumentId documentId, bool supportsCodeGeneration, bool forceFrozenPartialSemanticsForCrossProcessOperations, CancellationToken cancellationToken);
NavigationBar\NavigationBarItems\RoslynNavigationBarItem.SymbolItem.cs (2)
77public readonly (DocumentId documentId, TextSpan navigationSpan)? OtherDocumentInfo; 81(DocumentId documentId, TextSpan navigationSpan)? otherDocumentInfo)
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (4)
76private readonly HashSet<DocumentId> _openedDocumentIds = new(); 344var documentId = DocumentId.CreateNewId(projectId); 374public bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
QuickInfo\CommonSemanticQuickInfoProvider.cs (3)
69ImmutableArray<DocumentId> linkedDocumentIds) 92var candidateResults = new List<(DocumentId docId, TokenInformation tokenInformation)> 97foreach (var linkedDocumentId in linkedDocumentIds)
RelatedDocuments\AbstractRelatedDocumentsService.cs (5)
37Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken) 67Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, 80using var _1 = ConcurrentSetPool<DocumentId>.GetInstance(out var seenDocumentIds); 95await ProducerConsumer<DocumentId>.RunParallelAsync( 113Action<DocumentId> callback,
RelatedDocuments\IRelatedDocumentsService.cs (1)
22Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken);
RelatedDocuments\IRemoteRelatedDocumentsService.cs (3)
18Checksum solutionChecksum, DocumentId documentId, int position, RemoteServiceCallbackId callbackId, CancellationToken cancellationToken); 22ValueTask ReportRelatedDocumentAsync(RemoteServiceCallbackId callbackId, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken); 34public ValueTask ReportRelatedDocumentAsync(RemoteServiceCallbackId callbackId, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (7)
343DocumentId documentId, 344MultiDictionary<DocumentId, IMethodSymbol>.ValueSet originalGetDefinitions, 345MultiDictionary<DocumentId, IMethodSymbol>.ValueSet originalSetDefinitions, 400DocumentId documentId, 401MultiDictionary<DocumentId, IMethodSymbol>.ValueSet originalDefinitions, 445private static async Task<MultiDictionary<DocumentId, IMethodSymbol>> GetDefinitionsByDocumentIdAsync( 450var result = new MultiDictionary<DocumentId, IMethodSymbol>();
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (6)
318private static async Task<MultiDictionary<DocumentId, IPropertySymbol>> GetDefinitionsByDocumentIdAsync( 323var result = new MultiDictionary<DocumentId, IPropertySymbol>(); 348DocumentId documentId, 349MultiDictionary<DocumentId, IPropertySymbol>.ValueSet originalDefinitions, 400DocumentId documentId, 401MultiDictionary<DocumentId, IPropertySymbol>.ValueSet originalDefinitions,
SemanticSearch\SemanticSearchUtilities.cs (1)
75public static DocumentId GetQueryDocumentId(Solution solution)
Shared\Extensions\DocumentExtensions.cs (2)
64foreach (var linkedDocumentId in document.GetLinkedDocumentIds()) 84foreach (var linkedDocumentId in document.GetLinkedDocumentIds())
Shared\Utilities\AnnotatedSymbolMapping.cs (3)
18ImmutableDictionary<DocumentId, ImmutableArray<ISymbol>> documentIdsToSymbolMap, 35public ImmutableDictionary<DocumentId, ImmutableArray<ISymbol>> DocumentIdsToSymbolMap { get; } = documentIdsToSymbolMap; 55using var _2 = PooledDictionary<DocumentId, List<ISymbol>>.GetInstance(out var documentIdToSymbolsMap);
Shared\Utilities\ExtractTypeHelpers.cs (2)
60var newDocumentId = DocumentId.CreateNewId(projectId, debugName: fileName);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (5)
150var linkedFiles = new HashSet<DocumentId>(); 154var canEdit = new Dictionary<DocumentId, bool>(); 337DocumentId documentId, 338HashSet<DocumentId> linkedDocuments, 339Dictionary<DocumentId, bool> canEdit)
ValueTracking\IValueTrackingService.cs (1)
21ValueTask<ImmutableArray<SerializableValueTrackedItem>> TrackValueSourceAsync(Checksum solutionChecksum, TextSpan selection, DocumentId document, CancellationToken cancellationToken);
ValueTracking\SerializableValueTrackedItem.cs (2)
18DocumentId documentId, 28public DocumentId DocumentId { get; } = documentId;
ValueTracking\ValueTrackedItem.cs (2)
18public DocumentId DocumentId { get; } 27DocumentId documentId,
Workspace\CompileTimeSolutionProvider.cs (2)
103using var _1 = ArrayBuilder<DocumentId>.GetInstance(out var configIdsToRemove); 104using var _2 = ArrayBuilder<DocumentId>.GetInstance(out var documentIdsToRemove);
Workspace\MiscellaneousFileUtilities.cs (2)
46var documentId = DocumentId.CreateNewId(projectId, debugName: filePath);
Microsoft.CodeAnalysis.Features.Test.Utilities (15)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (4)
104solution = solution.AddAdditionalDocument(DocumentId.CreateNewId(project.Id), "additional", CreateText(additionalFileText)); 110DocumentId.CreateNewId(project.Id), 150captureMatchingDocuments: ImmutableArray<DocumentId>.Empty, 348DocumentId.CreateNewId(projectId, name),
EditAndContinue\Extensions.cs (3)
70public static Document AddTestDocument(this Project project, string source, string path, out DocumentId id) 73public static Document AddTestDocument(this Solution solution, ProjectId projectId, string source, string path, out DocumentId id) 75id = DocumentId.CreateNewId(projectId),
EditAndContinue\MockActiveStatementSpanProvider.cs (2)
14public Func<Solution, ImmutableArray<DocumentId>, ImmutableArray<ImmutableArray<ActiveStatementSpan>>>? GetBaseActiveStatementSpansImpl; 17public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
EditAndContinue\MockEditAndContinueService.cs (4)
20public Func<Solution, ImmutableArray<DocumentId>, ImmutableArray<ImmutableArray<ActiveStatementSpan>>>? GetBaseActiveStatementSpansImpl; 23public Func<Solution, IManagedHotReloadService, IPdbMatchingSourceTextProvider, ImmutableArray<DocumentId>, bool, bool, DebuggingSessionId>? StartDebuggingSessionImpl; 48public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 60public ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Solution solution, IManagedHotReloadService debuggerService, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken)
RelatedDocuments\AbstractRelatedDocumentsTests.cs (2)
30var documentId = caretDocument.Id; 35var results = new List<DocumentId>();
Microsoft.CodeAnalysis.Features.UnitTests (51)
EditAndContinue\CompileTimeSolutionProviderTests.cs (14)
36var analyzerConfigId = DocumentId.CreateNewId(projectId); 37var documentId = DocumentId.CreateNewId(projectId); 38var additionalDocumentId = DocumentId.CreateNewId(projectId); 39var designTimeDocumentId = DocumentId.CreateNewId(projectId); 106var analyzerConfigId = DocumentId.CreateNewId(projectId); 107var additionalDocumentId = DocumentId.CreateNewId(projectId); 134var documentId = DocumentId.CreateNewId(projectId);
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (26)
85var documentIdA = DocumentId.CreateNewId(projectPId, debugName: "A"); 92var documentIdB = DocumentId.CreateNewId(projectPId, debugName: "B"); 99var documentIdC = DocumentId.CreateNewId(projectPId, debugName: "C"); 106var documentIdE = DocumentId.CreateNewId(projectPId, debugName: "E"); 129id: DocumentId.CreateNewId(projectQ.Id, debugName: "D"), 135? ImmutableArray<DocumentId>.Empty 347DocumentId.CreateNewId(document.Project.Id), 403var designTimeOnlyDocumentId = DocumentId.CreateNewId(projectId); 421var openDocumentIds = open ? ImmutableArray.Create(designTimeOnlyDocumentId) : ImmutableArray<DocumentId>.Empty; 619var document1 = solution. 677var documentA = solution. 916var documentId = DocumentId.CreateNewId(projectId); 1242var document1 = solution. 1285var document1 = solution. 1550var documentId = DocumentId.CreateNewId(projectId); 2091var document1 = solution. 2179var document2 = solution. 2276var document1 = project.AddDocument("test.cs", sourceText1, filePath: sourceFile.Path); 2308var document1 = solution.
EditAndContinue\EditSessionActiveStatementsTests.cs (3)
78var id = DocumentId.CreateNewId(project.Id, name); 176solution = dummyProject.Solution.AddDocument(DocumentId.CreateNewId(dummyProject.Id, NoCompilationConstants.LanguageName), "a.dummy", "");
EditAndContinue\RemoteEditAndContinueServiceTests.cs (4)
74var documentId = DocumentId.CreateNewId(projectId); 76var inProcOnlyDocumentId = DocumentId.CreateNewId(inProcOnlyProjectId);
EditAndContinue\UnitTestingHotReloadServiceTests.cs (2)
43var documentIdA = DocumentId.CreateNewId(projectP.Id, debugName: "A");
EditAndContinue\WatchHotReloadServiceTests.cs (2)
55var documentIdA = DocumentId.CreateNewId(projectP.Id, debugName: "A");
Microsoft.CodeAnalysis.LanguageServer (3)
HostWorkspace\LanguageServerWorkspace.cs (3)
56ValueTask ILspWorkspace.UpdateTextIfPresentAsync(DocumentId documentId, SourceText sourceText, CancellationToken cancellationToken) 81internal override ValueTask TryOnDocumentOpenedAsync(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, CancellationToken cancellationToken) 98internal override ValueTask TryOnDocumentClosedAsync(DocumentId documentId, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (102)
Extensions\Extensions.cs (4)
76public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, Uri documentUri) 110var documentId = solution.GetDocumentIds(documentIdentifier.Uri).SingleOrDefault(); 151public static T FindDocumentInProjectContext<T>(this ImmutableArray<T> documents, TextDocumentIdentifier documentIdentifier, Func<Solution, DocumentId, T> documentGetter) where T : TextDocument 160var documentIdInCurrentContext = solution.Workspace.GetDocumentIdInCurrentContext(documents.First().Id);
Extensions\ProtocolConversions.cs (4)
376public static async Task<LSP.TextDocumentEdit[]> ChangedDocumentsToTextDocumentEditsAsync<T>(IEnumerable<DocumentId> changedDocuments, Func<DocumentId, T> getNewDocumentFunc, 377Func<DocumentId, T> getOldDocumentFunc, IDocumentTextDifferencingService? textDiffService, CancellationToken cancellationToken) where T : TextDocument 381foreach (var docId in changedDocuments)
Extensions\SourceGeneratedDocumentUri.cs (2)
73var documentId = DocumentId.CreateFromSerialized(projectId, documentIdGuid, isSourceGenerated: true, hintName);
ExternalAccess\Razor\FormatNewFileHandler.cs (2)
52var documentId = DocumentId.CreateNewId(project.Id);
Features\Diagnostics\DiagnosticAnalyzerService.cs (4)
101public Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 114Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (1)
388foreach (var documentId in project.Solution.GetDocumentIdsWithFilePath(path))
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ActiveFileState.cs (2)
20public readonly DocumentId DocumentId; 26public ActiveFileState(DocumentId documentId)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (5)
303ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Builder? lazyLoadDiagnostics = null; 310lazyLoadDiagnostics ??= ImmutableDictionary.CreateBuilder<DocumentId, ImmutableArray<DiagnosticData>>(); 323syntaxLocalMap: lazyLoadDiagnostics?.ToImmutable() ?? ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 324semanticLocalMap: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 325nonLocalMap: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer_MemberSpans.cs (2)
23private readonly record struct MemberSpans(DocumentId DocumentId, VersionStamp Version, ImmutableArray<TextSpan> Spans); 57private void SaveMemberSpans(DocumentId documentId, VersionStamp version, ImmutableArray<TextSpan> memberSpans)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (2)
287private static ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> Hydrate(ImmutableArray<(DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics)> diagnosticByDocument, Project project)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (23)
45public ImmutableHashSet<DocumentId> GetDocumentsWithDiagnostics() 51public bool IsEmpty(DocumentId documentId) 88foreach (var documentId in lastResult.DocumentIds) 202using var _ = PooledHashSet<DocumentId>.GetInstance(out var documentIdsToProcess); 294public bool OnDocumentRemoved(DocumentId id) 370var documentId = document.Id; 430foreach (var documentId in lastResult.DocumentIdsOrEmpty) 436private void RemoveInMemoryCacheEntries(DocumentId id) 449private static bool IsEmpty(DiagnosticAnalysisResult result, DocumentId documentId) 457private readonly ImmutableHashSet<DocumentId>? _documentIds; 459private ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Builder? _syntaxLocals; 460private ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Builder? _semanticLocals; 461private ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Builder? _nonLocals; 464public Builder(Project project, VersionStamp version, ImmutableHashSet<DocumentId>? documentIds = null) 471public void AddSyntaxLocals(DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics) 474public void AddSemanticLocals(DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics) 477public void AddNonLocals(DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics) 483private void Add(ref ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Builder? locals, DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics) 490locals ??= ImmutableDictionary.CreateBuilder<DocumentId, ImmutableArray<DiagnosticData>>(); 497_syntaxLocals?.ToImmutable() ?? ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 498_semanticLocals?.ToImmutable() ?? ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 499_nonLocals?.ToImmutable() ?? ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (7)
28private readonly ConcurrentDictionary<DocumentId, ActiveFileState> _activeFileStates; 37_activeFileStates = new ConcurrentDictionary<DocumentId, ActiveFileState>(concurrencyLevel: 2, capacity: 10); 66public void CollectDocumentsWithDiagnostics(ProjectId projectId, HashSet<DocumentId> set) 86public bool IsActiveFile(DocumentId documentId) 92public bool TryGetActiveFileState(DocumentId documentId, [NotNullWhen(true)] out ActiveFileState? state) 98public ActiveFileState GetOrCreateActiveFileState(DocumentId documentId) 161public bool OnDocumentRemoved(DocumentId id)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (17)
18public Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 21public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 31DocumentId? documentId, 32Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, 41protected readonly DocumentId? DocumentId = documentId; 46private readonly Func<Project, DocumentId?, IReadOnlyList<DocumentId>> _getDocuments = getDocuments ?? (static (project, documentId) => documentId != null ? [documentId] : project.DocumentIds); 53Project project, IReadOnlyList<DocumentId> documentIds, bool includeProjectNonLocalResult, Action<DiagnosticData> callback, CancellationToken cancellationToken); 76IEnumerable<Project> projects, Func<Project, IReadOnlyList<DocumentId>> getDocumentIds, 106DocumentId? documentId, 113Project project, IReadOnlyList<DocumentId> documentIds, bool includeProjectNonLocalResult, 118foreach (var documentId in documentIds) 158private static async Task<ImmutableArray<DiagnosticData>> GetDiagnosticsAsync(StateSet stateSet, Project project, DocumentId? documentId, AnalysisKind kind, CancellationToken cancellationToken) 172private static async Task<ImmutableArray<DiagnosticData>> GetProjectStateDiagnosticsAsync(StateSet stateSet, Project project, DocumentId? documentId, AnalysisKind kind, CancellationToken cancellationToken)
Handler\CodeActions\CodeActionResolveHelper.cs (12)
47using var _2 = PooledHashSet<DocumentId>.GetInstance(out var modifiedDocumentIds); 203IEnumerable<DocumentId> removedDocuments, 204Func<DocumentId, TTextDocument?> getOldDocument) 207foreach (var docId in removedDocuments) 219IEnumerable<DocumentId> addedDocuments, 220Func<DocumentId, TTextDocument?> getNewDocument) 223foreach (var docId in addedDocuments) 256IEnumerable<DocumentId> changedDocuments, 257Func<DocumentId, TTextDocument?> getNewDocument, 258Func<DocumentId, TTextDocument?> getOldDocument) 261foreach (var docId in changedDocuments) 314private static bool HasDocumentNameChange(DocumentId documentId, Solution newSolution, Solution oldSolution)
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDiagnosticSourceHelpers.cs (1)
34foreach (var doc in visibleDocuments)
Handler\Diagnostics\DiagnosticSources\AbstractWorkspaceDocumentDiagnosticSource.cs (2)
32private static readonly ConditionalWeakTable<Project, AsyncLazy<ILookup<DocumentId, DiagnosticData>>> s_projectToDiagnostics = new(); 69AsyncLazy<ILookup<DocumentId, DiagnosticData>> GetLazyDiagnostics()
Handler\Diagnostics\ProjectOrDocumentId.cs (2)
19private readonly DocumentId? _documentId; 33public ProjectOrDocumentId(DocumentId documentId)
Handler\ProjectContext\GetTextDocumentWithContextHandler.cs (3)
49foreach (var documentId in documentIds) 61var openDocumentId = documentIds.First(); 62var currentContextDocumentId = context.Workspace.GetDocumentIdInCurrentContext(openDocumentId);
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (1)
50foreach (var doc in visibleDocuments)
Workspaces\ILspWorkspace.cs (1)
40ValueTask UpdateTextIfPresentAsync(DocumentId documentId, SourceText sourceText, CancellationToken cancellationToken);
Workspaces\LspMiscellaneousFilesWorkspace.cs (3)
66var id = projectInfo.Documents.Single().Id; 85var matchingDocument = CurrentSolution.GetDocumentIds(uri).SingleOrDefault(); 104public ValueTask UpdateTextIfPresentAsync(DocumentId documentId, SourceText sourceText, CancellationToken cancellationToken)
Workspaces\LspWorkspaceManager.cs (2)
142private static async ValueTask ApplyChangeToMutatingWorkspaceAsync(Workspace workspace, Uri uri, Func<ILspWorkspace, DocumentId, ValueTask> change) 147foreach (var documentId in workspace.CurrentSolution.GetDocumentIds(uri))
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (7)
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (1)
166DocumentId.CreateNewId(project.Id),
Workspaces\LspWorkspaceManagerTests.cs (4)
223var newDocumentId = DocumentId.CreateNewId(testLspServer.TestWorkspace.CurrentSolution.ProjectIds[0]); 244var newDocumentId = DocumentId.CreateNewId(testLspServer.TestWorkspace.CurrentSolution.ProjectIds[0]);
Workspaces\SourceGeneratedDocumentUriTests.cs (2)
29var generatedDocumentId = DocumentId.CreateFromSerialized(testLspServer.TestWorkspace.Projects.Single().Id, Guid.NewGuid(), isSourceGenerated: true, debugName: HintName);
Microsoft.CodeAnalysis.Remote.ServiceHub (52)
Host\RemoteWorkspace.SolutionCreator.cs (8)
434Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 437using var _1 = PooledDictionary<DocumentId, (Checksum attributeChecksum, Checksum textChecksum)>.GetInstance(out var oldDocumentIdToChecksums); 438using var _2 = PooledDictionary<DocumentId, (Checksum attributeChecksum, Checksum textChecksum)>.GetInstance(out var newDocumentIdToChecksums); 479Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 480Dictionary<DocumentId, (Checksum attributeChecksum, Checksum textChecksum)> oldDocumentIdToStateChecksums, 481Dictionary<DocumentId, (Checksum attributeChecksum, Checksum textChecksum)> newDocumentIdToStateChecksums, 505ImmutableArray<DocumentId>.Builder? lazyDocumentsToRemove = null; 511lazyDocumentsToRemove ??= ImmutableArray.CreateBuilder<DocumentId>();
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (3)
44public ValueTask SynchronizeActiveDocumentAsync(DocumentId? documentId, CancellationToken cancellationToken) 51public ValueTask SynchronizeTextAsync(DocumentId documentId, Checksum baseTextChecksum, ImmutableArray<TextChange> textChanges, CancellationToken cancellationToken) 82DocumentId documentId,
Services\CodeLensReferences\RemoteCodeLensReferencesService.cs (5)
28private static async ValueTask<SyntaxNode?> TryFindNodeAsync(Solution solution, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken) 43public async ValueTask<ReferenceCount?> GetReferenceCountAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, int maxResultCount, CancellationToken cancellationToken) 66public async ValueTask<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken) 84public async ValueTask<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken) 102public ValueTask<string?> GetFullyQualifiedNameAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken)
Services\ConvertTupleToStructCodeRefactoringProvider\RemoteConvertTupleToStructCodeRefactoringService.cs (3)
32DocumentId documentId, 57private static async Task<(DocumentId, TextSpan)> GetRenamedTokenAsync( 81var changedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
Services\DiagnosticAnalyzer\RemoteDiagnosticAnalyzerService.cs (1)
54var documentId = arguments.DocumentId;
Services\DocumentHighlights\RemoteDocumentHighlightsService.cs (2)
28Checksum solutionChecksum, DocumentId documentId, int position, ImmutableArray<DocumentId> documentIdsToSearch, HighlightingOptions options, CancellationToken cancellationToken)
Services\EditAndContinue\RemoteEditAndContinueService.cs (4)
83public ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken) 122public ValueTask<ImmutableArray<DiagnosticData>> GetDocumentDiagnosticsAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DocumentId documentId, CancellationToken cancellationToken) 201public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Checksum solutionChecksum, DebuggingSessionId sessionId, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 212public ValueTask<ImmutableArray<ActiveStatementSpan>> GetAdjustedActiveStatementSpansAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DebuggingSessionId sessionId, DocumentId documentId, CancellationToken cancellationToken)
Services\EncapsulateField\RemoteEncapsulateFieldService.cs (3)
26public ValueTask<ImmutableArray<(DocumentId, ImmutableArray<TextChange>)>> EncapsulateFieldsAsync( 28DocumentId documentId, 44return ImmutableArray<(DocumentId, ImmutableArray<TextChange>)>.Empty;
Services\ExtensionMethodImportCompletion\RemoteExtensionMethodImportCompletionService.cs (1)
32DocumentId documentId,
Services\FullyQualify\RemoteFullyQualifyService.cs (1)
28public ValueTask<FullyQualifyFixData?> GetFixDataAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan span, CancellationToken cancellationToken)
Services\InheritanceMargin\RemoteInheritanceMarginService.cs (1)
30DocumentId documentId,
Services\LegacySolutionEvents\RemoteLegacySolutionEventsAggregationService.cs (1)
45DocumentId? documentId,
Services\MissingImportDiscovery\RemoteMissingImportDiscoveryService.cs (2)
35DocumentId documentId, 63DocumentId documentId,
Services\NavigateToSearch\RemoteNavigateToSearchService.cs (2)
49DocumentId documentId, 68ImmutableArray<DocumentId> priorityDocumentIds,
Services\NavigationBar\RemoteNavigationBarItemService.cs (1)
24Checksum solutionChecksum, DocumentId documentId, bool supportsCodeGeneration, bool frozenPartialSemantics, CancellationToken cancellationToken)
Services\RelatedDocuments\RemoteRelatedDocumentsService.cs (2)
28private Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> GetCallbackFunction(RemoteServiceCallbackId callbackId) 36DocumentId documentId,
Services\RemoteDocumentTrackingService.cs (5)
17private DocumentId? _activeDocument; 19public event EventHandler<DocumentId?>? ActiveDocumentChanged; 21public ImmutableArray<DocumentId> GetVisibleDocuments() 24public DocumentId? TryGetActiveDocument() 27internal void SetActiveDocument(DocumentId? documentId)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (1)
48private readonly LinkedList<(DocumentId id, ClassificationType type, Checksum checksum, ImmutableArray<ClassifiedSpan> classifiedSpans)> _cachedData = new();
Services\SemanticClassification\RemoteSemanticClassificationService.cs (1)
25DocumentId documentId,
Services\SourceGeneration\RemoteSourceGenerationService.cs (2)
55Checksum solutionChecksum, ProjectId projectId, ImmutableArray<DocumentId> documentIds, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken) 64foreach (var id in documentIds)
Services\SymbolFinder\RemoteSymbolFinderService.cs (1)
41ImmutableArray<DocumentId> documentArgs,
Services\TaskList\RemoteTaskListService.cs (1)
29Checksum solutionChecksum, DocumentId documentId, ImmutableArray<TaskListItemDescriptor> descriptors, CancellationToken cancellationToken)
Services\ValueTracking\RemoteValueTrackingService.cs (1)
28public ValueTask<ImmutableArray<SerializableValueTrackedItem>> TrackValueSourceAsync(Checksum solutionChecksum, TextSpan selection, DocumentId documentId, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Remote.Workspaces (4)
AbstractAssetProvider.cs (1)
165DocumentId documentId, Checksum attributeChecksum, Checksum textChecksum, CancellationToken cancellationToken)
IRemoteAssetSynchronizationService.cs (2)
28ValueTask SynchronizeTextAsync(DocumentId documentId, Checksum baseTextChecksum, ImmutableArray<TextChange> textChanges, CancellationToken cancellationToken); 36ValueTask SynchronizeActiveDocumentAsync(DocumentId? documentId, CancellationToken cancellationToken);
Serialization\MessagePackFormatters.cs (1)
46/// containing <see cref="DocumentId"/>s. This allows a single instance to be created and shared across that
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (3)
LineCommit\CommitFormatter.vb (2)
142documentId As DocumentId, 161documentId As DocumentId,
NavigationBar\VisualBasicEditorNavigationBarItemService.vb (1)
43cancellationToken As CancellationToken) As Task(Of (documentId As DocumentId, position As Integer, virtualSpace As Integer))
Microsoft.CodeAnalysis.VisualBasic.Features (7)
CodeRefactorings\SyncNamespace\VisualBasicChangeNamespaceService.vb (2)
60Protected Overrides Function GetValidContainersFromAllLinkedDocumentsAsync(document As Document, container As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of (DocumentId, SyntaxNode))) 61Return SpecializedTasks.Default(Of ImmutableArray(Of (DocumentId, SyntaxNode)))()
ExtractInterface\VisualBasicExtractInterfaceService.vb (5)
81Private Shared Function CreateFinalSolution(solutionWithInterfaceDocument As Solution, documentIds As IEnumerable(Of DocumentId), docToRootMap As Dictionary(Of DocumentId, CompilationUnitSyntax)) As Solution 101unformattedSolution As Solution, documentIds As IReadOnlyList(Of DocumentId), extractedInterfaceSymbol As INamedTypeSymbol, 105Dim docToRootMap = New Dictionary(Of DocumentId, CompilationUnitSyntax) 117Dim currentDocId As DocumentId = Nothing
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
674Dim newDocId = DocumentId.CreateNewId(oldProject.Id)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
40Private ReadOnly _documentId As DocumentId
Microsoft.CodeAnalysis.Workspaces (781)
Classification\IRemoteSemanticClassificationService.cs (1)
32DocumentId documentId,
CodeActions\CodeAction_Cleanup.cs (6)
59internal static ImmutableArray<DocumentId> GetAllChangedOrAddedDocumentIds( 87async Task<ImmutableArray<(DocumentId documentId, CodeCleanupOptions codeCleanupOptions)>> GetDocumentIdsAndOptionsToCleanAsync() 89using var _ = ArrayBuilder<(DocumentId documentId, CodeCleanupOptions options)>.GetInstance(documentIds.Length, out var documentIdsAndOptions); 90foreach (var documentId in documentIds) 122ImmutableArray<(DocumentId documentId, CodeCleanupOptions options)> documentIdsAndOptions, 143var changedRoots = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
CodeActions\Operations\ApplyChangesOperation.cs (1)
125foreach (var documentId in changedDocuments)
CodeActions\Operations\OpenDocumentOperation.cs (2)
13public sealed class OpenDocumentOperation(DocumentId documentId, bool activateIfAlreadyOpen = false) : CodeActionOperation 15public DocumentId DocumentId { get; } = documentId ?? throw new ArgumentNullException(nameof(documentId));
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (6)
51var docIdToTextMerger = new Dictionary<DocumentId, TextChangeMerger>(); 78FixAllContext fixAllContext, IProgress<CodeAnalysisProgress> progressTracker, Dictionary<DocumentId, TextChangeMerger> docIdToTextMerger) 110Dictionary<DocumentId, TextChangeMerger> docIdToTextMerger, 200Dictionary<DocumentId, TextChangeMerger> docIdToTextMerger) 210var docId = group.Key; 254ImmutableArray<(DocumentId documentId, TextChangeMerger merger)> docIdsAndMerger,
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (1)
70var changedRootsAndTexts = await ProducerConsumer<(DocumentId documentId, (SyntaxNode? node, SourceText? text))>.RunParallelAsync(
Diagnostics\DiagnosticAnalysisResult.cs (34)
30public readonly ImmutableHashSet<DocumentId>? DocumentIds; 36private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? _syntaxLocals; 41private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? _semanticLocals; 46private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? _nonLocals; 53private DiagnosticAnalysisResult(ProjectId projectId, VersionStamp version, ImmutableHashSet<DocumentId>? documentIds, bool isEmpty, bool fromBuild) 70ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> syntaxLocals, 71ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> semanticLocals, 72ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> nonLocals, 74ImmutableHashSet<DocumentId>? documentIds, 101syntaxLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 102semanticLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 103nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 118public static DiagnosticAnalysisResult CreateFromBuild(Project project, ImmutableArray<DiagnosticData> diagnostics, IEnumerable<DocumentId> initialDocuments) 124var documentIds = ImmutableHashSet.CreateBuilder<DocumentId>(); 127var diagnosticsWithDocumentId = PooledDictionary<DocumentId, ArrayBuilder<DiagnosticData>>.GetInstance(); 148syntaxLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 150nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 160ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> syntaxLocalMap, 161ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> semanticLocalMap, 162ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> nonLocalMap, 164ImmutableHashSet<DocumentId>? documentIds) 200public ImmutableHashSet<DocumentId> DocumentIdsOrEmpty => DocumentIds ?? []; 202private ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? GetMap(AnalysisKind kind) 241public ImmutableArray<DiagnosticData> GetDocumentDiagnostics(DocumentId documentId, AnalysisKind kind) 266public DiagnosticAnalysisResult UpdateAggregatedResult(VersionStamp version, DocumentId documentId, bool fromBuild) 285semanticLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 286nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 292private static ImmutableHashSet<DocumentId> GetDocumentIds( 293ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? syntaxLocals, 294ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? semanticLocals, 295ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? nonLocals) 304var documents = SpecializedCollections.EmptyEnumerable<DocumentId>(); 324private static void VerifyDocumentMap(Project project, ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> map) 326foreach (var documentId in map.Keys)
Diagnostics\DiagnosticAnalysisResultBuilder.cs (19)
24private HashSet<DocumentId>? _lazyDocumentsWithDiagnostics = null; 26private Dictionary<DocumentId, List<DiagnosticData>>? _lazySyntaxLocals = null; 27private Dictionary<DocumentId, List<DiagnosticData>>? _lazySemanticLocals = null; 28private Dictionary<DocumentId, List<DiagnosticData>>? _lazyNonLocals = null; 32public readonly ImmutableHashSet<DocumentId> DocumentIds => _lazyDocumentsWithDiagnostics == null ? [] : [.. _lazyDocumentsWithDiagnostics]; 33public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> SyntaxLocals => Convert(_lazySyntaxLocals); 34public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> SemanticLocals => Convert(_lazySemanticLocals); 35public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> NonLocals => Convert(_lazyNonLocals); 38public void AddExternalSyntaxDiagnostics(DocumentId documentId, IEnumerable<Diagnostic> diagnostics) 43public void AddExternalSemanticDiagnostics(DocumentId documentId, IEnumerable<Diagnostic> diagnostics) 52ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, DocumentId documentId, IEnumerable<Diagnostic> diagnostics) 97private void AddDocumentDiagnostic(ref Dictionary<DocumentId, List<DiagnosticData>>? map, TextDocument? document, Diagnostic diagnostic) 128Dictionary<DocumentId, List<DiagnosticData>>? dummy = null; 136ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, Diagnostic diagnostic) 189ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, IEnumerable<Diagnostic> diagnostics) 195private static ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> Convert(Dictionary<DocumentId, List<DiagnosticData>>? map) 198? ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty
Diagnostics\DiagnosticData.cs (2)
104public DocumentId? DocumentId => DataLocation.DocumentId; 270var textDocumentId = document.Project.GetDocumentForExternalLocation(location);
Diagnostics\DiagnosticDataLocation.cs (5)
29public readonly DocumentId? DocumentId; 41DocumentId? documentId, 51DocumentId? documentId = null) 58DocumentId? documentId, 114DocumentId? documentId,
Diagnostics\Extensions.cs (3)
197var additionalDocumentId = project.GetDocumentForFile(file); 243DocumentId? additionalDocumentId, 261DocumentId? additionalDocumentId,
Diagnostics\IWorkspaceVenusSpanMappingService.cs (1)
20void GetAdjustedDiagnosticSpan(DocumentId documentId, Location location, out TextSpan span, out FileLinePositionSpan originalLineInfo, out FileLinePositionSpan mappedLineInfo);
Editing\SolutionEditor.cs (3)
18private readonly Dictionary<DocumentId, DocumentEditor> _documentEditors = []; 26/// Gets the <see cref="DocumentEditor"/> for the corresponding <see cref="DocumentId"/>. 28public async Task<DocumentEditor> GetDocumentEditorAsync(DocumentId id, CancellationToken cancellationToken = default)
Editing\SymbolEditor.cs (5)
73foreach (var id in projectChanges.GetAddedDocuments()) 78foreach (var id in projectChanges.GetChangedDocuments()) 86foreach (var id in project.DocumentIds) 366DocumentId documentId, 469var docId = declGroup.Key;
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
242async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(DocumentId documentId) 252MultiDictionary<DocumentId, DeclaredSymbolInfo> documentToInfos,
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (15)
18MultiDictionary<DocumentId, DeclaredSymbolInfo> classesAndRecordsThatMayDeriveFromSystemObject, 19MultiDictionary<DocumentId, DeclaredSymbolInfo> valueTypes, 20MultiDictionary<DocumentId, DeclaredSymbolInfo> enums, 21MultiDictionary<DocumentId, DeclaredSymbolInfo> delegates, 22MultiDictionary<string, (DocumentId, DeclaredSymbolInfo)> namedTypes) 26public readonly MultiDictionary<DocumentId, DeclaredSymbolInfo> ClassesAndRecordsThatMayDeriveFromSystemObject = classesAndRecordsThatMayDeriveFromSystemObject; 27public readonly MultiDictionary<DocumentId, DeclaredSymbolInfo> ValueTypes = valueTypes; 28public readonly MultiDictionary<DocumentId, DeclaredSymbolInfo> Enums = enums; 29public readonly MultiDictionary<DocumentId, DeclaredSymbolInfo> Delegates = delegates; 30public readonly MultiDictionary<string, (DocumentId, DeclaredSymbolInfo)> NamedTypes = namedTypes; 48var classesThatMayDeriveFromSystemObject = new MultiDictionary<DocumentId, DeclaredSymbolInfo>(); 49var valueTypes = new MultiDictionary<DocumentId, DeclaredSymbolInfo>(); 50var enums = new MultiDictionary<DocumentId, DeclaredSymbolInfo>(); 51var delegates = new MultiDictionary<DocumentId, DeclaredSymbolInfo>(); 53var namedTypes = new MultiDictionary<string, (DocumentId, DeclaredSymbolInfo)>(
FindSymbols\IRemoteSymbolFinderService.cs (2)
27ValueTask OnLiteralReferenceFoundAsync(RemoteServiceCallbackId callbackId, DocumentId documentId, TextSpan span, CancellationToken cancellationToken); 30ValueTask FindReferencesAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, SerializableSymbolAndProjectId symbolAndProjectIdArg, ImmutableArray<DocumentId> documentArgs,
FindSymbols\ReferenceLocation.cs (1)
118EqualityComparer<DocumentId>.Default.Equals(this.Document.Id, other.Document.Id) &&
FindSymbols\Shared\AbstractSyntaxIndex.cs (1)
22private static readonly ConditionalWeakTable<DocumentId, TIndex?> s_documentIdToIndex = new();
FindSymbols\SymbolFinder.CallbackDispatcher.cs (1)
61public ValueTask OnLiteralReferenceFoundAsync(RemoteServiceCallbackId callbackId, DocumentId documentId, TextSpan span, CancellationToken cancellationToken)
FindSymbols\SymbolFinder.cs (1)
267foreach (var linkedDocumentId in originalDocument.GetLinkedDocumentIds())
FindSymbols\SymbolFinder.FindLiteralsServerCallback.cs (1)
24public async ValueTask OnLiteralReferenceFoundAsync(DocumentId documentId, TextSpan span, CancellationToken cancellationToken)
Formatting\Rules\DefaultFormattingRuleFactoryServiceFactory.cs (3)
22public bool ShouldNotFormatOrCommitOnPaste(DocumentId documentId) 25public bool ShouldUseBaseIndentation(DocumentId documentId) 31public IEnumerable<TextChange> FilterFormattedChanges(DocumentId document, TextSpan span, IList<TextChange> changes)
Formatting\Rules\IHostDependentFormattingRuleFactoryService.cs (3)
13bool ShouldNotFormatOrCommitOnPaste(DocumentId documentId); 14bool ShouldUseBaseIndentation(DocumentId documentId); 16IEnumerable<TextChange> FilterFormattedChanges(DocumentId documentId, TextSpan span, IList<TextChange> changes);
LinkedFileDiffMerging\LinkedFileMergeResult.cs (2)
10internal readonly struct LinkedFileMergeResult(ImmutableArray<DocumentId> documentIds, SourceText mergedSourceText, ImmutableArray<TextSpan> mergeConflictResolutionSpans) 12public readonly ImmutableArray<DocumentId> DocumentIds = documentIds;
LinkedFileDiffMerging\LinkedFileMergeSessionResult.cs (1)
16public readonly Dictionary<DocumentId, ImmutableArray<TextSpan>> MergeConflictCommentSpans = [];
LinkedFileDiffMerging\UnmergedDocumentChanges.cs (2)
10internal readonly struct UnmergedDocumentChanges(ImmutableArray<TextChange> unmergedChanges, string projectName, DocumentId documentId) 14public readonly DocumentId DocumentId = documentId;
Packaging\IPackageInstallerService.cs (1)
22Workspace workspace, DocumentId documentId,
Remote\RemoteUtilities.cs (4)
22public static async ValueTask<ImmutableArray<(DocumentId, ImmutableArray<TextChange>)>> GetDocumentTextChangesAsync( 27using var _ = ArrayBuilder<(DocumentId, ImmutableArray<TextChange>)>.GetInstance(out var builder); 32foreach (var docId in projectChange.GetChangedDocuments()) 50ImmutableArray<(DocumentId documentId, ImmutableArray<TextChange> textChanges)> documentTextChanges,
Rename\ConflictEngine\ConflictResolver.Session.cs (18)
37private readonly DocumentId _documentIdOfRenameSymbolDeclaration; 78public readonly DocumentId DocumentId; 117var documentIdsThatGetsAnnotatedAndRenamed = new HashSet<DocumentId>(documentsByProject); 187documentIdsThatGetsAnnotatedAndRenamed = new HashSet<DocumentId>(conflictLocations.Select(l => l.DocumentId)); 264private async Task DebugVerifyNoErrorsAsync(MutableConflictResolution conflictResolution, IEnumerable<DocumentId> documents) 266var documentIdErrorStateLookup = new Dictionary<DocumentId, bool>(); 270foreach (var documentId in documents) 287foreach (var documentId in documents) 306HashSet<DocumentId> documentIdsForConflictResolution, 307IEnumerable<DocumentId> allDocumentIdsInProject, 324foreach (var documentId in documentIdsForConflictResolution) 350foreach (var documentId in documentIdsForConflictResolution) 442foreach (var unprocessedDocumentIdWithPotentialDeclarationConflicts in allDocumentIdsInProject.Where(d => !documentIdsForConflictResolution.Contains(d))) 701private async Task<(ImmutableHashSet<DocumentId> documentIds, ImmutableArray<string> possibleNameConflicts)> FindDocumentsAndPossibleNameConflictsAsync() 705var documentIds = new HashSet<DocumentId>(); 733HashSet<DocumentId> documentIds, 779HashSet<DocumentId> documentIdsToRename, 788foreach (var documentId in documentIdsToRename.ToList())
Rename\ConflictEngine\MutableConflictResolution.cs (5)
52private (DocumentId documentId, string newName) _renamedDocument; 54internal void ClearDocuments(IEnumerable<DocumentId> conflictLocationDocumentIds) 65IEnumerable<DocumentId> documentWithRenameAnnotations, 69foreach (var documentId in documentWithRenameAnnotations) 129public int GetAdjustedTokenStartingPosition(int startingPosition, DocumentId documentId)
Rename\ConflictEngine\RelatedLocation.cs (1)
24[property: DataMember(Order = 1)] DocumentId DocumentId,
Rename\ConflictEngine\RenamedSpansTracker.cs (15)
25private readonly Dictionary<DocumentId, List<(TextSpan oldSpan, TextSpan newSpan)>> _documentToModifiedSpansMap = []; 26private readonly Dictionary<DocumentId, List<MutableComplexifiedSpan>> _documentToComplexifiedSpansMap = []; 28internal bool IsDocumentChanged(DocumentId documentId) 31internal void AddModifiedSpan(DocumentId documentId, TextSpan oldSpan, TextSpan newSpan) 42internal void AddComplexifiedSpan(DocumentId documentId, TextSpan oldSpan, TextSpan newSpan, List<(TextSpan oldSpan, TextSpan newSpan)> modifiedSubSpans) 54internal int GetAdjustedPosition(int startingPosition, DocumentId documentId) 129internal void ClearDocuments(IEnumerable<DocumentId> conflictLocationDocumentIds) 131foreach (var documentId in conflictLocationDocumentIds) 138public IEnumerable<DocumentId> DocumentIds 146internal async Task<Solution> SimplifyAsync(Solution solution, IEnumerable<DocumentId> documentIds, bool replacementTextValid, AnnotationTable<RenameAnnotation> renameAnnotations, CancellationToken cancellationToken) 148foreach (var documentId in documentIds) 224public ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>> GetDocumentToModifiedSpansMap() 226var builder = ImmutableDictionary.CreateBuilder<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>>(); 234public ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>> GetDocumentToComplexifiedSpansMap() 236var builder = ImmutableDictionary.CreateBuilder<DocumentId, ImmutableArray<ComplexifiedSpan>>();
Rename\ConflictResolution.cs (17)
31private readonly (DocumentId documentId, string newName)? _renamedDocument; 45public readonly ImmutableArray<DocumentId> DocumentIds; 49private readonly ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>> _documentToModifiedSpansMap; 50private readonly ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>> _documentToComplexifiedSpansMap; 51private readonly ImmutableDictionary<DocumentId, ImmutableArray<RelatedLocation>> _documentToRelatedLocationsMap; 65_documentToModifiedSpansMap = ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>>.Empty; 66_documentToComplexifiedSpansMap = ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>>.Empty; 67_documentToRelatedLocationsMap = ImmutableDictionary<DocumentId, ImmutableArray<RelatedLocation>>.Empty; 74(DocumentId documentId, string newName) renamedDocument, 75ImmutableArray<DocumentId> documentIds, ImmutableArray<RelatedLocation> relatedLocations, 76ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>> documentToModifiedSpansMap, 77ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>> documentToComplexifiedSpansMap, 78ImmutableDictionary<DocumentId, ImmutableArray<RelatedLocation>> documentToRelatedLocationsMap) 98public ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)> GetComplexifiedSpans(DocumentId documentId) 103public ImmutableDictionary<TextSpan, TextSpan> GetModifiedSpanMap(DocumentId documentId) 124public ImmutableArray<RelatedLocation> GetRelatedLocationsForDocument(DocumentId documentId) 129internal TextSpan GetResolutionTextSpan(TextSpan originalSpan, DocumentId documentId)
Rename\IRemoteRenamerService.cs (2)
55DocumentId documentId, 66public readonly DocumentId DocumentId = documentId;
Rename\LightweightRenameLocations.cs (1)
121public LightweightRenameLocations Filter(Func<DocumentId, TextSpan, bool> filter)
Rename\RenameLocation.cs (3)
13DocumentId documentId, 21public readonly DocumentId DocumentId = documentId; 30public RenameLocation(ReferenceLocation referenceLocation, DocumentId documentId)
Rename\Renamer.RenameDocumentActionSet.cs (3)
28private readonly DocumentId _documentId; 35DocumentId documentId, 92var documentId = document.Id;
Shared\Extensions\ISolutionExtensions.cs (3)
39public static TextDocumentKind? GetDocumentKind(this Solution solution, DocumentId documentId) 49var documentId = solution.GetDocumentIdsWithFilePath(location.GetLineSpan().Path).FirstOrDefault(); 56public static Solution WithTextDocumentText(this Solution solution, DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveIdentity)
Shared\Extensions\ProjectExtensions.cs (9)
19public static TextDocument? GetTextDocument(this Project project, DocumentId? documentId) 22internal static DocumentId? GetDocumentForExternalLocation(this Project project, Location location) 28internal static DocumentId? GetDocumentForFile(this Project project, AdditionalText additionalText) 31private static DocumentId? GetDocumentIdWithFilePath(this Project project, string filePath) 34public static Document GetRequiredDocument(this Project project, DocumentId documentId) 40public static TextDocument GetRequiredAdditionalDocument(this Project project, DocumentId documentId) 43public static TextDocument GetRequiredAnalyzerConfigDocument(this Project project, DocumentId documentId) 46public static TextDocument GetRequiredTextDocument(this Project project, DocumentId documentId) 49public static async ValueTask<Document> GetRequiredSourceGeneratedDocumentAsync(this Project project, DocumentId documentId, CancellationToken cancellationToken)
SourceGeneration\IRemoteSourceGenerationService.cs (1)
46Checksum solutionChecksum, ProjectId projectId, ImmutableArray<DocumentId> documentIds, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
221foreach (var linkedDocumentId in document.GetLinkedDocumentIds())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (9)
16public static IEnumerable<DocumentId> GetChangedDocuments(this Solution? newSolution, Solution oldSolution) 24foreach (var documentId in projectChanges.GetChangedDocuments()) 32public static TextDocument? GetTextDocument(this Solution solution, DocumentId? documentId) 49public static Document GetRequiredDocument(this Solution solution, DocumentId documentId) 66public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 69public static async ValueTask<TextDocument> GetRequiredTextDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken = default) 73public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 76public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 79public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Rename\Annotations\RenameDeclarationLocationReference.cs (2)
18public readonly DocumentId DocumentId; 36public RenameDeclarationLocationReference(DocumentId documentId, TextSpan textSpan, bool overriddenFromMetadata, int declaringSyntaxReferencesCount)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
28internal readonly record struct ParsedDocument(DocumentId Id, SourceText Text, SyntaxNode Root, HostLanguageServices HostLanguageServices)
Storage\SQLite\v2\SQLitePersistentStorage_DocumentIds.cs (1)
19private readonly ConcurrentDictionary<DocumentId, DocumentPrimaryKey> _documentIdToPrimaryKeyMap = [];
TaskList\IRemoteTaskListService.cs (1)
17ValueTask<ImmutableArray<TaskListItem>> GetTaskListItemsAsync(Checksum solutionChecksum, DocumentId documentId, ImmutableArray<TaskListItemDescriptor> descriptors, CancellationToken cancellationToken);
TaskList\TaskListItem.cs (1)
16[property: DataMember(Order = 2)] DocumentId DocumentId,
Workspace\AdhocWorkspace.cs (8)
125var id = DocumentId.CreateNewId(projectId); 149public override void OpenDocument(DocumentId documentId, bool activate = true) 162public override void CloseDocument(DocumentId documentId) 177public override void OpenAdditionalDocument(DocumentId documentId, bool activate = true) 190public override void CloseAdditionalDocument(DocumentId documentId) 205public override void OpenAnalyzerConfigDocument(DocumentId documentId, bool activate = true) 218public override void CloseAnalyzerConfigDocument(DocumentId documentId)
Workspace\CommandLineProject.cs (2)
161var id = DocumentId.CreateNewId(projectId, absolutePath);
Workspace\DocumentActiveContextChangedEventArgs.cs (4)
17public DocumentId OldActiveContextDocumentId { get; } 18public DocumentId NewActiveContextDocumentId { get; } 20public DocumentActiveContextChangedEventArgs(Solution solution, SourceTextContainer sourceTextContainer, DocumentId oldActiveContextDocumentId, DocumentId newActiveContextDocumentId)
Workspace\DocumentTracking\DefaultDocumentTrackingService.cs (3)
17public event EventHandler<DocumentId?> ActiveDocumentChanged { add { } remove { } } 19public ImmutableArray<DocumentId> GetVisibleDocuments() 22public DocumentId? TryGetActiveDocument()
Workspace\DocumentTracking\IDocumentTrackingService.cs (5)
25/// Get the <see cref="DocumentId"/> of the active document. May be null if there is no active document, the 28DocumentId? TryGetActiveDocument(); 31/// Get a read only collection of the <see cref="DocumentId"/>s of all the visible documents in the workspace. May 34ImmutableArray<DocumentId> GetVisibleDocuments(); 40event EventHandler<DocumentId?> ActiveDocumentChanged;
Workspace\Host\PersistentStorage\DocumentKey.cs (2)
19internal readonly struct DocumentKey(ProjectKey project, DocumentId id, string? filePath, string name) : IEqualityComparer<DocumentKey>, IEquatable<DocumentKey> 25public readonly DocumentId Id = id;
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (40)
35/// The map of file paths to the underlying <see cref="DocumentId"/>. This document may exist in <see cref="_documentsAddedInBatch"/> or has been 38private readonly Dictionary<string, DocumentId> _documentPathsToDocumentIds = new(StringComparer.OrdinalIgnoreCase); 41/// A map of explicitly-added "always open" <see cref="SourceTextContainer"/> and their associated <see cref="DocumentId"/>. This does not contain 44private IBidirectionalMap<SourceTextContainer, DocumentId> _sourceTextContainersToDocumentIds = BidirectionalMap<SourceTextContainer, DocumentId>.Empty; 47/// The map of <see cref="DocumentId"/> to <see cref="IDynamicFileInfoProvider"/> whose <see cref="DynamicFileInfo"/> got added into <see cref="Workspace"/> 49private readonly Dictionary<DocumentId, IDynamicFileInfoProvider> _documentIdToDynamicFileInfoProvider = []; 59private readonly List<DocumentId> _documentsRemovedInBatch = []; 64private ImmutableList<DocumentId>? _orderedDocumentsInBatch = null; 66private readonly Func<Solution, DocumentId, bool> _documentAlreadyInWorkspace; 68private readonly Action<Workspace, DocumentId> _documentRemoveAction; 69private readonly Func<Solution, DocumentId, TextLoader, Solution> _documentTextLoaderChangedAction; 73Func<Solution, DocumentId, bool> documentAlreadyInWorkspace, 75Action<Workspace, DocumentId> documentRemoveAction, 76Func<Solution, DocumentId, TextLoader, Solution> documentTextLoaderChangedAction, 87public DocumentId AddFile(string fullPath, SourceCodeKind sourceCodeKind, ImmutableArray<string> folders) 94var documentId = DocumentId.CreateNewId(_project.Id, fullPath); 131public DocumentId AddTextContainer( 144var documentId = DocumentId.CreateNewId(_project.Id, fullPath); 242if (!_documentPathsToDocumentIds.TryGetValue(fullPath, out var documentId) || 264if (!_documentPathsToDocumentIds.TryGetValue(fullPath, out var documentId)) 276private void RemoveFileInternal(DocumentId documentId, string fullPath) 319if (!_sourceTextContainersToDocumentIds.TryGetValue(textContainer, out var documentId)) 395var documentsToChange = ArrayBuilder<(DocumentId, TextLoader)>.GetInstance(filePaths.Count); 399if (_documentPathsToDocumentIds.TryGetValue(filePath, out var documentId)) 454if (_documentPathsToDocumentIds.TryGetValue(workspaceFilePath, out var documentId)) 508var documentIds = ImmutableList.CreateBuilder<DocumentId>(); 512if (_documentPathsToDocumentIds.TryGetValue(filePath, out var documentId)) 538internal ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> UpdateSolutionForBatch( 543Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 553static ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> UpdateSolutionForBatch( 558Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 562ImmutableArray<DocumentId> documentsRemovedInBatch, 563ImmutableList<DocumentId>? orderedDocumentsInBatch, 564Func<DocumentId, SourceTextContainer?> getContainer) 566using var _ = ArrayBuilder<(DocumentId documentId, SourceTextContainer textContainer)>.GetInstance(out var documentsToOpen); 618var documentId = DocumentId.CreateNewId(_project.Id, filePath);
Workspace\ProjectSystem\ProjectSystemProject.cs (5)
117private readonly Dictionary<DocumentId, IWatchedFile> _documentWatchedFiles = []; 571ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> documentsToOpen = []; 572ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> additionalDocumentsToOpen = []; 573ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> analyzerConfigDocumentsToOpen = []; 842public DocumentId AddSourceTextContainer(
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (3)
58public ImmutableHashSet<DocumentId> DocumentsNotFromFiles { get; private set; } = []; 205internal void AddDocumentToDocumentsNotFromFiles_NoLock(DocumentId documentId) 212internal void RemoveDocumentToDocumentsNotFromFiles_NoLock(DocumentId documentId)
Workspace\ProjectSystem\SolutionChangeAccumulator.cs (7)
21private readonly List<DocumentId> _documentIdsRemoved = []; 24public IEnumerable<DocumentId> DocumentIdsRemoved => _documentIdsRemoved; 30public DocumentId? WorkspaceChangeDocumentId { get; private set; } 32public void UpdateSolutionForDocumentAction(Solution newSolution, WorkspaceChangeKind changeKind, IEnumerable<DocumentId> documentIds) 42foreach (var documentId in documentIds) 75/// The same as <see cref="UpdateSolutionForDocumentAction(Solution, WorkspaceChangeKind, IEnumerable{DocumentId})" /> but also records 78public void UpdateSolutionForRemovedDocumentAction(Solution solution, WorkspaceChangeKind removeDocumentChangeKind, IEnumerable<DocumentId> documentIdsRemoved)
Workspace\Solution\AssetPath.cs (4)
37public readonly DocumentId? DocumentId; 39public AssetPath(AssetPathKind kind, ProjectId? projectId = null, DocumentId? documentId = null) 51public AssetPath(AssetPathKind kind, DocumentId? documentId) 92public static implicit operator AssetPath(DocumentId documentId) => new(AssetPathKind.Documents, documentId);
Workspace\Solution\ChecksumCollection.cs (1)
64var hintDocument = assetPath.DocumentId;
Workspace\Solution\Document.cs (3)
479/// Gets the list of <see cref="DocumentId"/>s that are linked to this 481/// share the same <see cref="TextDocument.FilePath" />. This <see cref="DocumentId"/> is excluded from the 484public ImmutableArray<DocumentId> GetLinkedDocumentIds()
Workspace\Solution\DocumentDiagnostic.cs (2)
9public class DocumentDiagnostic(WorkspaceDiagnosticKind kind, string message, DocumentId documentId) : WorkspaceDiagnostic(kind, message) 11public DocumentId DocumentId { get; } = documentId;
Workspace\Solution\DocumentId.cs (13)
19public sealed class DocumentId : IEquatable<DocumentId> 39/// Creates a new <see cref="DocumentId"/> instance. 43public static DocumentId CreateNewId(ProjectId projectId, string? debugName = null) 46public static DocumentId CreateFromSerialized(ProjectId projectId, Guid id, string? debugName = null) 49internal static DocumentId CreateFromSerialized(ProjectId projectId, Guid id, bool isSourceGenerated, string? debugName) 69=> this.Equals(obj as DocumentId); 71public bool Equals(DocumentId? other) 83public static bool operator ==(DocumentId? left, DocumentId? right) 84=> EqualityComparer<DocumentId?>.Default.Equals(left, right); 86public static bool operator !=(DocumentId? left, DocumentId? right) 97internal static DocumentId ReadFrom(ObjectReader reader)
Workspace\Solution\DocumentInfo.cs (8)
26public DocumentId Id => Attributes.Id; 77DocumentId id, 117public DocumentInfo WithId(DocumentId id) 149DocumentId id, 162public DocumentId Id { get; } = id; 196DocumentId? id = null, 246var documentId = DocumentId.ReadFrom(reader);
Workspace\Solution\DocumentState.cs (6)
28private static readonly ConditionalWeakTable<SyntaxTree, DocumentId> s_syntaxTreeToIdMap = new(); 665private static void BindSyntaxTreeToId(SyntaxTree tree, DocumentId id) 667if (!s_syntaxTreeToIdMap.TryGetValue(tree, out var existingId)) 670var localId = id; 677public static DocumentId? GetDocumentIdForTree(SyntaxTree tree) 679s_syntaxTreeToIdMap.TryGetValue(tree, out var id);
Workspace\Solution\FileTextLoader.cs (1)
90public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
Workspace\Solution\Project.cs (47)
29private ImmutableDictionary<DocumentId, Document?> _idToDocumentMap = ImmutableDictionary<DocumentId, Document?>.Empty; 30private ImmutableDictionary<DocumentId, SourceGeneratedDocument> _idToSourceGeneratedDocumentMap = ImmutableDictionary<DocumentId, SourceGeneratedDocument>.Empty; 31private ImmutableDictionary<DocumentId, AdditionalDocument?> _idToAdditionalDocumentMap = ImmutableDictionary<DocumentId, AdditionalDocument?>.Empty; 32private ImmutableDictionary<DocumentId, AnalyzerConfigDocument?> _idToAnalyzerConfigDocumentMap = ImmutableDictionary<DocumentId, AnalyzerConfigDocument?>.Empty; 180public IReadOnlyList<DocumentId> DocumentIds => State.DocumentStates.Ids; 185public IReadOnlyList<DocumentId> AdditionalDocumentIds => State.AdditionalDocumentStates.Ids; 190internal IReadOnlyList<DocumentId> AnalyzerConfigDocumentIds => State.AnalyzerConfigDocumentStates.Ids; 211public bool ContainsDocument(DocumentId documentId) 217public bool ContainsAdditionalDocument(DocumentId documentId) 223public bool ContainsAnalyzerConfigDocument(DocumentId documentId) 229public DocumentId? GetDocumentId(SyntaxTree? syntaxTree) 241public Document? GetDocument(DocumentId documentId) 247public TextDocument? GetAdditionalDocument(DocumentId documentId) 253public AnalyzerConfigDocument? GetAnalyzerConfigDocument(DocumentId documentId) 259internal async ValueTask<Document?> GetDocumentAsync(DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 273internal async ValueTask<TextDocument?> GetTextDocumentAsync(DocumentId documentId, CancellationToken cancellationToken = default) 303public async ValueTask<SourceGeneratedDocument?> GetSourceGeneratedDocumentAsync(DocumentId documentId, CancellationToken cancellationToken = default) 338internal SourceGeneratedDocument? TryGetSourceGeneratedDocumentForAlreadyGeneratedId(DocumentId documentId) 465private static readonly Func<DocumentId, Project, Document?> s_tryCreateDocumentFunction = 468private static readonly Func<DocumentId, Project, AdditionalDocument?> s_tryCreateAdditionalDocumentFunction = 471private static readonly Func<DocumentId, Project, AnalyzerConfigDocument?> s_tryCreateAnalyzerConfigDocumentFunction = 474private static readonly Func<DocumentId, (SourceGeneratedDocumentState state, Project project), SourceGeneratedDocument> s_createSourceGeneratedDocumentFunction = 701var id = DocumentId.CreateNewId(this.Id); 713var id = DocumentId.CreateNewId(this.Id); 722var id = DocumentId.CreateNewId(this.Id, debugName: name); 731var id = DocumentId.CreateNewId(this.Id); 740var id = DocumentId.CreateNewId(this.Id); 749var id = DocumentId.CreateNewId(this.Id); 756public Project RemoveDocument(DocumentId documentId) 766public Project RemoveDocuments(ImmutableArray<DocumentId> documentIds) 776public Project RemoveAdditionalDocument(DocumentId documentId) 784public Project RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 794public Project RemoveAnalyzerConfigDocument(DocumentId documentId) 802public Project RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 809private void CheckIdsContainedInProject(ImmutableArray<DocumentId> documentIds) 811foreach (var documentId in documentIds) 838var documentId = await State.GetDocumentIdAsync(contentHash, cancellationToken).ConfigureAwait(false);
Workspace\Solution\ProjectChanges.cs (20)
97/// Get <see cref="DocumentId"/>s of added documents in the order they appear in <see cref="Project.DocumentIds"/> of the <see cref="NewProject"/>. 99public IEnumerable<DocumentId> GetAddedDocuments() 103/// Get <see cref="DocumentId"/>s of added dditional documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="NewProject"/>. 105public IEnumerable<DocumentId> GetAddedAdditionalDocuments() 109/// Get <see cref="DocumentId"/>s of added analyzer config documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="NewProject"/>. 111public IEnumerable<DocumentId> GetAddedAnalyzerConfigDocuments() 115/// Get <see cref="DocumentId"/>s of documents with any changes (textual and non-textual) 118public IEnumerable<DocumentId> GetChangedDocuments() 126public IEnumerable<DocumentId> GetChangedDocuments(bool onlyGetDocumentsWithTextChanges) 129internal IEnumerable<DocumentId> GetChangedDocuments(bool onlyGetDocumentsWithTextChanges, bool ignoreUnchangeableDocuments) 133/// Get <see cref="DocumentId"/>s of additional documents with any changes (textual and non-textual) 136public IEnumerable<DocumentId> GetChangedAdditionalDocuments() 140/// Get <see cref="DocumentId"/>s of analyzer config documents with any changes (textual and non-textual) 143public IEnumerable<DocumentId> GetChangedAnalyzerConfigDocuments() 147/// Get <see cref="DocumentId"/>s of removed documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="OldProject"/>. 149public IEnumerable<DocumentId> GetRemovedDocuments() 153/// Get <see cref="DocumentId"/>s of removed additional documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="OldProject"/>. 155public IEnumerable<DocumentId> GetRemovedAdditionalDocuments() 159/// Get <see cref="DocumentId"/>s of removed analyzer config documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="OldProject"/>. 161public IEnumerable<DocumentId> GetRemovedAnalyzerConfigDocuments()
Workspace\Solution\ProjectState.cs (15)
32/// The documents in this project. They are sorted by <see cref="DocumentId.Id"/> to provide a stable sort for 38/// The additional documents in this project. They are sorted by <see cref="DocumentId.Id"/> to provide a stable sort for 44/// The analyzer config documents in this project. They are sorted by <see cref="DocumentId.Id"/> to provide a stable sort for 55private readonly AsyncLazy<Dictionary<ImmutableArray<byte>, DocumentId>> _lazyContentHashToDocumentId; 144private async Task<Dictionary<ImmutableArray<byte>, DocumentId>> ComputeContentHashToDocumentIdAsync(CancellationToken cancellationToken) 146var result = new Dictionary<ImmutableArray<byte>, DocumentId>(ImmutableArrayComparer<byte>.Instance); 169public async ValueTask<DocumentId?> GetDocumentIdAsync(ImmutableArray<byte> contentHash, CancellationToken cancellationToken) 372var documentId = DocumentState.GetDocumentIdForTree(tree); 444var documentId = DocumentState.GetDocumentIdForTree(tree); 914public ProjectState RemoveDocuments(ImmutableArray<DocumentId> documentIds) 927public ProjectState RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 937public ProjectState RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 1021public ProjectState UpdateDocumentsOrder(ImmutableList<DocumentId> documentIds) 1106public void AddDocumentIdsWithFilePath(ref TemporaryArray<DocumentId> temporaryArray, string filePath) 1113public DocumentId? GetFirstDocumentIdWithFilePath(string filePath)
Workspace\Solution\Solution.cs (69)
43private readonly Dictionary<DocumentId, AsyncLazy<Solution>> _documentIdToFrozenSolution = []; 211public bool ContainsDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) => this.SolutionState.ContainsDocument(documentId); 216public bool ContainsAdditionalDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) => this.SolutionState.ContainsAdditionalDocument(documentId); 221public bool ContainsAnalyzerConfigDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) => this.SolutionState.ContainsAnalyzerConfigDocument(documentId); 226public DocumentId? GetDocumentId(SyntaxTree? syntaxTree) => GetDocumentId(syntaxTree, projectId: null); 231public DocumentId? GetDocumentId(SyntaxTree? syntaxTree, ProjectId? projectId) 237public Document? GetDocument(DocumentId? documentId) 243internal ValueTask<Document?> GetDocumentAsync(DocumentId? documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 258internal ValueTask<TextDocument?> GetTextDocumentAsync(DocumentId? documentId, CancellationToken cancellationToken = default) 273public TextDocument? GetAdditionalDocument(DocumentId? documentId) 286public AnalyzerConfigDocument? GetAnalyzerConfigDocument(DocumentId? documentId) 296public ValueTask<SourceGeneratedDocument?> GetSourceGeneratedDocumentAsync(DocumentId documentId, CancellationToken cancellationToken) 556public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds) 929public Solution AddDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 947public Solution AddDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false) 966public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue) 984private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated) 998public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null) 1038public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 1045public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1076public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1100private DocumentInfo CreateDocumentInfo(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders, string? filePath) 1127public Solution RemoveDocument(DocumentId documentId) 1136public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds) 1142private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1148public Solution RemoveAdditionalDocument(DocumentId documentId) 1157public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 1163private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1169public Solution RemoveAnalyzerConfigDocument(DocumentId documentId) 1178public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 1184private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1190public Solution WithDocumentName(DocumentId documentId, string name) 1209public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders) 1224public Solution WithDocumentFilePath(DocumentId documentId, string? filePath) 1238public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1241internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue) 1261public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1282public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1303public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1324public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1345public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1366public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue) 1370internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue) 1386internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState, bool forceEvenIfTreesWouldDiffer) 1389internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer) 1396public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind) 1419public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1440public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1461public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1512internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken) 1531static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId) 1536static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken) 1562internal ImmutableArray<DocumentId> GetRelatedDocumentIds(DocumentId documentId, bool includeDifferentLanguages = false) 1572internal DocumentId? GetFirstRelatedDocumentId(DocumentId documentId, ProjectId? relatedProjectIdHint) 1592public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1670/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a 1676/// were to return more than one <see cref="DocumentId"/>, you should not assume that just because one is a regular source file means 1679public ImmutableArray<DocumentId> GetDocumentIdsWithFilePath(string? filePath) => this.SolutionState.GetDocumentIdsWithFilePath(filePath); 1737private void CheckContainsDocument(DocumentId documentId) 1750private void CheckContainsDocuments(ImmutableArray<DocumentId> documentIds) 1757foreach (var documentId in documentIds) 1763private void CheckContainsAdditionalDocument(DocumentId documentId) 1776private void CheckContainsAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 1783foreach (var documentId in documentIds) 1789private void CheckContainsAnalyzerConfigDocument(DocumentId documentId) 1802private void CheckContainsAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 1809foreach (var documentId in documentIds)
Workspace\Solution\Solution_SemanticModelCaching.cs (2)
30internal void OnSemanticModelObtained(DocumentId documentId, SemanticModel semanticModel) 34var activeDocumentId = service.TryGetActiveDocument();
Workspace\Solution\SolutionCompilationState.cs (37)
553ProjectId projectId, ImmutableList<DocumentId> documentIds) 605using var _2 = ArrayBuilder<DocumentId>.GetInstance(out var removedDocumentInfos); 642foreach (var oldDocumentId in oldDocumentStates.Ids) 773DocumentId documentId, 781internal SolutionCompilationState WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode) 796ImmutableArray<(DocumentId documentId, TDocumentData documentData)> documentsToUpdate, 906/// <inheritdoc cref="SolutionState.WithAdditionalDocumentText(DocumentId, SourceText, PreservationMode)"/> 908DocumentId documentId, SourceText text, PreservationMode mode) 914/// <inheritdoc cref="SolutionState.WithAnalyzerConfigDocumentText(DocumentId, SourceText, PreservationMode)"/> 916DocumentId documentId, SourceText text, PreservationMode mode) 925/// <inheritdoc cref="SolutionState.WithDocumentText(DocumentId, TextAndVersion, PreservationMode)"/> 927DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode) 933/// <inheritdoc cref="SolutionState.WithAdditionalDocumentText(DocumentId, TextAndVersion, PreservationMode)"/> 935DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode) 941/// <inheritdoc cref="SolutionState.WithAnalyzerConfigDocumentText(DocumentId, TextAndVersion, PreservationMode)"/> 943DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode) 949/// <inheritdoc cref="Solution.WithDocumentSyntaxRoots(ImmutableArray{ValueTuple{DocumentId, SyntaxNode}}, PreservationMode)"/> 950public SolutionCompilationState WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode) 962ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer) 975DocumentId documentId, SourceCodeKind sourceCodeKind) 983DocumentId documentId, TextLoader loader, PreservationMode mode) 998DocumentId documentId, TextLoader loader, PreservationMode mode) 1013DocumentId documentId, TextLoader loader, PreservationMode mode) 1026private SolutionCompilationState UpdateDocumentState(StateChange stateChange, DocumentId documentId) 1045private SolutionCompilationState UpdateAdditionalDocumentState(StateChange stateChange, DocumentId documentId) 1203DocumentId documentId) 1513DocumentId documentId, CancellationToken cancellationToken) 1566SolutionCompilationState @this, DocumentId documentId, CancellationToken cancellationToken) 1577foreach (var currentDocumentId in allDocumentIds) 1606var documentId = newDocumentState.Id; 1658public SolutionCompilationState RemoveDocumentsFromMultipleProjects<T>(ImmutableArray<DocumentId> documentIds) 1680private SolutionCompilationState RemoveDocumentsFromSingleProject<T>(ProjectId projectId, ImmutableArray<DocumentId> documentIds) 1688foreach (var documentId in documentIds) 1709private static TranslationAction GetRemoveDocumentsTranslationAction<TDocumentState>(ProjectState oldProject, ImmutableArray<DocumentId> documentIds, ImmutableArray<TDocumentState> states) 1759public SolutionCompilationState WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode) 1761using var _ = ArrayBuilder<(DocumentId, SourceText)>.GetInstance(out var changedDocuments); 1763foreach (var documentId in documentIds)
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (1)
74SourceGeneratedDocumentState? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
897public SourceGeneratedDocumentState? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (2)
117using var _1 = ArrayBuilder<DocumentId>.GetInstance(out var documentsToAddOrUpdate); 118using var _2 = PooledDictionary<DocumentId, int>.GetInstance(out var documentIdToIndex);
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (2)
20var documentId = DocumentState.GetDocumentIdForTree(syntaxTree); 84var documentId = this.GetDocumentState(syntaxTree, projectId: null)?.Id;
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (1)
214public SourceGeneratedDocumentState? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId)
Workspace\Solution\SolutionState.cs (29)
61private ImmutableDictionary<string, ImmutableArray<DocumentId>> _lazyFilePathToRelatedDocumentIds = ImmutableDictionary<string, ImmutableArray<DocumentId>>.Empty.WithComparers(FilePathComparer); 271public bool ContainsDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) 282public bool ContainsAdditionalDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) 293public bool ContainsAnalyzerConfigDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) 301internal DocumentState GetRequiredDocumentState(DocumentId documentId) 304private AdditionalDocumentState GetRequiredAdditionalDocumentState(DocumentId documentId) 307private AnalyzerConfigDocumentState GetRequiredAnalyzerConfigDocumentState(DocumentId documentId) 804public StateChange WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds) 813foreach (var id in documentIds) 931DocumentId documentId, 951public StateChange WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 979public StateChange WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 995public StateChange WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1011public StateChange WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1027public StateChange WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1043public StateChange WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1059public StateChange WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind) 1071public StateChange UpdateDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1084public StateChange UpdateAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1097public StateChange UpdateAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1167public ImmutableArray<DocumentId> GetDocumentIdsWithFilePath(string? filePath) 1178static ImmutableArray<DocumentId> ComputeDocumentIdsWithFilePath(SolutionState @this, string filePath) 1180using var result = TemporaryArray<DocumentId>.Empty; 1237public DocumentId? GetFirstRelatedDocumentId(DocumentId documentId, ProjectId? relatedProjectIdHint) 1257foreach (var relatedDocumentId in relatedDocumentIds) 1290public ImmutableArray<DocumentId> GetRelatedDocumentIds(DocumentId documentId, bool includeDifferentLanguages)
Workspace\Solution\SourceGeneratedDocumentIdentity.cs (6)
21[DataMember(Order = 0)] public DocumentId DocumentId { get; } 26public SourceGeneratedDocumentIdentity(DocumentId documentId, string hintName, SourceGeneratorIdentity generator, string filePath) 70var documentId = DocumentId.CreateFromSerialized(projectId, guid, isSourceGenerated: true, hintName); 89var documentId = DocumentId.ReadFrom(reader);
Workspace\Solution\StateChecksums.cs (1)
158var documentId = assetPath.DocumentId;
Workspace\Solution\TextDocument.cs (1)
39public DocumentId Id => State.Id;
Workspace\Solution\TextDocumentState.cs (1)
48public DocumentId Id => Attributes.Id;
Workspace\Solution\TextDocumentStates.cs (42)
27using FilePathToDocumentIds = FrozenDictionary<string, OneOrMany<DocumentId>>; 33/// Holds on a <see cref="DocumentId"/> to <see cref="TextDocumentState"/> map and an ordering. 39private static readonly ObjectPool<Dictionary<string, OneOrMany<DocumentId>>> s_filePathPool = new(() => new(SolutionState.FilePathComparer)); 44ImmutableSortedDictionary.Create<DocumentId, TState>(DocumentIdComparer.Instance), 51private readonly ImmutableList<DocumentId> _ids; 55ImmutableList<DocumentId> ids, 56ImmutableSortedDictionary<DocumentId, TState> map, 80public TextDocumentStates<TState> WithCompilationOrder(ImmutableList<DocumentId> ids) 89public bool Contains(DocumentId id) 92public bool TryGetState(DocumentId documentId, [NotNullWhen(true)] out TState? state) 95public TState? GetState(DocumentId documentId) 98public TState GetRequiredState(DocumentId documentId) 102/// <see cref="DocumentId"/>s in the order in which they were added to the project (the compilation order). 104public IReadOnlyList<DocumentId> Ids => _ids; 107/// States ordered by <see cref="DocumentId"/>. 110/// The entries in the map are sorted by <see cref="DocumentId.Id"/>, which yields locally deterministic order but not the order that 114public ImmutableSortedDictionary<DocumentId, TState> States { get; } 142using var pooledIds = SharedPools.Default<List<DocumentId>>().GetPooledObject(); 154public TextDocumentStates<TState> RemoveRange(ImmutableArray<DocumentId> ids) 158using var _ = PooledHashSet<DocumentId>.GetInstance(out var set); 164foreach (var documentId in _ids) 171IEnumerable<DocumentId> enumerableIds = ids; 185var id = state.Id; 220/// Returns a <see cref="DocumentId"/>s of documents whose state changed when compared to older states. 222public IEnumerable<DocumentId> GetChangedStateIds(TextDocumentStates<TState> oldStates, bool ignoreUnchangedContent = false, bool ignoreUnchangeableDocuments = false) 226foreach (var id in Ids) 250/// Returns a <see cref="DocumentId"/>s of added documents. 252public IEnumerable<DocumentId> GetAddedStateIds(TextDocumentStates<TState> oldStates) 256/// Returns a <see cref="DocumentId"/>s of removed documents. 258public IEnumerable<DocumentId> GetRemovedStateIds(TextDocumentStates<TState> oldStates) 261private static IEnumerable<DocumentId> Except(ImmutableList<DocumentId> ids, ImmutableSortedDictionary<DocumentId, TState> map) 263foreach (var id in ids) 284private sealed class DocumentIdComparer : IComparer<DocumentId?> 286public static readonly IComparer<DocumentId?> Instance = new DocumentIdComparer(); 292public int Compare(DocumentId? x, DocumentId? y) 311var documentIds = new FixedSizeArrayBuilder<DocumentId>(States.Count); 327public void AddDocumentIdsWithFilePath(ref TemporaryArray<DocumentId> temporaryArray, string filePath) 334foreach (var value in oneOrMany) 339public DocumentId? GetFirstDocumentIdWithFilePath(string filePath)
Workspace\Solution\TextLoader.cs (2)
65_ => new StrongBox<bool>(new Func<Workspace, DocumentId, CancellationToken, Task<TextAndVersion>>(LoadTextAndVersionAsync).Method.DeclaringType != typeof(TextLoader))).Value) 83public virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
Workspace\TextExtensions.cs (4)
23var documentId = workspace.GetDocumentIdInCurrentContext(text.Container); 64var id = workspace.GetDocumentIdInCurrentContext(text.Container); 111var documentId = workspace.GetDocumentIdInCurrentContext(container); 130var id = workspace.GetDocumentIdInCurrentContext(container);
Workspace\Workspace.cs (72)
191/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/> 196DocumentId? documentId = null, 223Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 243Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 287using var _1 = PooledHashSet<DocumentId>.GetInstance(out var changedDocumentIds); 288using var _2 = ArrayBuilder<DocumentId>.GetInstance(out var addedDocumentIds); 320Solution solution, ArrayBuilder<DocumentId> addedDocumentIds) 323using var _ = ArrayBuilder<(DocumentId, DocumentState)>.GetInstance(out var relatedDocumentIdsAndStates); 325foreach (var addedDocumentId in addedDocumentIds) 336var relatedDocumentId = solution.GetFirstRelatedDocumentId(addedDocumentId, relatedProjectIdHint); 360static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds) 364using var _ = PooledDictionary<DocumentId, DocumentState>.GetInstance(out var relatedDocumentIdsAndStates); 366foreach (var changedDocumentId in changedDocumentIds) 371foreach (var relatedDocumentId in relatedDocumentIds) 606protected virtual void OnDocumentClosing(DocumentId documentId) 664protected internal virtual void ClearDocumentData(DocumentId documentId) 1036protected internal void OnDocumentRemoved(DocumentId documentId) 1055protected virtual void CheckDocumentCanBeRemoved(DocumentId documentId) 1062protected internal void OnDocumentInfoChanged(DocumentId documentId, DocumentInfo newInfo) 1100protected internal void OnDocumentTextChanged(DocumentId documentId, SourceText newText, PreservationMode mode) 1103private protected void OnDocumentTextChanged(DocumentId documentId, SourceText newText, PreservationMode mode, bool requireDocumentPresent) 1118protected internal void OnAdditionalDocumentTextChanged(DocumentId documentId, SourceText newText, PreservationMode mode) 1133protected internal void OnAnalyzerConfigDocumentTextChanged(DocumentId documentId, SourceText newText, PreservationMode mode) 1148protected internal void OnDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1154private protected void OnDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader, bool requireDocumentPresent) 1169protected internal void OnAdditionalDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1184protected internal void OnAnalyzerConfigDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1211DocumentId documentId, 1213Func<Solution, DocumentId, TextDocument?> getDocumentInSolution, 1214Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText, 1221var updatedDocumentIds = new List<DocumentId>(); 1231var documentId = data.documentId; 1267foreach (var linkedDocumentId in linkedDocumentIds) 1284foreach (var updatedDocumentId in data.updatedDocumentIds) 1292foreach (var updatedDocumentInfo in data.updatedDocumentIds) 1306protected internal void OnDocumentSourceCodeKindChanged(DocumentId documentId, SourceCodeKind sourceCodeKind) 1337protected internal void OnAdditionalDocumentRemoved(DocumentId documentId) 1376protected internal void OnAnalyzerConfigDocumentRemoved(DocumentId documentId) 1581using var _1 = PooledHashSet<DocumentId>.GetInstance(out var infoChangedDocumentIds); 1585foreach (var docId in projectChange.GetChangedDocuments()) 1715foreach (var documentId in changedDocumentIds) 1879foreach (var documentId in projectChanges.GetRemovedDocuments()) 1885foreach (var documentId in projectChanges.GetRemovedAdditionalDocuments()) 1891foreach (var documentId in projectChanges.GetRemovedAnalyzerConfigDocuments()) 1897foreach (var documentId in projectChanges.GetAddedDocuments()) 1906foreach (var documentId in projectChanges.GetAddedAdditionalDocuments()) 1915foreach (var documentId in projectChanges.GetAddedAnalyzerConfigDocuments()) 1924foreach (var documentId in projectChanges.GetChangedDocuments()) 1930foreach (var documentId in projectChanges.GetChangedAdditionalDocuments()) 1940foreach (var documentId in projectChanges.GetChangedAnalyzerConfigDocuments()) 1951ProjectChanges projectChanges, DocumentId documentId) 2186protected virtual void ApplyDocumentRemoved(DocumentId documentId) 2197protected virtual void ApplyDocumentTextChanged(DocumentId id, SourceText text) 2208protected virtual void ApplyDocumentInfoChanged(DocumentId id, DocumentInfo info) 2230protected virtual void ApplyAdditionalDocumentRemoved(DocumentId documentId) 2241protected virtual void ApplyAdditionalDocumentTextChanged(DocumentId id, SourceText text) 2263protected virtual void ApplyAnalyzerConfigDocumentRemoved(DocumentId documentId) 2274protected virtual void ApplyAnalyzerConfigDocumentTextChanged(DocumentId id, SourceText text) 2438protected void CheckDocumentIsInCurrentSolution(DocumentId documentId) 2441private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId) 2454protected void CheckAdditionalDocumentIsInCurrentSolution(DocumentId documentId) 2457private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId) 2470protected void CheckAnalyzerConfigDocumentIsInCurrentSolution(DocumentId documentId) 2473private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId) 2486protected void CheckDocumentIsNotInCurrentSolution(DocumentId documentId) 2499protected void CheckAdditionalDocumentIsNotInCurrentSolution(DocumentId documentId) 2502private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId) 2515protected void CheckAnalyzerConfigDocumentIsNotInCurrentSolution(DocumentId documentId) 2518private static void CheckAnalyzerConfigDocumentIsNotInSolution(Solution solution, DocumentId documentId) 2541protected virtual string GetDocumentName(DocumentId documentId) 2551protected virtual string GetAdditionalDocumentName(DocumentId documentId) 2557protected virtual string GetAnalyzerConfigDocumentName(DocumentId documentId)
Workspace\Workspace.TextTracker.cs (4)
21private readonly DocumentId _documentId; 24private readonly Action<Workspace, DocumentId, SourceText, PreservationMode> _onChangedHandler; 28DocumentId documentId, 30Action<Workspace, DocumentId, SourceText, PreservationMode> onChangedHandler)
Workspace\Workspace_Editor.cs (77)
23private readonly Dictionary<ProjectId, HashSet<DocumentId>> _projectToOpenDocumentsMap = []; 30private readonly Dictionary<SourceTextContainer, DocumentId> _bufferToDocumentInCurrentContextMap = []; 35private readonly Dictionary<SourceTextContainer, OneOrMany<DocumentId>> _bufferToAssociatedDocumentsMap = []; 37private readonly Dictionary<DocumentId, TextTracker> _textTrackers = []; 38private readonly Dictionary<DocumentId, SourceTextContainer> _documentToAssociatedBufferMap = []; 39private readonly Dictionary<DocumentId, (SourceGeneratedDocumentIdentity identity, DateTime generationDateTime)> _openSourceGeneratedDocumentIdentities = []; 47/// True if this workspace supports manually changing the active context document of a text buffer by calling <see cref="SetDocumentContext(DocumentId)" />. 53List<DocumentId> docIds; 59foreach (var docId in docIds) 67HashSet<DocumentId>? openDocs; 77foreach (var docId in copyOfOpenDocs) 84protected void ClearOpenDocument(DocumentId documentId) 101var currentContextDocumentId = RemoveDocumentFromCurrentContextMapping_NoLock(textContainer, documentId); 112protected void ClearOpenDocument(DocumentId documentId, bool isSolutionClosing) 118public virtual void OpenDocument(DocumentId documentId, bool activate = true) 124public virtual void CloseDocument(DocumentId documentId) 130public virtual void OpenAdditionalDocument(DocumentId documentId, bool activate = true) 136public virtual void CloseAdditionalDocument(DocumentId documentId) 142public virtual void OpenAnalyzerConfigDocument(DocumentId documentId, bool activate = true) 148public virtual void CloseAnalyzerConfigDocument(DocumentId documentId) 178public virtual bool IsDocumentOpen(DocumentId documentId) 190public virtual IEnumerable<DocumentId> GetOpenDocumentIds(ProjectId? projectId = null) 215public virtual IEnumerable<DocumentId> GetRelatedDocumentIds(SourceTextContainer container) 222var documentId = GetDocumentIdInCurrentContext(container); 235public virtual DocumentId? GetDocumentIdInCurrentContext(SourceTextContainer container) 248private DocumentId? GetDocumentIdInCurrentContext_NoLock(SourceTextContainer container) 249=> _bufferToDocumentInCurrentContextMap.TryGetValue(container, out var documentId) ? documentId : null; 252/// Finds the <see cref="DocumentId"/> related to the given <see cref="DocumentId"/> that 253/// is in the current context. If the <see cref="DocumentId"/> is currently closed, then 258internal DocumentId GetDocumentIdInCurrentContext(DocumentId documentId) 270var currentContextId = GetDocumentIdInCurrentContext_NoLock(container); 279private SourceTextContainer? GetOpenDocumentSourceTextContainer_NoLock(DocumentId documentId) 285internal bool TryGetOpenSourceGeneratedDocumentIdentity(DocumentId id, out (SourceGeneratedDocumentIdentity identity, DateTime generationDateTime) documentIdentity) 295internal virtual void SetDocumentContext(DocumentId documentId) 301protected internal void OnDocumentContextUpdated(DocumentId documentId) 305DocumentId oldActiveContextDocumentId; 331protected void CheckDocumentIsClosed(DocumentId documentId) 341protected void CheckDocumentIsOpen(DocumentId documentId) 351protected internal void OnDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) 354internal virtual ValueTask TryOnDocumentOpenedAsync(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, CancellationToken cancellationToken) 360internal void OnDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, bool requireDocumentPresentAndClosed) 436/// cref="OnDocumentOpened(DocumentId, SourceTextContainer, bool)" />, this doesn't result in the workspace 447var documentId = document.Identity.DocumentId; 494private void SignupForTextChanges(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, Action<Workspace, DocumentId, SourceText, PreservationMode> onChangedHandler) 503private void AddToOpenDocumentMap(DocumentId documentId) 511protected internal void OnAdditionalDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) 514private protected void OnAdditionalDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, bool requireDocumentPresentAndClosed) 528protected internal void OnAnalyzerConfigDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) 531private protected void OnAnalyzerConfigDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, bool requireDocumentPresentAndClosed) 549DocumentId documentId, 554Action<Solution, DocumentId> checkTextDocumentIsInSolution, 555Func<Solution, DocumentId, SourceText, PreservationMode, Solution> withDocumentText, 556Func<Solution, DocumentId, TextAndVersion, PreservationMode, Solution> withDocumentTextAndVersion, 557Action<Workspace, DocumentId, SourceText, PreservationMode> onDocumentTextChanged) 563var documentId = data.documentId; 606var documentId = data.documentId; 630internal virtual ValueTask TryOnDocumentClosedAsync(DocumentId documentId, CancellationToken cancellationToken) 636protected internal void OnDocumentClosed(DocumentId documentId, TextLoader reloader, bool updateActiveContext = false) 642private protected void OnDocumentClosedEx(DocumentId documentId, TextLoader reloader, bool requireDocumentPresentAndOpen) 712protected internal void OnAdditionalDocumentClosed(DocumentId documentId, TextLoader reloader) 715private protected void OnAdditionalDocumentClosed(DocumentId documentId, TextLoader reloader, bool requireDocumentPresentAndOpen) 726protected internal void OnAnalyzerConfigDocumentClosed(DocumentId documentId, TextLoader reloader) 729private protected void OnAnalyzerConfigDocumentClosed(DocumentId documentId, TextLoader reloader, bool requireDocumentPresentAndOpen) 744DocumentId documentId, 748Action<Solution, DocumentId> checkTextDocumentIsInSolution, 749Func<Solution, DocumentId, TextLoader, PreservationMode, Solution> withTextDocumentTextLoader) 755var documentId = data.documentId; 796private void UpdateCurrentContextMapping_NoLock(SourceTextContainer textContainer, DocumentId id, bool isCurrentContext) 809docIds = new OneOrMany<DocumentId>(id); 821private DocumentId? RemoveDocumentFromCurrentContextMapping_NoLock(SourceTextContainer textContainer, DocumentId closedDocumentId) 849private SourceText GetOpenDocumentText(Solution solution, DocumentId documentId) 867foreach (var docId in this.GetOpenDocumentIds()) 885foreach (var docId in this.GetOpenDocumentIds(oldProject.Id))
Workspace\Workspace_Events.cs (3)
45protected Task RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId projectId = null, DocumentId documentId = null) 225protected Task RaiseDocumentActiveContextChangedEventAsync(SourceTextContainer sourceTextContainer, DocumentId oldActiveContextDocumentId, DocumentId newActiveContextDocumentId)
Workspace\WorkspaceChangeEventArgs.cs (2)
63public DocumentId? DocumentId { get; } 65public WorkspaceChangeEventArgs(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId? projectId = null, DocumentId? documentId = null)
Microsoft.CodeAnalysis.Workspaces.MSBuild (6)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
445DocumentId.CreateNewId(projectId, debugName: info.FilePath),
MSBuild\MSBuildWorkspace.cs (5)
385protected override void ApplyDocumentTextChanged(DocumentId documentId, SourceText text) 403protected override void ApplyAdditionalDocumentTextChanged(DocumentId documentId, SourceText text) 487private void SaveDocumentText(DocumentId id, string fullPath, SourceText newText, Encoding encoding) 509protected override void ApplyDocumentRemoved(DocumentId documentId) 522private void DeleteDocumentFile(DocumentId documentId, string fullPath)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
2169var newDocId = DocumentId.CreateNewId(project.Id); 2206workspace.TryApplyChanges(workspace.CurrentSolution.AddAdditionalDocument(DocumentId.CreateNewId(csProjectId), "foo.xaml", SourceText.From("<foo></foo>")));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (45)
SolutionUtilities.cs (9)
42var documentId = projectDifferences.GetChangedDocuments().Single(); 50var documentId = projectDifferences.GetChangedAdditionalDocuments().Single(); 55public static IEnumerable<DocumentId> GetChangedDocuments(Solution oldSolution, Solution newSolution) 57var changedDocuments = new List<DocumentId>(); 70var documentId = projectDifferences.GetAddedDocuments().Single(); 75public static IEnumerable<DocumentId> GetTextChangedDocuments(Solution oldSolution, Solution newSolution) 77var changedDocuments = new List<DocumentId>(); 87public static IEnumerable<DocumentId> GetAddedDocuments(Solution oldSolution, Solution newSolution) 89var addedDocuments = new List<DocumentId>();
WorkspaceExtensions.cs (7)
15public static DocumentId AddDocument(this Workspace workspace, ProjectId projectId, IEnumerable<string> folders, string name, SourceText initialText, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular) 17var id = projectId.CreateDocumentId(name, folders); 24public static void RemoveDocument(this Workspace workspace, DocumentId documentId) 31public static void UpdateDocument(this Workspace workspace, DocumentId documentId, SourceText newText) 41public static DocumentId CreateDocumentId(this ProjectId projectId, string name, IEnumerable<string>? folders = null) 46return DocumentId.CreateNewId(projectId, uniqueName); 50return DocumentId.CreateNewId(projectId, name);
Workspaces\TestHostDocument.cs (4)
25private DocumentId? _id; 31public DocumentId Id 133DocumentId? id = null, 163_id = DocumentId.CreateNewId(project.Id, this.Name);
Workspaces\TestWorkspace.cs (1)
39DocumentId? id = null,
Workspaces\TestWorkspace_ILspWorkspace.cs (1)
17ValueTask ILspWorkspace.UpdateTextIfPresentAsync(DocumentId documentId, SourceText sourceText, CancellationToken cancellationToken)
Workspaces\TestWorkspace`1.cs (23)
181DocumentId? id = null, 285public new void OnDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) 294public void OnDocumentRemoved(DocumentId documentId, bool closeDocument = false) 304public new void OnDocumentSourceCodeKindChanged(DocumentId documentId, SourceCodeKind sourceCodeKind) 307public DocumentId? GetDocumentId(TDocument hostDocument) 319public TDocument? GetTestDocument(DocumentId documentId) 322public TDocument? GetTestAdditionalDocument(DocumentId documentId) 325public TDocument? GetTestAnalyzerConfigDocument(DocumentId documentId) 328public TestHostProject<TDocument>? GetTestProject(DocumentId documentId) 405protected override void ApplyDocumentRemoved(DocumentId documentId) 427protected override void ApplyAdditionalDocumentRemoved(DocumentId documentId) 451protected override void ApplyAnalyzerConfigDocumentRemoved(DocumentId documentId) 479internal override void SetDocumentContext(DocumentId documentId) 486internal override ValueTask TryOnDocumentClosedAsync(DocumentId documentId, CancellationToken cancellationToken) 498public override void CloseDocument(DocumentId documentId) 508public override void CloseAdditionalDocument(DocumentId documentId) 518public override void CloseAnalyzerConfigDocument(DocumentId documentId) 528public async Task CloseSourceGeneratedDocumentAsync(DocumentId documentId) 540public Task ChangeDocumentAsync(DocumentId documentId, SourceText text) 545public Task ChangeDocumentAsync(DocumentId documentId, Solution solution) 554var documentId = documentInfo.Id; 561public void ChangeAdditionalDocument(DocumentId documentId, SourceText text) 568public void ChangeAnalyzerConfigDocument(DocumentId documentId, SourceText text)
Microsoft.CodeAnalysis.Workspaces.UnitTests (338)
FindAllDeclarationsTests.cs (6)
159var submission0DocId = DocumentId.CreateNewId(submission0Id); 174var submission1DocId = DocumentId.CreateNewId(submission1Id); 702var did = DocumentId.CreateNewId(pid);
FindAllDeclarationsTests.TestSolutionsAndProject.cs (4)
101var did = DocumentId.CreateNewId(pid); 115var did = DocumentId.CreateNewId(pid);
FindReferencesTests.cs (16)
31var did = DocumentId.CreateNewId(pid); 47var did = DocumentId.CreateNewId(pid); 62var did = DocumentId.CreateNewId(pid); 81var did = DocumentId.CreateNewId(pid); 121var did = DocumentId.CreateNewId(pid); 170var docId = DocumentId.CreateNewId(prj1Id); 209var docId = DocumentId.CreateNewId(prj1Id); 273var docId = DocumentId.CreateNewId(prj1Id);
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (3)
22var documentIds = new List<DocumentId>(); 27var documentId = DocumentId.CreateNewId(projectId);
SolutionTests\DocumentInfoTests.cs (12)
22var documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()); 34var id = DocumentId.CreateNewId(ProjectId.CreateNewId()); 53var id = DocumentId.CreateNewId(ProjectId.CreateNewId()); 72var documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()); 96var info = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc_name", filePath: path, sourceCodeKind: kind); 105var documentId = DocumentId.CreateNewId(projectId); 106var instance = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc");
SolutionTests\ProjectInfoTests.cs (4)
39var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "doc"); 75var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc"); 94var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc"); 184var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "doc");
SolutionTests\SolutionTests.cs (256)
50private static readonly DocumentId s_unrelatedDocumentId = DocumentId.CreateNewId(ProjectId.CreateNewId()); 60.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", SourceText.From("public class Goo { }", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "goo.cs")) 61.AddAdditionalDocument(DocumentId.CreateNewId(projectId), "add.txt", SourceText.From("text", Encoding.UTF8, SourceHashAlgorithms.Default)) 62.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From(editorConfig ?? "#empty", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg")))); 82.AddDocument(DocumentId.CreateNewId(projectId1), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs") 83.AddAdditionalDocument(DocumentId.CreateNewId(projectId1), "add.txt", SourceText.From("text", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "add.txt") 84.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId1), "editorcfg", SourceText.From("config", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "/a/b") 86.AddDocument(DocumentId.CreateNewId(projectId2), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs") 87.AddAdditionalDocument(DocumentId.CreateNewId(projectId2), "add.txt", SourceText.From("text", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "add.txt") 88.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId2), "editorcfg", SourceText.From("config", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "/a/b"))); 129Assert.Throws<ArgumentNullException>(() => solution.RemoveDocuments(ImmutableArray.Create((DocumentId)null!))); 148Assert.Throws<ArgumentNullException>(() => solution.RemoveAdditionalDocuments(ImmutableArray.Create((DocumentId)null!))); 167Assert.Throws<ArgumentNullException>(() => solution.RemoveAnalyzerConfigDocuments(ImmutableArray.Create((DocumentId)null!))); 175var documentId = solution.Projects.Single().DocumentIds.Single(); 195var documentId = solution.Projects.Single().DocumentIds.Single(); 226var documentId = solution.Projects.Single().DocumentIds.Single(); 253var documentId = solution.Projects.Single().DocumentIds.Single(); 272var documentId = solution.Projects.Single().DocumentIds.Single(); 291var documentId = solution.Projects.Single().DocumentIds.Single(); 302var documentId = solution.Projects.Single().DocumentIds.Single(); 333.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", "public class Goo { }") 334.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From("config")); 348var documentId = solution.Projects.Single().DocumentIds.Single(); 364Assert.Throws<ArgumentNullException>(() => solution.WithDocumentText((DocumentId)null!, text, PreservationMode.PreserveIdentity)); 373var documentId = solution.Projects.Single().DocumentIds.Single(); 388Assert.Throws<ArgumentNullException>(() => solution.WithDocumentText((DocumentId)null!, textAndVersion, PreservationMode.PreserveIdentity)); 397var documentId = solution.Projects.Single().DocumentIds.Single(); 411Assert.Throws<ArgumentNullException>(() => solution.WithDocumentText((DocumentId[])null!, text, PreservationMode.PreserveIdentity)); 431var documentId1 = solution.Projects.First().DocumentIds.Single(); 432var documentId2 = solution.Projects.Last().DocumentIds.Single(); 496private static Solution UpdateSolution(PreservationMode mode, TextUpdateType updateType, Solution solution, DocumentId documentId1, SourceText text, TextAndVersion textAndVersion) 519var documentId1 = solution.Projects.First().DocumentIds.Single(); 520var documentId2 = solution.Projects.Last().DocumentIds.Single(); 598var documentId1 = solution.Projects.First().DocumentIds.Single(); 599var documentId2 = solution.Projects.Last().DocumentIds.Single(); 684var documentId1 = solution.Projects.First().DocumentIds.Single(); 685var documentId2 = solution.Projects.Last().DocumentIds.Single(); 761var documentId1 = solution.Projects.First().DocumentIds.Single(); 762var documentId2 = solution.Projects.Last().DocumentIds.Single(); 843.AddDocument(DocumentId.CreateNewId(projectId1), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs") 845.AddDocument(DocumentId.CreateNewId(projectId2), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs"))); 849var documentId1 = solution.Projects.First().DocumentIds.Single(); 850var documentId2 = solution.Projects.Last().DocumentIds.Single(); 919var documentId = solution.Projects.Single().AdditionalDocumentIds.Single(); 932Assert.Throws<ArgumentNullException>(() => solution.WithAdditionalDocumentText((DocumentId)null!, text, PreservationMode.PreserveIdentity)); 941var documentId = solution.Projects.Single().AdditionalDocumentIds.Single(); 956Assert.Throws<ArgumentNullException>(() => solution.WithAdditionalDocumentText((DocumentId)null!, textAndVersion, PreservationMode.PreserveIdentity)); 978Assert.Throws<ArgumentNullException>(() => solution.WithAnalyzerConfigDocumentText((DocumentId)null!, text, PreservationMode.PreserveIdentity)); 1002Assert.Throws<ArgumentNullException>(() => solution.WithAnalyzerConfigDocumentText((DocumentId)null!, textAndVersion, PreservationMode.PreserveIdentity)); 1011var documentId = solution.Projects.Single().DocumentIds.Single(); 1033var documentId = solution.Projects.Single().AdditionalDocumentIds.Single(); 1080var d1 = DocumentId.CreateNewId(projectId); 1081var d2 = DocumentId.CreateNewId(projectId); 1082var d3 = DocumentId.CreateNewId(projectId); 1083var a1 = DocumentId.CreateNewId(projectId); 1084var a2 = DocumentId.CreateNewId(projectId); 1085var a3 = DocumentId.CreateNewId(projectId); 1086var c1 = DocumentId.CreateNewId(projectId); 1087var c2 = DocumentId.CreateNewId(projectId); 1088var c3 = DocumentId.CreateNewId(projectId); 1599var documentAId = DocumentId.CreateNewId(projectId); 1600var documentBId = DocumentId.CreateNewId(projectId); 1601var documentCId = DocumentId.CreateNewId(projectId); 1602var fileDocumentId = DocumentId.CreateNewId(projectId); 1784var documentId = DocumentId.CreateNewId(projectId); 1818var documentId = DocumentId.CreateNewId(projectId); 1856var documentId = DocumentId.CreateNewId(projectId); 1875var documentId = DocumentId.CreateNewId(projectId); 1894var documentId = DocumentId.CreateNewId(projectId); 2310var editorConfigId = DocumentId.CreateNewId(solution3.Projects.Single().Id); 2366var documentId = DocumentId.CreateNewId(projectId); 2378Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", loader)); 2391var documentId = DocumentId.CreateNewId(projectId); 2409Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", "text")); 2421var documentId = DocumentId.CreateNewId(projectId); 2437Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", sourceText)); 2450var documentId = DocumentId.CreateNewId(projectId); 2466Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", syntaxRoot: root)); 2479var documentId = DocumentId.CreateNewId(projectId); 2510var documentId = DocumentId.CreateNewId(projectId); 2566var did = DocumentId.CreateNewId(pid); 2591var did2 = DocumentId.CreateNewId(pid2); 2611var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file1.cs"); 2612var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file2.cs"); 2635var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs"); 2636var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "file2.cs"); 2662var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs"); 2663var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "file2.cs"); 2687var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file1.cs"); 2688var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file2.cs"); 2708var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs"); 2709var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "file2.cs"); 2730var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs"); 2749var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.txt"); 2768var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), ".editorconfig"); 2802var doc1 = DocumentId.CreateNewId(pm1); 2803var doc2 = DocumentId.CreateNewId(pm2); 2828.AddDocument(DocumentId.CreateNewId(pm1), "goo.cs", "public class X { }") 2829.AddDocument(DocumentId.CreateNewId(pm2), "bar.vb", "Public Class Y\r\nInherits X\r\nEnd Class"); 3135var did = DocumentId.CreateNewId(pid); 3157var documentId = DocumentId.CreateNewId(projectId); 3179var did = DocumentId.CreateNewId(pid); 3217var did = DocumentId.CreateNewId(pid); 3258var documentId = DocumentId.CreateNewId(projectId); 3298var did = DocumentId.CreateNewId(pid); 3322var did = DocumentId.CreateNewId(pid); 3342var did = DocumentId.CreateNewId(pid); 3365var did = DocumentId.CreateNewId(pid); 3389var did = DocumentId.CreateNewId(pid); 3409var did = DocumentId.CreateNewId(pid); 3430var did = DocumentId.CreateNewId(pid); 3452var did = DocumentId.CreateNewId(pid); 3472var did = DocumentId.CreateNewId(pid); 3492var did = DocumentId.CreateNewId(pid); 3511var did = DocumentId.CreateNewId(pid); 3525private static ObjectReference<SourceText> GetObservedText(Solution solution, DocumentId documentId, string expectedText = null) 3542var did = DocumentId.CreateNewId(pid); 3556private static ObjectReference<SourceText> GetObservedTextAsync(Solution solution, DocumentId documentId, string expectedText = null) 3573var did = DocumentId.CreateNewId(pid); 3588private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRoot(Solution solution, DocumentId documentId) 3599var did = DocumentId.CreateNewId(pid); 3614private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRootAsync(Solution solution, DocumentId documentId) 3626var did = DocumentId.CreateNewId(pid); 3650var did = DocumentId.CreateNewId(pid); 3675private static void TestRecoverableSyntaxTree(Solution sol, DocumentId did) 3715var did = DocumentId.CreateNewId(pid); 3740var did = DocumentId.CreateNewId(pid); 3769var did = DocumentId.CreateNewId(pid); 3908var did = DocumentId.CreateNewId(pid); 3935var did1 = DocumentId.CreateNewId(pid1); 3936var did2 = DocumentId.CreateNewId(pid2); 3937var did3 = DocumentId.CreateNewId(pid3); 4353var documentId1 = DocumentId.CreateNewId(solution.ProjectIds.Single()); 4354var documentId2 = DocumentId.CreateNewId(solution.ProjectIds.Single()); 4355var documentId3 = DocumentId.CreateNewId(solution.ProjectIds.Single()); 4372var documentIdToFreeze = documentToFreeze == 1 ? documentId1 : documentToFreeze == 2 ? documentId2 : documentId3; 4567ImmutableArray<DocumentId> GetDocumentIds() => [.. solution.GetProject(pid).DocumentIds]; 4576var did1 = DocumentId.CreateNewId(pid); 4580var did2 = DocumentId.CreateNewId(pid); 4584var did3 = DocumentId.CreateNewId(pid); 4588var did4 = DocumentId.CreateNewId(pid); 4592var did5 = DocumentId.CreateNewId(pid); 4640var did1 = DocumentId.CreateNewId(pid); 4644var did2 = DocumentId.CreateNewId(pid); 4648var did3 = DocumentId.CreateNewId(pid); 4652var did4 = DocumentId.CreateNewId(pid); 4656var did5 = DocumentId.CreateNewId(pid); 4661Assert.Throws<ArgumentException>(() => solution = solution.WithProjectDocumentsOrder(pid, ImmutableList.Create<DocumentId>())); 4674var sourceDocumentId = DocumentId.CreateNewId(projectId); 4682var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4710var sourceDocumentId = DocumentId.CreateNewId(projectId); 4715var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4751var sourceDocumentId = DocumentId.CreateNewId(projectId); 4756var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4796var sourceDocumentId = DocumentId.CreateNewId(projectId); 4804var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4827var sourceDocumentId = DocumentId.CreateNewId(projectId); 4850var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4878var documentId = DocumentId.CreateNewId(projectId); 4898var documentId = DocumentId.CreateNewId(projectId); 4900var solution = workspace.CurrentSolution 4919var documentId = DocumentId.CreateNewId(projectId); 4937var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 5423var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version))); 5462var documentId = solution.Projects.Single().DocumentIds.Single(); 5513var documentId = DocumentId.CreateNewId(projectId); 5518.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), ".editorconfig", SourceText.From($"[{pattern}]\nindent_style = tab"), filePath: configPath); 5551var regularDocumentId = solution.Projects.Single().DocumentIds.Single(); 5807var documentId1 = project1.DocumentIds.Single(); 5817var documentId2 = project2.DocumentIds.Single();
SolutionTests\SolutionWithSourceGeneratorTests.cs (5)
259var documentId = project.DocumentIds.Single(); 267static async Task AssertCompilationContainsOneRegularAndOneGeneratedFile(Project project, DocumentId documentId, string expectedGeneratedContents) 301var additionalDocumentId = project.AdditionalDocumentIds.Single(); 821foreach (var documentIdToTest in documentIdsToTest) 849DocumentId.CreateNewId(project.Id),
SolutionTests\TextLoaderTests.cs (11)
22public new virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 29public new virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 33public virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId) 37public virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, ref DocumentId? documentId, CancellationToken cancellationToken) 41public virtual Task<TextAndVersion> LoadTextAndVersionAsync<T>(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 47public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 53public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId) 59public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, ref DocumentId? documentId, CancellationToken cancellationToken) 65public override Task<TextAndVersion> LoadTextAndVersionAsync<T>(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 85public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 94public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
SyntaxNodeTests.cs (2)
83var did = DocumentId.CreateNewId(pid);
SyntaxReferenceTests.cs (4)
28var did = DocumentId.CreateNewId(pid); 38var did = DocumentId.CreateNewId(pid);
WorkspaceTests\AdhocWorkspaceTests.cs (8)
59var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 153DocumentId.CreateNewId(pid), 215var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version))); 249var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version))); 285DocumentId.CreateNewId(pid), 322var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version))); 378var docid1 = ws.AddDocument(projid, "A.cs", SourceText.From("public class A { }")).Id; 379var docid2 = ws.AddDocument(projid, "B.cs", SourceText.From("public class B { }")).Id;
WorkspaceTests\WorkspaceReferenceTests.cs (5)
36var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 76var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 116var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 156var referenceDocumentInfo = DocumentInfo.Create(DocumentId.CreateNewId(referenceProject.Id), "code.cs"); 160var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs");
WorkspaceTests\WorkspaceTests.cs (2)
164var id = DocumentId.CreateNewId(projectId);
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
536foreach (var documentId in project.DocumentIds)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
536foreach (var documentId in project.DocumentIds)
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
536foreach (var documentId in project.DocumentIds)
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
536foreach (var documentId in project.DocumentIds)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
536foreach (var documentId in project.DocumentIds)
Microsoft.Interop.ComInterfaceGenerator (2)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 198DocumentId documentId = solutionEditor.OriginalSolution.GetDocumentId(diagnostic.Location.SourceTree)!;
Microsoft.Interop.LibraryImportGenerator (2)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 198DocumentId documentId = solutionEditor.OriginalSolution.GetDocumentId(diagnostic.Location.SourceTree)!;
Microsoft.VisualStudio.LanguageServices (153)
CallHierarchy\CallHierarchyDetail.cs (1)
21private readonly DocumentId _documentId;
CallHierarchy\Finders\AbstractCallFinder.cs (1)
121var activeDocument = documentTrackingService.TryGetActiveDocument();
CodeCleanup\AbstractCodeCleanUpFixer.cs (2)
128var documentId = documentIds.FirstOrDefault(id => id.ProjectId == projectId); 215var changedRoots = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
CodeLens\CodeLensCallbackListener.cs (5)
141private async Task<(DocumentId?, SyntaxNode?)> GetDocumentIdAndNodeAsync( 213foreach (var candidateId in solution.GetDocumentIdsWithFilePath(filePath)) 217var currentContextId = _workspace.GetDocumentIdInCurrentContext(candidateId); 228var documentId = DocumentId.CreateFromSerialized(projectId, documentIdGuid);
CodeLens\RemoteCodeLensReferencesService.cs (7)
42public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, 67public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 88public async Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 113public async Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 144var referencedDocumentId = DocumentId.CreateFromSerialized( 253private static async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsWorkerAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
DebuggerIntelliSense\AbstractDebuggerIntelliSenseContext.cs (2)
173foreach (var link in document.GetLinkedDocumentIds()) 182foreach (var link in document.GetLinkedDocumentIds())
DebuggerIntelliSense\DebuggerIntellisenseWorkspace.cs (1)
20public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer)
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
149using var _ = PooledHashSet<DocumentId>.GetInstance(out var seenDocumentIds);
Diagnostics\VisualStudioVenusSpanMappingService.cs (5)
30DocumentId documentId, Location location, 70private TextLineCollection GetTextLines(DocumentId currentDocumentId, Location location) 101DocumentId documentId, FileLinePositionSpan originalLineInfo, FileLinePositionSpan mappedLineInfo, out LinePositionSpan originalSpan, out LinePositionSpan mappedSpan) 135public static LinePosition GetAdjustedLineColumn(DocumentId documentId, int originalLine, int originalColumn, int mappedLine, int mappedColumn) 145private static bool TryAdjustSpanIfNeededForVenus(DocumentId documentId, int originalLine, int originalColumn, out MappedSpan mappedSpan)
Extensions\VisualStudioWorkspaceImplExtensions.cs (1)
67public static bool TryGetImageListAndIndex(this VisualStudioWorkspaceImpl workspace, IVsImageService2 imageService, DocumentId id, out IntPtr imageList, out ushort index)
Extensions\VsTextSpanExtensions.cs (1)
21DocumentId documentId,
ExternalAccess\VSTypeScript\Api\VSTypeScriptContainedDocumentWrapper.cs (1)
23public static bool TryGetContainedDocument(DocumentId documentId, out VSTypeScriptContainedDocumentWrapper document)
ExternalAccess\VSTypeScript\Api\VSTypeScriptVisualStudioProjectWrapper.cs (1)
27public DocumentId AddSourceTextContainer(SourceTextContainer sourceTextContainer, string fullPath, bool isLspContainedDocument = false)
Implementation\AbstractEditorFactory.cs (2)
327var documentId = DocumentId.CreateNewId(projectToAddTo.Id);
Implementation\ContainedLanguageRefactorNotifyService.cs (3)
35public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 38public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 42foreach (var documentId in changedDocumentIDs)
Implementation\VisualStudioSupportsFeatureService.cs (7)
58var documentId = workspace.GetDocumentIdInCurrentContext(sourceTextContainer); 68private static DocumentId GetContainedDocumentId(ITextBuffer textBuffer) 106private static bool SupportsCodeFixesWorker(DocumentId id) 109private static bool SupportsRefactoringsWorker(DocumentId id) 112private static bool SupportsRenameWorker(ImmutableArray<DocumentId> ids) 118private static bool SupportsSemanticSnippetsWorker(DocumentId id) 124private static bool SupportsNavigationToAnyPositionWorker(DocumentId id)
Implementation\VsRefactorNotifyService.cs (6)
36public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 73public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 111IEnumerable<DocumentId> changedDocumentIDs, 130IEnumerable<DocumentId> changedDocumentIDs, 176private Dictionary<IVsHierarchy, List<uint>> GetHierarchiesAndItemIDsFromDocumentIDs(VisualStudioWorkspace visualStudioWorkspace, IEnumerable<DocumentId> changedDocumentIDs) 182foreach (var documentId in changedDocumentIDs)
Library\ObjectBrowser\Extensions.cs (1)
107foreach (var documentId in project.DocumentIds)
Packaging\PackageInstallerServiceFactory.cs (1)
259DocumentId documentId,
Preview\FileChange.cs (2)
32public readonly DocumentId Id; 100private ChangeList GetChangeList(IHierarchicalDifferenceCollection diff, DocumentId id, SourceText oldText, SourceText newText)
Preview\PreviewEngine.cs (4)
118var allDocumentsWithChanges = new List<DocumentId>(); 157private void AppendFileChanges(IEnumerable<DocumentId> changedDocuments, ArrayBuilder<AbstractChange> builder) 160var linkedDocumentIds = new HashSet<DocumentId>(); 211public void UpdatePreview(DocumentId documentId, SpanChange spanSource)
Preview\PreviewUpdater.cs (1)
21private DocumentId? _currentDocumentId;
Preview\SpanChange.cs (2)
16private readonly DocumentId _id; 24public SpanChange(ITrackingSpan span, ITextBuffer buffer, DocumentId id, string text, string leftText, string rightText, bool isDeletion, AbstractChange parent, PreviewEngine engine)
Preview\TopLevelChange.cs (4)
87foreach (var linkedDocumentId in oldDocument.GetLinkedDocumentIds()) 92var newLinkedDocumentIdOpt = updatedDocumentTextOpt != null ? oldLinkedDocument.Id : null; 100foreach (var newLinkedDocumentId in updatedDocument.GetLinkedDocumentIds()) 113DocumentId updatedDocumentIdOpt,
Progression\GraphBuilder.cs (3)
86foreach (var docIdWithPath in docIdsWithPath) 139var documentId = (DocumentId)inputNode[RoslynGraphProperties.ContextDocumentId];
Progression\RoslynGraphProperties.cs (1)
115dataType: typeof(DocumentId),
ProjectSystem\MiscellaneousFilesWorkspace.cs (2)
269if (_fileTrackingMetadataAsSourceService.TryAddDocumentToWorkspace(moniker, textBuffer.AsTextContainer(), out var _)) 321protected override void ApplyDocumentTextChanged(DocumentId documentId, SourceText newText)
ProjectSystem\VisualStudioWorkspace.cs (3)
47public virtual string? GetFilePath(DocumentId documentId) 54internal abstract IInvisibleEditor OpenInvisibleEditor(DocumentId documentId); 59public abstract EnvDTE.FileCodeModel GetFileCodeModel(DocumentId documentId);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (3)
16protected readonly DocumentId DocumentId; 20DocumentId documentId) 26protected abstract IReadOnlyList<DocumentId> GetDocumentIds(Project fromProject);
ProjectSystem\VisualStudioWorkspaceImpl.cs (26)
289public override EnvDTE.FileCodeModel GetFileCodeModel(DocumentId documentId) 334bool CanApplyChange(DocumentId documentId) 660foreach (var changedDocumentId in projectChanges.GetChangedDocuments()) 873DocumentId documentId, 891DocumentId documentId, 974DocumentId documentId, 1001private void RemoveDocumentCore(DocumentId documentId, TextDocumentKind documentKind) 1050protected override void ApplyDocumentRemoved(DocumentId documentId) 1053protected override void ApplyAdditionalDocumentRemoved(DocumentId documentId) 1056protected override void ApplyAnalyzerConfigDocumentRemoved(DocumentId documentId) 1059public override void OpenDocument(DocumentId documentId, bool activate = true) 1062public override void OpenAdditionalDocument(DocumentId documentId, bool activate = true) 1065public override void OpenAnalyzerConfigDocument(DocumentId documentId, bool activate = true) 1068public override void CloseDocument(DocumentId documentId) 1071public override void CloseAdditionalDocument(DocumentId documentId) 1074public override void CloseAnalyzerConfigDocument(DocumentId documentId) 1077public void OpenDocumentCore(DocumentId documentId, bool activate = true) 1162public void CloseDocumentCore(DocumentId documentId) 1184protected override void ApplyDocumentTextChanged(DocumentId documentId, SourceText newText) 1187protected override void ApplyAdditionalDocumentTextChanged(DocumentId documentId, SourceText newText) 1190protected override void ApplyAnalyzerConfigDocumentTextChanged(DocumentId documentId, SourceText newText) 1193private void ApplyTextDocumentChange(DocumentId documentId, SourceText newText) 1220protected override void ApplyDocumentInfoChanged(DocumentId documentId, DocumentInfo updatedInfo) 1313private string GetPreferredExtension(DocumentId documentId) 1346internal override void SetDocumentContext(DocumentId documentId) 1440public virtual void EnsureEditableDocuments(IEnumerable<DocumentId> documents)
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (1)
323foreach (var documentId in documentIds)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveAdditionalDocumentUndoUnit.cs (2)
16DocumentId documentId) 21protected override IReadOnlyList<DocumentId> GetDocumentIds(Project fromProject)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveAnalyzerConfigDocumentUndoUnit.cs (2)
16DocumentId documentId) 21protected override IReadOnlyList<DocumentId> GetDocumentIds(Project fromProject)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveDocumentUndoUnit.cs (2)
16DocumentId documentId) 21protected override IReadOnlyList<DocumentId> GetDocumentIds(Project fromProject)
ProjectSystem\VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs (1)
32var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(_filePath).FirstOrDefault();
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
468var builder = ImmutableDictionary.CreateBuilder<DocumentId, List<DiagnosticData>>(); 488var latestDocumentDiagnosticsMap = filterStaleDiagnostics ? new Dictionary<DocumentId, ImmutableHashSet<DiagnosticData>>() : null;
TaskList\ProjectExternalErrorReporter.cs (4)
131private DocumentId TryGetDocumentId(string filePath) 140var documentId = TryGetDocumentId(error.bstrFileName); 223DocumentId documentId; 263DocumentId documentId,
Utilities\IVsEditorAdaptersFactoryServiceExtensions.cs (1)
23DocumentId contextDocumentId,
ValueTracking\TreeItemViewModel.cs (2)
29protected DocumentId DocumentId { get; } 47DocumentId documentId,
Venus\ContainedDocument.cs (5)
68private static readonly ConcurrentDictionary<DocumentId, ContainedDocument> s_containedDocuments = []; 70public static ContainedDocument TryGetContainedDocument(DocumentId id) 94public DocumentId Id { get; } 101DocumentId documentId, 172public DocumentId FindProjectDocumentIdWithItemId(uint itemidInsertionPoint)
Venus\ContainedLanguage.cs (2)
99DocumentId documentId; 113documentId = DocumentId.CreateNewId(projectId, $"{nameof(ContainedDocument)}: {filePath}");
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (1)
50var targetDocumentId = this.ContainedDocument.FindProjectDocumentIdWithItemId(itemidInsertionPoint);
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
59public void AddDocument(DocumentId id)
Workspace\VisualStudioActiveDocumentTracker.cs (7)
85/// Returns the <see cref="DocumentId"/> of the active document in a given <see cref="Workspace"/>. 87public DocumentId? TryGetActiveDocument(Workspace workspace) 115/// Get a read-only collection of the <see cref="DocumentId"/>s of all the visible documents in the given <see cref="Workspace"/>. 117public ImmutableArray<DocumentId> GetVisibleDocuments(Workspace workspace) 123var ids = ArrayBuilder<DocumentId>.GetInstance(visibleFramesSnapshot.Count); 127var documentId = frame.GetDocumentId(workspace); 236public DocumentId? GetDocumentId(Workspace workspace)
Workspace\VisualStudioDocumentNavigationService.cs (11)
52public async Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken) 69Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken) 101Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken) 115Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken) 158DocumentId documentId, 182DocumentId documentId, 230var documentIdToNavigate = documentIdsForFilePath.Contains(documentId) ? documentId : documentIdsForFilePath.First(); 246DocumentId documentId, 289IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, CancellationToken cancellationToken) 412private static bool IsSecondaryBuffer(DocumentId documentId) 416DocumentId documentId, VsTextSpan spanInSecondaryBuffer, CancellationToken cancellationToken)
Workspace\VisualStudioDocumentTrackingServiceFactory.cs (4)
28private EventHandler<DocumentId?>? _activeDocumentChangedEventHandler; 30public event EventHandler<DocumentId?> ActiveDocumentChanged 66public DocumentId? TryGetActiveDocument() 69public ImmutableArray<DocumentId> GetVisibleDocuments()
Workspace\VisualStudioFormattingRuleFactoryServiceFactory.cs (4)
29public bool ShouldUseBaseIndentation(DocumentId documentId) 32public bool ShouldNotFormatOrCommitOnPaste(DocumentId documentId) 35private static bool IsContainedDocument(DocumentId documentId) 92public IEnumerable<TextChange> FilterFormattedChanges(DocumentId documentId, TextSpan span, IList<TextChange> changes)
Workspace\VisualStudioTextUndoHistoryWorkspaceServiceFactory.cs (1)
49var documentId = editorWorkspace.GetDocumentIdInCurrentContext(textBuffer.AsTextContainer());
Microsoft.VisualStudio.LanguageServices.CSharp (2)
SemanticSearch\SemanticSearchDocumentNavigationService.cs (2)
25public override Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken) 28public override Task<INavigableLocation?> GetLocationForSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (15)
CodeModel\FileCodeModelTestHelpers.cs (1)
36var document = project.Documents.Single().Id;
CodeModel\MockInvisibleEditor.cs (2)
14private readonly DocumentId _documentId; 17public MockInvisibleEditor(DocumentId document, EditorTestWorkspace workspace)
DesignerAttribute\DesignerAttributeServiceTests.cs (1)
120var documentId = hostDocument.Id;
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (3)
30.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", "public class Goo { }") 31.AddAdditionalDocument(DocumentId.CreateNewId(projectId), "add.txt", "text") 32.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From("config"), filePath: "/a/b")));
EditorConfigSettings\DataProvider\DataProviderTests.cs (3)
31.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", "public class Goo { }") 32.AddAdditionalDocument(DocumentId.CreateNewId(projectId), "add.txt", "text") 34.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From("config"), filePath: "/a/b")));
PersistentStorage\AbstractPersistentStorageTests.cs (5)
874var id = DocumentId.CreateNewId(solution.Projects.Single().Id); 894var id = DocumentId.CreateNewId(solution.Projects.Single().Id); 993solution = solution.AddDocument(DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "Document1",
Microsoft.VisualStudio.LanguageServices.LiveShare (10)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (1)
94DocumentId.CreateNewId(projectId),
Client\RemoteLanguageServiceWorkspace.cs (9)
58private ImmutableDictionary<string, DocumentId> _openedDocs = ImmutableDictionary<string, DocumentId>.Empty; 241var docId = CurrentSolution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(); 279var docId = CurrentSolution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(); 335DocumentId.CreateNewId(project.Id), 367if (_openedDocs.TryGetValue(moniker, out var id)) 379public override void OpenDocument(DocumentId documentId, bool activate = true) 445public void AddOpenedDocument(string filePath, DocumentId docId) 474protected override void ApplyDocumentTextChanged(DocumentId documentId, SourceText text)
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (8)
CodeModel\Mocks\MockVisualStudioWorkspace.vb (7)
49Protected Overrides Sub ApplyDocumentTextChanged(documentId As DocumentId, newText As SourceText) 54Public Overrides Sub CloseDocument(documentId As DocumentId) 59Protected Overrides Sub ApplyDocumentRemoved(documentId As DocumentId) 64Friend Overrides Function OpenInvisibleEditor(documentId As DocumentId) As IInvisibleEditor 88Public Overrides Sub EnsureEditableDocuments(documents As IEnumerable(Of DocumentId)) 96Private ReadOnly _documentId As DocumentId 100Public Sub New(documentId As DocumentId, workspace As EditorTestWorkspace)
ProjectSystemShim\Framework\TestEnvironment.vb (1)
122Friend Overrides Function OpenInvisibleEditor(documentId As DocumentId) As IInvisibleEditor
Microsoft.VisualStudio.LanguageServices.UnitTests (9)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (4)
323Public Function GetCachedDiagnosticsAsync(workspace As Workspace, projectId As ProjectId, documentId As DocumentId, includeSuppressedDiagnostics As Boolean, includeLocalDocumentDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetCachedDiagnosticsAsync 327Public Function GetDiagnosticsForIdsAsync(solution As Solution, projectId As ProjectId, documentId As DocumentId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), getDocuments As Func(Of Project, DocumentId, IReadOnlyList(Of DocumentId)), includeSuppressedDiagnostics As Boolean, includeLocalDocumentDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetDiagnosticsForIdsAsync
Preview\PreviewChangesTests.vb (3)
102Dim addedDocumentId = DocumentId.CreateNewId(docId.ProjectId) 201Dim addedDocumentId1 = DocumentId.CreateNewId(docId.ProjectId) 202Dim addedDocumentId2 = DocumentId.CreateNewId(docId.ProjectId)
SolutionExplorer\SourceGeneratorItemTests.vb (2)
203DocumentId.CreateNewId(projectId), 218DocumentId.CreateNewId(projectId),
Microsoft.VisualStudio.LanguageServices.Xaml (16)
Features\InlineRename\XamlEditorInlineRenameService.cs (4)
109public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 114public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 192public IEnumerable<DocumentId> DocumentIds => _inlineRenameLocationSet.Locations.Select(l => l.Document.Id).Distinct(); 196public IEnumerable<InlineRenameReplacement> GetReplacements(DocumentId documentId)
Implementation\LanguageServer\Handler\Completion\CompletionHandler.cs (1)
82private static CompletionItem CreateCompletionItem(XamlCompletionItem xamlCompletion, DocumentId documentId, SourceText text, Position position, TextDocumentIdentifier textDocument, Dictionary<XamlCompletionKind, ImmutableArray<VSInternalCommitCharacter>> commitCharactersCach)
Implementation\LanguageServer\Handler\Completion\CompletionResolveHandler.cs (2)
65var documentId = DocumentId.CreateFromSerialized(ProjectId.CreateFromSerialized(data.ProjectGuid), data.DocumentGuid);
Implementation\XamlProjectService.cs (8)
38private readonly ConcurrentDictionary<string, DocumentId> _documentIds = new ConcurrentDictionary<string, DocumentId>(StringComparer.OrdinalIgnoreCase); 66public DocumentId? TrackOpenDocument(string filePath) 74if (_documentIds.TryGetValue(filePath, out var documentId)) 87DocumentId? GetDocumentId(string path) 105private DocumentId? EnsureDocument(string filePath) 183if (_documentIds.TryGetValue(filePath, out var docId)) 199if (_documentIds.TryGetValue(filePath, out var documentId))
Telemetry\IXamlLanguageServerFeedbackService.cs (1)
17IRequestScope CreateRequestScope(DocumentId? documentId, string methodName);
Mvc.Api.Analyzers.Test (2)
AddResponseTypeAttributeCodeFixProviderIntegrationTest.cs (1)
65var controllerDocument = project.DocumentIds[0];
ApiActionsDoNotRequireExplicitModelValidationCheckCodeFixProviderTest.cs (1)
32var controllerDocument = project.DocumentIds[0];
Roslyn.VisualStudio.Next.UnitTests (38)
Remote\SnapshotSerializationTests.cs (4)
65DocumentId.CreateNewId(project1.Id), 153var document = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp).AddDocument("Document", SourceText.From(code)); 173var document = solution.AddProject("Project", "Project.dll", LanguageNames.CSharp).AddDocument("Document", SourceText.From(code)); 532var document = CreateWorkspace().CurrentSolution.AddProject("empty", "empty", LanguageNames.CSharp).AddDocument("empty", SourceText.From(""));
Services\ServiceHubServicesTests.cs (27)
146var priorityDocumentId = solution.Projects.Single().Documents.Single().Id; 422DocumentId tempDocId; 436var tempDoc = project.AddDocument("X.cs", SourceText.From("// ")); 764private static DocumentId AddSimpleDocument(TestWorkspace workspace, CallbackGenerator generator) 775var tempDoc = project.AddDocument("X.cs", SourceText.From("// ")); 913var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 922var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 964var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 973var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1005var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1014var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1048var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1057var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1100var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1110var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1153var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1163var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1206var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1216var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1251var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1261var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1296var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1305var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1339var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1348var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1545var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1599var currentDocumentId = documentIdsInProject[j];
Services\SolutionServiceTests.cs (7)
313var existingDocumentId = project.DocumentIds.First(); 332var additionalDocumentId = DocumentId.CreateNewId(projectId); 363var analyzerConfigDocumentId = DocumentId.CreateNewId(projectId); 396var documentId = DocumentId.CreateNewId(projectId);