1 instantiation of DocumentId
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\DocumentId.cs (1)
57return new DocumentId(projectId, id, isSourceGenerated, debugName);
2283 references to DocumentId
Analyzer.Utilities.UnitTests (4)
FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisTests.cs (2)
1334DocumentId documentId = DocumentId.CreateNewId(projectId, debugName: newFileName);
Options\SymbolNamesWithValueOptionTests.cs (2)
435DocumentId documentId = DocumentId.CreateNewId(projectId, debugName: newFileName);
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.Analyzers (1)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (1)
91var updatedUnshippedText = new List<(DocumentId, SourceText)>();
Microsoft.CodeAnalysis.CodeStyle.Fixes (11)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
216foreach (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) 96public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 99public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 102public 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)
24internal 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>())) 97installerServiceMock.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>())) 132installerServiceMock.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>())) 167installerServiceMock.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>())) 278installerServiceMock.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>())) 316installerServiceMock.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>())) 353installerServiceMock.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)
916var 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)
69var oldDocumentId = oldDocument.Id; 158var refDocumentId = refDocument?.Id;
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
180var documentId = workspace.GetDocumentId(hostDocument);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (3)
3007var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument").Id; 3490var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument2").Id; 3549var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument").Id;
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
166var 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)
57DocumentId.CreateNewId(project.Id),
MoveToNamespace\MoveToNamespaceTests.cs (1)
1456foreach (var id in workspace.Documents.Select(d => d.Id))
PdbSourceDocument\NullResultMetadataAsSourceFileProvider.cs (1)
50public 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)
51var documentId = testDocument.Id; 132var documentId = sourceDocument.Id; 301var documentId = sourceDocument.Id;
Rename\CSharpInlineRenameServiceTests.cs (1)
61var documentId = workspace.Documents.Single().Id;
Workspaces\WorkspaceTests_EditorFeatures.cs (8)
772var newSolution = oldSolution.AddDocument(DocumentId.CreateNewId(project1.Id), "Doc2", SourceText.From(doc2Text)); 895var sourceGeneratedDocumentId = workspace.GetDocumentIdInCurrentContext(document.GetOpenTextContainer()); 1246var newDocId = DocumentId.CreateNewId(project.Id); 1282var newDocId = DocumentId.CreateNewId(project.Id); 1429var originalDocumentId = workspace.GetOpenDocumentIds().Single(id => !workspace.GetTestDocument(id).IsLinkFile); 1430var 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)
307var documentId = oldDocument.Id; 372var documentId = oldDocument.Id; 433var documentId = oldDocument.Id; 469var documentId = oldDocument.Id; 515var documentId = oldDocument.Id; 547var documentId = oldDocument.Id; 584var documentId = oldDocument.Id; 623var documentId = oldDocument.Id; 665var newDocId = DocumentId.CreateNewId(oldProject.Id); 678foreach (var changedDocumentId in changedDocuments) 711var newDocId = DocumentId.CreateNewId(oldProject.Id); 724foreach (var changedDocumentId in changedDocuments) 744var documentId = DocumentId.CreateNewId(oldProject.Id); 801var documentId = oldProject.Documents.Single().Id;
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Rename\CSharpRenameRewriterLanguageService.cs (1)
47private readonly DocumentId _documentId;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SymbolEditorTests.cs (1)
38DocumentId.CreateNewId(pid),
Microsoft.CodeAnalysis.EditorFeatures (95)
Classification\Syntactic\SyntacticClassificationTaggerProvider.ClassifiedLineCache.cs (3)
56private DocumentId? _documentId; 87DocumentId documentId, 111DocumentId 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)
55protected async Task NavigateToPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, CancellationToken cancellationToken) 70internal virtual Task<(DocumentId documentId, int position, int virtualSpace)> GetNavigationLocationAsync(
Extensibility\NavigationBar\NavigationBarProjectItem.cs (2)
13DocumentId documentId, 20public 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)
26public abstract IEnumerable<DocumentId> DocumentIds { get; } 31public abstract IEnumerable<VSTypeScriptInlineRenameReplacementWrapper> GetReplacements(DocumentId documentId); 33IEnumerable<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)
51bool IInlineRenameInfo.TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 54bool 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)
141public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 147public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText)
InlineRename\IEditorInlineRenameService.cs (4)
117IEnumerable<DocumentId> DocumentIds { get; } 122IEnumerable<InlineRenameReplacement> GetReplacements(DocumentId documentId); 231bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText); 237bool 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)
225var newSubmissionDocumentId = DocumentId.CreateNewId(_currentSubmissionProjectId, newSubmissionProjectName); 249DocumentId.CreateNewId(initializationScriptProjectId, debugName: initializationScriptPath),
Interactive\InteractiveWorkspace.cs (3)
14private DocumentId? _openDocumentId; 27public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer) 34protected override void ApplyDocumentTextChanged(DocumentId document, SourceText newText)
IRefactorNotifyService.cs (2)
23bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure); 33bool 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 sealed 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 (3)
154var documentId = e.DocumentId!; 164private void OnActiveDocumentChanged(object? sender, DocumentId? e) 190var activeDocument = _documentTrackingService.TryGetActiveDocument();
RenameTracking\RenameTrackingTaggerProvider.cs (3)
59internal static void ResetRenameTrackingState(Workspace workspace, DocumentId documentId) 62internal static bool ResetVisibleRenameTrackingState(Workspace workspace, DocumentId documentId) 65internal 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)
39internal static void ApplyTextChanges(this Workspace workspace, DocumentId id, IEnumerable<TextChange> textChanges, CancellationToken cancellationToken) 46private 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)
17void AddDocument(DocumentId id);
Undo\NoOpGlobalUndoServiceFactory.cs (1)
62public void AddDocument(DocumentId id)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (35)
Completion\AbstractCompletionProviderTests.cs (4)
964var documentId = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").Id; 1020var documentId = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").Id; 1050var currentContextDocumentId = testWorkspace.GetDocumentIdInCurrentContext(textContainer); 1327var documentId = workspace.GetDocumentId(hostDocument);
DocumentTracking\FirstDocumentIsActiveAndVisibleDocumentTrackingService.cs (3)
23public event EventHandler<DocumentId?> ActiveDocumentChanged { add { } remove { } } 25public DocumentId TryGetActiveDocument() 28public ImmutableArray<DocumentId> GetVisibleDocuments()
NavigateTo\AbstractNavigateToTests.cs (3)
236public event EventHandler<DocumentId> ActiveDocumentChanged { add { } remove { } } 238public DocumentId TryGetActiveDocument() 241public 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)
348var documentId = testWorkspace.Documents.First(d => d.Name == "SourceDocument").Id; 467var documentId = testWorkspace.Documents.Where(d => d.Name == "SourceDocument").Single().Id;
TaskList\AbstractTaskListTests.cs (1)
36var documentId = hostDocument.Id;
Workspaces\EditorTestHostDocument.cs (1)
88DocumentId? id = null,
Workspaces\EditorTestWorkspace.cs (8)
57DocumentId? id = null, 139protected override void ApplyDocumentTextChanged(DocumentId document, SourceText newText) 146protected override void ApplyAdditionalDocumentTextChanged(DocumentId document, SourceText newText) 153protected override void ApplyAnalyzerConfigDocumentTextChanged(DocumentId document, SourceText newText) 160public override void OpenDocument(DocumentId documentId, bool activate = true) 170public override void OpenAdditionalDocument(DocumentId documentId, bool activate = true) 180public override void OpenAnalyzerConfigDocument(DocumentId documentId, bool activate = true) 190public 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)
644var documentId = DocumentId.CreateNewId(projectId);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
259DocumentId.CreateNewId(projectId), 337DocumentId.CreateNewId(projectId),
Diagnostics\DiagnosticDataTests.cs (1)
222var documentId = hostDocument.Id;
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
64var documentId = workspace.Documents[0].Id;
EditAndContinue\EditAndContinueLanguageServiceTests.cs (4)
118DocumentId documentId; 122.AddDocument(documentId = DocumentId.CreateNewId(projectId), "test.cs", SourceText.From("class C { }", Encoding.UTF8), filePath: "test.cs")); 247var 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)
307Assert.True(_metadataAsSourceService.TryAddDocumentToWorkspace(file.FilePath, stringText.Container, out var _));
SymbolFinder\DependentTypeFinderTests.cs (2)
32var 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)
76public void AddDocument(DocumentId id)
Suggestions\SuggestedActionWithNestedFlavors.cs (1)
157var 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)
302Dim documentId As DocumentId 332Private Shared Function GetDocumentId(workspace As EditorTestWorkspace, document As String) As DocumentId 338Private Shared Function SourceError(id As String, message As String, docId As DocumentId, projId As ProjectId, mappedLine As Integer, originalLine As Integer, mappedColumn As Integer, 343Private Shared Function SourceWarning(id As String, message As String, docId As DocumentId, projId As ProjectId, mappedLine As Integer, originalLine As Integer, mappedColumn As Integer, 348Private 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)
50Public 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.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)
32IEnumerable<DocumentId> DocumentIds { get; } 37IEnumerable<FSharpInlineRenameReplacement> GetReplacements(DocumentId documentId); 134bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText); 140bool 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)
55bool IInlineRenameInfo.TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 58bool IInlineRenameInfo.TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText)
Editor\InlineRename\FSharpInlineRenameReplacementInfo.cs (3)
29public abstract IEnumerable<DocumentId> DocumentIds { get; } 34public abstract IEnumerable<FSharpInlineRenameReplacement> GetReplacements(DocumentId documentId); 36IEnumerable<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)
76public IEnumerable<DocumentId> DocumentIds => _info.DocumentIds; 78public IEnumerable<InlineRenameReplacement> GetReplacements(DocumentId documentId) 169public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, string replacementText) 174public 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)
src\Tools\ExternalAccess\Razor\Shared\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);
src\Tools\ExternalAccess\Razor\Shared\SolutionExtensions.cs (1)
15public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, Uri documentUri)
src\Tools\ExternalAccess\Razor\Shared\Testing\AbstractRazorLanguageServerFactoryWrapper.cs (1)
21DocumentId id,
src\Tools\ExternalAccess\Razor\Shared\Testing\RazorTestLanguageServerFactory.cs (1)
46DocumentId id,
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (6)
src\Tools\ExternalAccess\Razor\Shared\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);
src\Tools\ExternalAccess\Razor\Shared\SolutionExtensions.cs (1)
15public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, Uri documentUri)
src\Tools\ExternalAccess\Razor\Shared\Testing\AbstractRazorLanguageServerFactoryWrapper.cs (1)
21DocumentId id,
src\Tools\ExternalAccess\Razor\Shared\Testing\RazorTestLanguageServerFactory.cs (1)
46DocumentId id,
Microsoft.CodeAnalysis.Features (332)
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
94DocumentId changedDocumentId, 99private readonly DocumentId _changedDocumentId = changedDocumentId;
AddImport\Remote\IRemoteMissingImportDiscoveryService.cs (2)
25Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DocumentId documentId, TextSpan span, string diagnosticId, int maxResults, 29Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DocumentId id, TextSpan span, ImmutableArray<string> diagnosticIds,
ChangeSignature\AbstractChangeSignatureService.cs (9)
254var nodesToUpdate = new Dictionary<DocumentId, List<SyntaxNode>>(); 336if (!TryGetNodeWithEditableSignatureOrAttributes(def, currentSolution, out var nodeToUpdate, out var documentId)) 360if (!TryGetNodeWithEditableSignatureOrAttributes(location.Location, currentSolution, out var nodeToUpdate2, out var documentId2)) 376var updatedRoots = new Dictionary<DocumentId, SyntaxNode>(); 377foreach (var docId in nodesToUpdate.Keys) 418var changedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync( 445private static void AddUpdatableNodeToDictionaries(Dictionary<DocumentId, List<SyntaxNode>> nodesToUpdate, DocumentId documentId, SyntaxNode nodeToUpdate, Dictionary<SyntaxNode, ISymbol> definitionToUse, ISymbol symbolWithSemanticParameters) 456private 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)
14ValueTask<ReferenceCount?> GetReferenceCountAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, int maxResultCount, CancellationToken cancellationToken); 15ValueTask<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken); 16ValueTask<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken); 17ValueTask<string?> GetFullyQualifiedNameAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (5)
50var newDocumentId = DocumentId.CreateNewId(projectToBeUpdated.Id, FileName); 78Solution solution, DocumentId sourceDocumentId, DocumentId documentWithMovedTypeId) 113private 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); 221using var _ = PooledHashSet<DocumentId>.GetInstance(out var referenceDocuments); 266protected async Task<ImmutableArray<(DocumentId, SyntaxNode)>> TryGetApplicableContainersFromAllDocumentsAsync( 268ImmutableArray<DocumentId> ids, 278using var _1 = ArrayBuilder<(DocumentId, SyntaxNode)>.GetInstance(ids.Length, out var containers); 309protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken) 344protected static bool IsSupportedLinkedDocument(Document document, out ImmutableArray<DocumentId> allDocumentIds) 425private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync( 427DocumentId id, 485var fixedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync( 760ImmutableArray<DocumentId> ids, 764using var _1 = PooledHashSet<DocumentId>.GetInstance(out var linkedDocumentsToSkip); 767foreach (var id in ids) 777var 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)
215foreach (var relatedId in relatedDocumentIds) 227async Task<CompletionDescription?> TryGetDescriptionAsync(DocumentId documentId)
Completion\Providers\AbstractSymbolCompletionProvider.cs (7)
354using var _ = PooledDictionary<DocumentId, int>.GetInstance(out var documentIdToIndex); 356foreach (var documentId in relatedDocumentIds) 385ImmutableArray<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)> linkedContextSymbolLists) 409private async Task<ImmutableArray<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)>> GetPerContextSymbolsAsync( 410CompletionContext completionContext, Document document, CompletionOptions options, IEnumerable<DocumentId> relatedDocuments, CancellationToken cancellationToken) 414return await ProducerConsumer<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)>.RunParallelAsync( 454ImmutableArray<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)> linkedContextSymbolLists)
Completion\Providers\ImportCompletionProvider\IRemoteExtensionMethodImportCompletionService.cs (1)
15DocumentId documentId,
Completion\Providers\SymbolCompletionItem.cs (1)
148foreach (var id in linkedIds)
Completion\SharedSyntaxContextsWithSpeculativeModel.cs (1)
21private readonly Lazy<ImmutableArray<DocumentId>> _lazyRelatedDocumentIds;
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (2)
250(DocumentId documentId, TextSpan span) renamedToken, 589var 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)
123public ImmutableArray<DiagnosticData> GetLastComputedDocumentDiagnostics(DocumentId documentId)
Diagnostics\DiagnosticsUpdatedArgs.cs (4)
24public readonly DocumentId? DocumentId; 30DocumentId? documentId, 47DocumentId? documentId, 56DocumentId? documentId)
Diagnostics\ICodeAnalysisDiagnosticAnalyzerService.cs (1)
41ImmutableArray<DiagnosticData> GetLastComputedDocumentDiagnostics(DocumentId documentId);
Diagnostics\IDiagnosticAnalyzerService.cs (1)
52Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, 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 (8)
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) 348internal static async Task<IEnumerable<KeyValuePair<DocumentId, DocumentState>>> GetMatchingDocumentsAsync(
EditAndContinue\DebuggingSession.cs (7)
117IEnumerable<KeyValuePair<DocumentId, CommittedSolution.DocumentState>> initialDocumentStates, 662public async ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 679var documentId = documentIds[i]; 703using var _3 = PooledDictionary<ActiveStatement, ArrayBuilder<(DocumentId unmappedDocumentId, LinePositionSpan span)>>.GetInstance( 723await foreach (var documentId in EditSession.GetChangedDocumentsAsync(SessionLog, oldProject, newProject, cancellationToken).ConfigureAwait(false)) 784DocumentId? unmappedDocumentId; 856await foreach (var unmappedDocumentId in EditSession.GetChangedDocumentsAsync(SessionLog, 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)
138ImmutableArray<DocumentId> captureMatchingDocuments, 147IEnumerable<KeyValuePair<DocumentId, CommittedSolution.DocumentState>> initialDocumentStates; 183private static IEnumerable<(Project, IEnumerable<DocumentState>)> GetDocumentStatesGroupedByProject(Solution solution, ImmutableArray<DocumentId> documentIds) 260public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
EditAndContinue\EditSession.cs (4)
274var documentId = newDocumentIds.First(); 491/// Enumerates <see cref="DocumentId"/>s of changed (not added or removed) <see cref="Document"/>s (not additional nor analyzer config). 493internal static async IAsyncEnumerable<DocumentId> GetChangedDocumentsAsync(TraceLog log, Project oldProject, Project newProject, [EnumeratorCancellation] CancellationToken cancellationToken) 819using 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)
28ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Solution solution, IManagedHotReloadService debuggerService, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken); 32ValueTask<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); 39ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken); 50ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Checksum solutionChecksum, DebuggingSessionId sessionId, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken); 51ValueTask<ImmutableArray<ActiveStatementSpan>> GetAdjustedActiveStatementSpansAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DebuggingSessionId sessionId, DocumentId documentId, CancellationToken cancellationToken);
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (1)
159public 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)
17ImmutableArray<(DocumentId DocumentId, ImmutableArray<RudeEditDiagnostic> Diagnostics)> documentsWithRudeEdits, 24public readonly ImmutableArray<(DocumentId DocumentId, ImmutableArray<RudeEditDiagnostic> Diagnostics)> DocumentsWithRudeEdits = documentsWithRudeEdits; 29ImmutableArray<(DocumentId, ImmutableArray<RudeEditDiagnostic>)> documentsWithRudeEdits,
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)
14ValueTask<ImmutableArray<(DocumentId, ImmutableArray<TextChange>)>> EncapsulateFieldsAsync( 16DocumentId documentId,
Extensions\IRemoteExtensionMessageHandlerService.cs (1)
24Checksum solutionChecksum, string messageName, string jsonMessage, DocumentId documentId, CancellationToken cancellationToken);
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)
23Task 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)
272private void EnqueueFullDocumentEvent(Solution solution, DocumentId documentId, UnitTestingInvocationReasons invocationReasons) 282private void EnqueueDocumentChangedEvent(Solution oldSolution, Solution newSolution, DocumentId documentId) 328private async Task EnqueueDocumentWorkItemAsync(Project project, DocumentId documentId, TextDocument? document, UnitTestingInvocationReasons invocationReasons, SyntaxNode? changedMember = null) 353private static Document GetRequiredDocument(Project project, DocumentId documentId, Document? document) 370foreach (var documentId in project.DocumentIds) 373foreach (var documentId in project.AdditionalDocumentIds) 376foreach (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)
37IReadOnlyList<DocumentId> documentId, 277private static async Task<Solution> GetFormattedSolutionAsync(Solution unformattedSolution, IEnumerable<DocumentId> documentIds, CancellationToken cancellationToken) 283foreach (var documentId in documentIds) 309ImmutableArray<DocumentId> documentIds, 326foreach (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)
271var newDocumentId = DocumentId.CreateNewId(projectToBeUpdated.Id, debugName: documentName); 347var documentId = DocumentId.CreateNewId(projectToBeUpdated.Id, documentName);
InheritanceMargin\IRemoteInheritanceMarginService.cs (1)
16DocumentId documentId,
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
343var 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)
244var 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)
60private IBidirectionalMap<MetadataAsSourceGeneratedFileInfo, DocumentId> _openedDocumentIds = BidirectionalMap<MetadataAsSourceGeneratedFileInfo, DocumentId>.Empty; 283public bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
MetadataAsSource\IMetadataAsSourceFileProvider.cs (1)
39bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId);
MetadataAsSource\IMetadataAsSourceFileService.cs (1)
38bool 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 SearchDocumentAndRelatedDocumentsAsync(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 sealed 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)
16Checksum 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(); 356var documentId = DocumentId.CreateNewId(projectId); 386public bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
QuickInfo\CommonSemanticQuickInfoProvider.cs (3)
70ImmutableArray<DocumentId> linkedDocumentIds) 90var candidateResults = new List<(DocumentId docId, TokenInformation tokenInformation)> 95foreach (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)
311private static async Task<MultiDictionary<DocumentId, IPropertySymbol>> GetDefinitionsByDocumentIdAsync( 316var result = new MultiDictionary<DocumentId, IPropertySymbol>(); 341DocumentId documentId, 342MultiDictionary<DocumentId, IPropertySymbol>.ValueSet originalDefinitions, 392DocumentId documentId, 393MultiDictionary<DocumentId, IPropertySymbol>.ValueSet originalDefinitions,
SemanticSearch\SemanticSearchUtilities.cs (1)
80public static DocumentId GetQueryDocumentId(Solution solution)
Shared\Extensions\DocumentExtensions.cs (2)
62foreach (var linkedDocumentId in document.GetLinkedDocumentIds()) 82foreach (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);
StackTraceExplorer\StackTraceExplorerService.cs (1)
88var documentId = solution.GetDocumentIdsWithFilePath(fileName).FirstOrDefault();
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (5)
166var linkedFiles = new HashSet<DocumentId>(); 170var canEdit = new Dictionary<DocumentId, bool>(); 356DocumentId documentId, 357HashSet<DocumentId> linkedDocuments, 358Dictionary<DocumentId, bool> canEdit)
UseAutoProperty\UseAutoPropertyFixAllProvider.cs (1)
43var documentsIdsAndNewRoots = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
ValueTracking\IValueTrackingService.cs (1)
21ValueTask<ImmutableArray<SerializableValueTrackedItem>> TrackValueSourceAsync(Checksum solutionChecksum, TextSpan selection, DocumentId document, CancellationToken cancellationToken);
ValueTracking\SerializableValueTrackedItem.cs (2)
17DocumentId documentId, 27public DocumentId DocumentId { get; } = documentId;
ValueTracking\ValueTrackedItem.cs (2)
17public DocumentId DocumentId { get; } 26DocumentId 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 (14)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (3)
119solution = solution.AddAdditionalDocument(DocumentId.CreateNewId(project.Id), "additional", CreateText(additionalFileText)); 125DocumentId.CreateNewId(project.Id), 369DocumentId.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; 52public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 64public 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 (47)
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 (24)
86var documentIdA = DocumentId.CreateNewId(projectPId, debugName: "A"); 93var documentIdB = DocumentId.CreateNewId(projectPId, debugName: "B"); 100var documentIdC = DocumentId.CreateNewId(projectPId, debugName: "C"); 107var documentIdE = DocumentId.CreateNewId(projectPId, debugName: "E"); 130id: DocumentId.CreateNewId(projectQ.Id, debugName: "D"), 348DocumentId.CreateNewId(document.Project.Id), 404var designTimeOnlyDocumentId = DocumentId.CreateNewId(projectId); 620var document1 = solution. 678var documentA = solution. 917var documentId = DocumentId.CreateNewId(projectId); 1243var document1 = solution. 1286var document1 = solution. 1656var documentId = DocumentId.CreateNewId(projectId); 2199var document1 = solution. 2287var document2 = solution. 2384var document1 = project.AddDocument("test.cs", sourceText1, filePath: sourceFile.Path); 2416var document1 = solution.
EditAndContinue\EditSessionActiveStatementsTests.cs (3)
82var id = DocumentId.CreateNewId(project.Id, name); 180solution = dummyProject.Solution.AddDocument(DocumentId.CreateNewId(dummyProject.Id, NoCompilationConstants.LanguageName), "a.dummy", "");
EditAndContinue\RemoteEditAndContinueServiceTests.cs (4)
73var documentId = DocumentId.CreateNewId(projectId); 75var inProcOnlyDocumentId = DocumentId.CreateNewId(inProcOnlyProjectId);
EditAndContinue\UnitTestingHotReloadServiceTests.cs (2)
42var 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 (48)
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)
71var documentId = DocumentId.CreateFromSerialized(projectId, documentIdGuid, isSourceGenerated: true, hintName);
ExternalAccess\Razor\FormatNewFileHandler.cs (2)
52var documentId = DocumentId.CreateNewId(project.Id);
Features\Diagnostics\DiagnosticAnalyzerService.cs (1)
105Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (1)
197foreach (var documentId in project.Solution.GetDocumentIdsWithFilePath(path))
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer_MemberSpans.cs (2)
24private readonly record struct MemberSpans(DocumentId DocumentId, VersionStamp Version, ImmutableArray<TextSpan> Spans); 59private void SaveMemberSpans(DocumentId documentId, VersionStamp version, ImmutableArray<TextSpan> memberSpans)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (3)
21public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 55IReadOnlyList<DocumentId> documentIds, 77foreach (var documentId in documentIds)
Features\Diagnostics\EngineV2\InProcOrRemoteHostAnalyzerRunner.cs (2)
215private static ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> Hydrate(ImmutableArray<(DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics)> diagnosticByDocument, Project project)
Handler\CodeActions\CodeActionResolveHelper.cs (12)
47using var _2 = PooledHashSet<DocumentId>.GetInstance(out var modifiedDocumentIds); 214IEnumerable<DocumentId> removedDocuments, 215Func<DocumentId, TTextDocument?> getOldDocument) 218foreach (var docId in removedDocuments) 230IEnumerable<DocumentId> addedDocuments, 231Func<DocumentId, TTextDocument?> getNewDocument) 234foreach (var docId in addedDocuments) 267IEnumerable<DocumentId> changedDocuments, 268Func<DocumentId, TTextDocument?> getNewDocument, 269Func<DocumentId, TTextDocument?> getOldDocument) 272foreach (var docId in changedDocuments) 325private 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(); 71AsyncLazy<ILookup<DocumentId, DiagnosticData>> GetLazyDiagnostics()
Handler\Diagnostics\ProjectOrDocumentId.cs (2)
16private readonly DocumentId? _documentId; 29public 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 (8)
Diagnostics\PullDiagnosticTests.cs (1)
2224internal static async Task InsertInClosedDocumentAsync(TestLspServer testLspServer, DocumentId documentId, string textToInsert, int? position = null)
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (1)
165DocumentId.CreateNewId(project.Id),
Workspaces\LspWorkspaceManagerTests.cs (4)
222var newDocumentId = DocumentId.CreateNewId(testLspServer.TestWorkspace.CurrentSolution.ProjectIds[0]); 243var 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.PublicApiAnalyzers.CodeFixes (11)
AnnotatePublicApiFix.cs (1)
110var updatedPublicSurfaceAreaText = new List<(DocumentId, SourceText)>();
DeclarePublicApiFix.cs (6)
192public AdditionalDocumentChangeAction(string title, DocumentId? apiDocId, bool isPublic, Func<CancellationToken, Task<Solution>> createChangedAdditionalDocument) 213private readonly DocumentId? _apiDocId; 216public FixAllAdditionalDocumentChangeAction(string title, DocumentId? apiDocId, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix, bool isPublic) 229var updatedPublicSurfaceAreaText = new List<KeyValuePair<DocumentId, SourceText>>(); 298updatedPublicSurfaceAreaText.Add(new KeyValuePair<DocumentId, SourceText>(publicSurfaceAreaAdditionalDocument.Id, newSourceText)); 308foreach (KeyValuePair<DocumentId, SourceText> pair in updatedPublicSurfaceAreaText)
NullableEnablePublicApiFix.cs (1)
87var updatedSurfaceAreaText = new List<(DocumentId, SourceText)>();
PublicApiFixHelpers.cs (3)
25internal static string CreateEquivalenceKey(this DocumentId? doc, bool isPublic) 38internal static DocumentId? CreateDocIdFromEquivalenceKey(this FixAllContext fixAllContext, out bool isPublic) 49return DocumentId.CreateFromSerialized(projectId, docGuid);
Microsoft.CodeAnalysis.Remote.ServiceHub (52)
Host\RemoteWorkspace.SolutionCreator.cs (8)
429Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 432using var _1 = PooledDictionary<DocumentId, (Checksum attributeChecksum, Checksum textChecksum)>.GetInstance(out var oldDocumentIdToChecksums); 433using var _2 = PooledDictionary<DocumentId, (Checksum attributeChecksum, Checksum textChecksum)>.GetInstance(out var newDocumentIdToChecksums); 474Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 475Dictionary<DocumentId, (Checksum attributeChecksum, Checksum textChecksum)> oldDocumentIdToStateChecksums, 476Dictionary<DocumentId, (Checksum attributeChecksum, Checksum textChecksum)> newDocumentIdToStateChecksums, 500ImmutableArray<DocumentId>.Builder? lazyDocumentsToRemove = null; 506lazyDocumentsToRemove ??= ImmutableArray.CreateBuilder<DocumentId>();
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (3)
49public ValueTask SynchronizeActiveDocumentAsync(DocumentId? documentId, CancellationToken cancellationToken) 57DocumentId documentId, 109DocumentId 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)
29DocumentId documentId, 54private static async Task<(DocumentId, TextSpan)> GetRenamedTokenAsync( 78var changedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
Services\DiagnosticAnalyzer\RemoteDiagnosticAnalyzerService.cs (1)
51var 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)
84public ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken) 123public ValueTask<ImmutableArray<DiagnosticData>> GetDocumentDiagnosticsAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DocumentId documentId, CancellationToken cancellationToken) 217public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Checksum solutionChecksum, DebuggingSessionId sessionId, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 228public ValueTask<ImmutableArray<ActiveStatementSpan>> GetAdjustedActiveStatementSpansAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DebuggingSessionId sessionId, DocumentId documentId, CancellationToken cancellationToken)
Services\EncapsulateField\RemoteEncapsulateFieldService.cs (2)
25public ValueTask<ImmutableArray<(DocumentId, ImmutableArray<TextChange>)>> EncapsulateFieldsAsync( 27DocumentId documentId,
Services\ExtensionMessageHandler\RemoteExtensionMessageHandlerService.cs (1)
46Checksum solutionChecksum, string messageName, string jsonMessage, DocumentId documentId, CancellationToken cancellationToken)
Services\ExtensionMethodImportCompletion\RemoteExtensionMethodImportCompletionService.cs (1)
32DocumentId documentId,
Services\FullyQualify\RemoteFullyQualifyService.cs (1)
26public ValueTask<FullyQualifyFixData?> GetFixDataAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan span, CancellationToken cancellationToken)
Services\InheritanceMargin\RemoteInheritanceMarginService.cs (1)
30DocumentId documentId,
Services\LegacySolutionEvents\RemoteLegacySolutionEventsAggregationService.cs (1)
41DocumentId? documentId,
Services\MissingImportDiscovery\RemoteMissingImportDiscoveryService.cs (2)
32DocumentId documentId, 62DocumentId documentId,
Services\NavigateToSearch\RemoteNavigateToSearchService.cs (2)
50DocumentId documentId, 69ImmutableArray<DocumentId> priorityDocumentIds,
Services\NavigationBar\RemoteNavigationBarItemService.cs (1)
23Checksum 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)
49private readonly LinkedList<(DocumentId id, ClassificationType type, Checksum checksum, ImmutableArray<ClassifiedSpan> classifiedSpans)> _cachedData = new();
Services\SemanticClassification\RemoteSemanticClassificationService.cs (1)
24DocumentId documentId,
Services\SourceGeneration\RemoteSourceGenerationService.cs (2)
53Checksum solutionChecksum, ProjectId projectId, ImmutableArray<DocumentId> documentIds, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken) 62foreach (var id in documentIds)
Services\SymbolFinder\RemoteSymbolFinderService.cs (1)
38ImmutableArray<DocumentId> documentArgs,
Services\TaskList\RemoteTaskListService.cs (1)
27Checksum 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)
164DocumentId documentId, Checksum attributeChecksum, Checksum textChecksum, CancellationToken cancellationToken)
IRemoteAssetSynchronizationService.cs (2)
29DocumentId documentId, 41ValueTask SynchronizeActiveDocumentAsync(DocumentId? documentId, CancellationToken cancellationToken);
Serialization\MessagePackFormatters.cs (1)
45/// 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)
675Dim newDocId = DocumentId.CreateNewId(oldProject.Id)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
39Private ReadOnly _documentId As DocumentId
Microsoft.CodeAnalysis.Workspaces (776)
Classification\IRemoteSemanticClassificationService.cs (1)
32DocumentId documentId,
CodeActions\CodeAction_Cleanup.cs (6)
59internal static ImmutableArray<DocumentId> GetAllChangedOrAddedDocumentIds( 88async Task<ImmutableArray<(DocumentId documentId, CodeCleanupOptions codeCleanupOptions)>> GetDocumentIdsAndOptionsToCleanAsync() 90using var _ = ArrayBuilder<(DocumentId documentId, CodeCleanupOptions options)>.GetInstance(documentIds.Length, out var documentIdsAndOptions); 91foreach (var documentId in documentIds) 126ImmutableArray<(DocumentId documentId, CodeCleanupOptions options)> documentIdsAndOptions, 147var 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)
50var docIdToTextMerger = new Dictionary<DocumentId, TextChangeMerger>(); 77FixAllContext fixAllContext, IProgress<CodeAnalysisProgress> progressTracker, Dictionary<DocumentId, TextChangeMerger> docIdToTextMerger) 109Dictionary<DocumentId, TextChangeMerger> docIdToTextMerger, 199Dictionary<DocumentId, TextChangeMerger> docIdToTextMerger) 209var docId = group.Key; 253ImmutableArray<(DocumentId documentId, TextChangeMerger merger)> docIdsAndMerger,
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (1)
70var changedRootsAndTexts = await ProducerConsumer<(DocumentId documentId, (SyntaxNode? node, SourceText? text))>.RunParallelAsync(
Diagnostics\DiagnosticAnalysisResult.cs (18)
28private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> _syntaxLocals; 33private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> _semanticLocals; 38private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> _nonLocals; 47ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> syntaxLocals, 48ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> semanticLocals, 49ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> nonLocals, 69syntaxLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 70semanticLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 71nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 77ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> syntaxLocalMap, 78ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> semanticLocalMap, 79ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> nonLocalMap, 104private ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? GetMap(AnalysisKind kind) 131public ImmutableArray<DiagnosticData> GetDocumentDiagnostics(DocumentId documentId, AnalysisKind kind) 150semanticLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 151nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 155private static void VerifyDocumentMap(Project project, ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> map) 157foreach (var documentId in map.Keys)
Diagnostics\DiagnosticAnalysisResultBuilder.cs (17)
23private Dictionary<DocumentId, List<DiagnosticData>>? _lazySyntaxLocals = null; 24private Dictionary<DocumentId, List<DiagnosticData>>? _lazySemanticLocals = null; 25private Dictionary<DocumentId, List<DiagnosticData>>? _lazyNonLocals = null; 29public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> SyntaxLocals => Convert(_lazySyntaxLocals); 30public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> SemanticLocals => Convert(_lazySemanticLocals); 31public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> NonLocals => Convert(_lazyNonLocals); 34public void AddExternalSyntaxDiagnostics(DocumentId documentId, ImmutableArray<Diagnostic> diagnostics) 39public void AddExternalSemanticDiagnostics(DocumentId documentId, ImmutableArray<Diagnostic> diagnostics) 51ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, DocumentId documentId, ImmutableArray<Diagnostic> diagnostics) 96private static void AddDocumentDiagnostic(ref Dictionary<DocumentId, List<DiagnosticData>>? map, TextDocument document, Diagnostic diagnostic) 122Dictionary<DocumentId, List<DiagnosticData>>? dummy = null; 130ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, Diagnostic diagnostic) 183ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, ImmutableArray<Diagnostic> diagnostics) 189private static ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> Convert(Dictionary<DocumentId, List<DiagnosticData>>? map) 192? ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty
Diagnostics\DiagnosticArguments.cs (2)
37public DocumentId? DocumentId; 75DocumentId? documentId,
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)
200var additionalDocumentId = project.GetDocumentForFile(file); 245DocumentId? additionalDocumentId, 261DocumentId? additionalDocumentId,
Diagnostics\IWorkspaceVenusSpanMappingService.cs (1)
18void 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) 364DocumentId documentId, 467var docId = declGroup.Key;
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
242async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(DocumentId documentId) 252MultiDictionary<DocumentId, DeclaredSymbolInfo> documentToInfos,
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (15)
19MultiDictionary<DocumentId, DeclaredSymbolInfo> classesAndRecordsThatMayDeriveFromSystemObject, 20MultiDictionary<DocumentId, DeclaredSymbolInfo> valueTypes, 21MultiDictionary<DocumentId, DeclaredSymbolInfo> enums, 22MultiDictionary<DocumentId, DeclaredSymbolInfo> delegates, 23MultiDictionary<string, (DocumentId, DeclaredSymbolInfo)> namedTypes) 36public readonly MultiDictionary<DocumentId, DeclaredSymbolInfo> ClassesAndRecordsThatMayDeriveFromSystemObject = classesAndRecordsThatMayDeriveFromSystemObject; 37public readonly MultiDictionary<DocumentId, DeclaredSymbolInfo> ValueTypes = valueTypes; 38public readonly MultiDictionary<DocumentId, DeclaredSymbolInfo> Enums = enums; 39public readonly MultiDictionary<DocumentId, DeclaredSymbolInfo> Delegates = delegates; 40public readonly MultiDictionary<string, (DocumentId, DeclaredSymbolInfo)> NamedTypes = namedTypes; 69var classesThatMayDeriveFromSystemObject = new MultiDictionary<DocumentId, DeclaredSymbolInfo>(); 70var valueTypes = new MultiDictionary<DocumentId, DeclaredSymbolInfo>(); 71var enums = new MultiDictionary<DocumentId, DeclaredSymbolInfo>(); 72var delegates = new MultiDictionary<DocumentId, DeclaredSymbolInfo>(); 74var 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)
207foreach (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 (17)
36private readonly DocumentId _documentIdOfRenameSymbolDeclaration; 77public readonly DocumentId DocumentId; 116var documentIdsThatGetsAnnotatedAndRenamed = new HashSet<DocumentId>(documentsByProject); 260private async Task DebugVerifyNoErrorsAsync(MutableConflictResolution conflictResolution, IEnumerable<DocumentId> documents) 262var documentIdErrorStateLookup = new Dictionary<DocumentId, bool>(); 266foreach (var documentId in documents) 283foreach (var documentId in documents) 302HashSet<DocumentId> documentIdsForConflictResolution, 303IEnumerable<DocumentId> allDocumentIdsInProject, 320foreach (var documentId in documentIdsForConflictResolution) 346foreach (var documentId in documentIdsForConflictResolution) 438foreach (var unprocessedDocumentIdWithPotentialDeclarationConflicts in allDocumentIdsInProject.Where(d => !documentIdsForConflictResolution.Contains(d))) 698private async Task<(ImmutableHashSet<DocumentId> documentIds, ImmutableArray<string> possibleNameConflicts)> FindDocumentsAndPossibleNameConflictsAsync() 702var documentIds = new HashSet<DocumentId>(); 730HashSet<DocumentId> documentIds, 776HashSet<DocumentId> documentIdsToRename, 785foreach (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)
51DocumentId documentId, 62public readonly DocumentId DocumentId = documentId;
Rename\LightweightRenameLocations.cs (1)
120public 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)
216foreach (var linkedDocumentId in document.GetLinkedDocumentIds())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (11)
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) 69/// Returns the <see cref="SourceGeneratedDocument"/> for the given <see cref="DocumentId"/> if it exists and has been generated. 76public static SourceGeneratedDocument GetRequiredSourceGeneratedDocumentForAlreadyGeneratedId(this Solution solution, DocumentId documentId) 89public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 92public static async ValueTask<TextDocument> GetRequiredTextDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken = default) 96public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 99public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 102public 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)
24internal 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)
14public DocumentId OldActiveContextDocumentId { get; } 15public DocumentId NewActiveContextDocumentId { get; } 17public 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)
119private readonly Dictionary<DocumentId, IWatchedFile> _documentWatchedFiles = []; 573ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> documentsToOpen = []; 574ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> additionalDocumentsToOpen = []; 575ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> analyzerConfigDocumentsToOpen = []; 844public DocumentId AddSourceTextContainer(
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (3)
57public ImmutableHashSet<DocumentId> DocumentsNotFromFiles { get; private set; } = []; 204internal void AddDocumentToDocumentsNotFromFiles_NoLock(DocumentId documentId) 211internal 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)
517/// Gets the list of <see cref="DocumentId"/>s that are linked to this 519/// share the same <see cref="TextDocument.FilePath" />. This <see cref="DocumentId"/> is excluded from the 522public ImmutableArray<DocumentId> GetLinkedDocumentIds()
Workspace\Solution\DocumentDiagnostic.cs (2)
7public class DocumentDiagnostic(WorkspaceDiagnosticKind kind, string message, DocumentId documentId) : WorkspaceDiagnostic(kind, message) 9public 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)
26private static readonly ConditionalWeakTable<SyntaxTree, DocumentId> s_syntaxTreeToIdMap = new(); 652private static void BindSyntaxTreeToId(SyntaxTree tree, DocumentId id) 654if (!s_syntaxTreeToIdMap.TryGetValue(tree, out var existingId)) 657var localId = id; 664public static DocumentId? GetDocumentIdForTree(SyntaxTree tree) 666s_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) 337internal SourceGeneratedDocument? TryGetSourceGeneratedDocumentForAlreadyGeneratedId(DocumentId documentId) 464private static readonly Func<DocumentId, Project, Document?> s_tryCreateDocumentFunction = 467private static readonly Func<DocumentId, Project, AdditionalDocument?> s_tryCreateAdditionalDocumentFunction = 470private static readonly Func<DocumentId, Project, AnalyzerConfigDocument?> s_tryCreateAnalyzerConfigDocumentFunction = 473private static readonly Func<DocumentId, (SourceGeneratedDocumentState state, Project project), SourceGeneratedDocument> s_createSourceGeneratedDocumentFunction = 672var id = DocumentId.CreateNewId(this.Id); 684var id = DocumentId.CreateNewId(this.Id); 693var id = DocumentId.CreateNewId(this.Id, debugName: name); 702var id = DocumentId.CreateNewId(this.Id); 711var id = DocumentId.CreateNewId(this.Id); 720var id = DocumentId.CreateNewId(this.Id); 727public Project RemoveDocument(DocumentId documentId) 737public Project RemoveDocuments(ImmutableArray<DocumentId> documentIds) 747public Project RemoveAdditionalDocument(DocumentId documentId) 755public Project RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 765public Project RemoveAnalyzerConfigDocument(DocumentId documentId) 773public Project RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 780private void CheckIdsContainedInProject(ImmutableArray<DocumentId> documentIds) 782foreach (var documentId in documentIds) 806var 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 (16)
30/// The documents in this project. They are sorted by <see cref="DocumentId.Id"/> to provide a stable sort for 36/// The additional documents in this project. They are sorted by <see cref="DocumentId.Id"/> to provide a stable sort for 42/// The analyzer config documents in this project. They are sorted by <see cref="DocumentId.Id"/> to provide a stable sort for 54private AsyncLazy<Dictionary<ImmutableArray<byte>, DocumentId>>? _lazyContentHashToDocumentId; 137private async Task<Dictionary<ImmutableArray<byte>, DocumentId>> ComputeContentHashToDocumentIdAsync(CancellationToken cancellationToken) 139var result = new Dictionary<ImmutableArray<byte>, DocumentId>(ImmutableArrayComparer<byte>.Instance); 170private AsyncLazy<Dictionary<ImmutableArray<byte>, DocumentId>> LazyContentHashToDocumentId 194public async ValueTask<DocumentId?> GetDocumentIdAsync(ImmutableArray<byte> contentHash, CancellationToken cancellationToken) 397var documentId = DocumentState.GetDocumentIdForTree(tree); 469var documentId = DocumentState.GetDocumentIdForTree(tree); 939public ProjectState RemoveDocuments(ImmutableArray<DocumentId> documentIds) 952public ProjectState RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 962public ProjectState RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 1046public ProjectState UpdateDocumentsOrder(ImmutableList<DocumentId> documentIds) 1131public void AddDocumentIdsWithFilePath(ref TemporaryArray<DocumentId> temporaryArray, string filePath) 1138public DocumentId? GetFirstDocumentIdWithFilePath(string filePath)
Workspace\Solution\Solution.cs (70)
43private readonly Dictionary<DocumentId, AsyncLazy<Solution>> _documentIdToFrozenSolution = []; 219public bool ContainsDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) => this.SolutionState.ContainsDocument(documentId); 224public bool ContainsAdditionalDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) => this.SolutionState.ContainsAdditionalDocument(documentId); 229public bool ContainsAnalyzerConfigDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) => this.SolutionState.ContainsAnalyzerConfigDocument(documentId); 234public DocumentId? GetDocumentId(SyntaxTree? syntaxTree) => GetDocumentId(syntaxTree, projectId: null); 239public DocumentId? GetDocumentId(SyntaxTree? syntaxTree, ProjectId? projectId) 245public Document? GetDocument(DocumentId? documentId) 251internal ValueTask<Document?> GetDocumentAsync(DocumentId? documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 266internal ValueTask<TextDocument?> GetTextDocumentAsync(DocumentId? documentId, CancellationToken cancellationToken = default) 281public TextDocument? GetAdditionalDocument(DocumentId? documentId) 294public AnalyzerConfigDocument? GetAnalyzerConfigDocument(DocumentId? documentId) 304public ValueTask<SourceGeneratedDocument?> GetSourceGeneratedDocumentAsync(DocumentId documentId, CancellationToken cancellationToken) 564public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds) 937public Solution AddDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 955public Solution AddDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false) 974public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue) 992private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated) 1006public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null) 1046public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 1053public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1084public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1108private DocumentInfo CreateDocumentInfo(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders, string? filePath) 1135public Solution RemoveDocument(DocumentId documentId) 1144public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds) 1150private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1156public Solution RemoveAdditionalDocument(DocumentId documentId) 1165public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 1171private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1177public Solution RemoveAnalyzerConfigDocument(DocumentId documentId) 1186public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 1192private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1198public Solution WithDocumentName(DocumentId documentId, string name) 1217public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders) 1232public Solution WithDocumentFilePath(DocumentId documentId, string? filePath) 1246public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1249internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue) 1269public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1290public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1311public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1332public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1353public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1374public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue) 1378internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue) 1394internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState, bool forceEvenIfTreesWouldDiffer) 1397internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer) 1404public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind) 1427public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1448public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1469public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1520internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken) 1539static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId) 1544static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken) 1569internal ImmutableArray<DocumentId> GetRelatedDocumentIds(DocumentId documentId, bool includeDifferentLanguages = false) 1579internal DocumentId? GetFirstRelatedDocumentId(DocumentId documentId, ProjectId? relatedProjectIdHint) 1599public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1678/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a 1684/// were to return more than one <see cref="DocumentId"/>, you should not assume that just because one is a regular source file means 1687public ImmutableArray<DocumentId> GetDocumentIdsWithFilePath(string? filePath) => this.SolutionState.GetDocumentIdsWithFilePath(filePath); 1745private void CheckContainsDocument(DocumentId documentId) 1765bool ContainsSourceGeneratedDocument(DocumentId documentId) 1775private void CheckContainsDocuments(ImmutableArray<DocumentId> documentIds) 1782foreach (var documentId in documentIds) 1788private void CheckContainsAdditionalDocument(DocumentId documentId) 1801private void CheckContainsAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 1808foreach (var documentId in documentIds) 1814private void CheckContainsAnalyzerConfigDocument(DocumentId documentId) 1827private void CheckContainsAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 1834foreach (var documentId in documentIds)
Workspace\Solution\Solution_SemanticModelCaching.cs (3)
20private ImmutableArray<(DocumentId documentId, SemanticModel semanticModel)> _activeSemanticModels = []; 23DocumentId documentId, SemanticModel semanticModel) 34var activeDocumentId = service.TryGetActiveDocument();
Workspace\Solution\SolutionChanges.cs (1)
95internal IEnumerable<DocumentId> GetExplicitlyChangedSourceGeneratedDocuments()
Workspace\Solution\SolutionCompilationState.cs (42)
554ProjectId projectId, ImmutableList<DocumentId> documentIds) 606using var _2 = ArrayBuilder<DocumentId>.GetInstance(out var removedDocumentInfos); 643foreach (var oldDocumentId in oldDocumentStates.Ids) 774DocumentId documentId, 788internal SolutionCompilationState WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode) 799(ImmutableArray<(DocumentId, SourceText)>, 805using var _1 = ArrayBuilder<(DocumentId, SourceText)>.GetInstance(capacity: texts.Length, out var ordinaryDocuments); 831ImmutableArray<(DocumentId documentId, TDocumentData documentData)> documentsToUpdate, 944/// <inheritdoc cref="SolutionState.WithAdditionalDocumentText(DocumentId, SourceText, PreservationMode)"/> 946DocumentId documentId, SourceText text, PreservationMode mode) 952/// <inheritdoc cref="SolutionState.WithAnalyzerConfigDocumentText(DocumentId, SourceText, PreservationMode)"/> 954DocumentId documentId, SourceText text, PreservationMode mode) 963/// <inheritdoc cref="SolutionState.WithDocumentText(DocumentId, TextAndVersion, PreservationMode)"/> 965DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode) 971/// <inheritdoc cref="SolutionState.WithAdditionalDocumentText(DocumentId, TextAndVersion, PreservationMode)"/> 973DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode) 979/// <inheritdoc cref="SolutionState.WithAnalyzerConfigDocumentText(DocumentId, TextAndVersion, PreservationMode)"/> 981DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode) 987/// <inheritdoc cref="Solution.WithDocumentSyntaxRoots(ImmutableArray{ValueTuple{DocumentId, SyntaxNode}}, PreservationMode)"/> 991public SolutionCompilationState WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode) 1004(ImmutableArray<(DocumentId, SyntaxNode)>, 1010using var _1 = ArrayBuilder<(DocumentId, SyntaxNode)>.GetInstance(capacity: syntaxRoots.Length, out var ordinaryDocuments); 1031ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer) 1045DocumentId documentId, SourceCodeKind sourceCodeKind) 1053DocumentId documentId, TextLoader loader, PreservationMode mode) 1068DocumentId documentId, TextLoader loader, PreservationMode mode) 1083DocumentId documentId, TextLoader loader, PreservationMode mode) 1096private SolutionCompilationState UpdateDocumentState(StateChange stateChange, DocumentId documentId) 1115private SolutionCompilationState UpdateAdditionalDocumentState(StateChange stateChange, DocumentId documentId) 1270DocumentId documentId) 1395using var _ = PooledDictionary<DocumentId, SourceGeneratedDocumentState>.GetInstance(out var documentStates); 1636DocumentId documentId, CancellationToken cancellationToken) 1689SolutionCompilationState @this, DocumentId documentId, CancellationToken cancellationToken) 1700foreach (var currentDocumentId in allDocumentIds) 1729var documentId = newDocumentState.Id; 1781public SolutionCompilationState RemoveDocumentsFromMultipleProjects<T>(ImmutableArray<DocumentId> documentIds) 1803private SolutionCompilationState RemoveDocumentsFromSingleProject<T>(ProjectId projectId, ImmutableArray<DocumentId> documentIds) 1811foreach (var documentId in documentIds) 1832private static TranslationAction GetRemoveDocumentsTranslationAction<TDocumentState>(ProjectState oldProject, ImmutableArray<DocumentId> documentIds, ImmutableArray<TDocumentState> states) 1882public SolutionCompilationState WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode) 1884using var _ = ArrayBuilder<(DocumentId, SourceText)>.GetInstance(out var changedDocuments); 1886foreach (var documentId in documentIds)
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (1)
73SourceGeneratedDocumentState? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
907public 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)
202public SourceGeneratedDocumentState? TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(DocumentId documentId)
Workspace\Solution\SolutionState.cs (29)
63private readonly ConcurrentDictionary<string, ImmutableArray<DocumentId>> _lazyFilePathToRelatedDocumentIds = new ConcurrentDictionary<string, ImmutableArray<DocumentId>>(FilePathComparer); 281public bool ContainsDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) 292public bool ContainsAdditionalDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) 303public bool ContainsAnalyzerConfigDocument([NotNullWhen(returnValue: true)] DocumentId? documentId) 311internal DocumentState GetRequiredDocumentState(DocumentId documentId) 314private AdditionalDocumentState GetRequiredAdditionalDocumentState(DocumentId documentId) 317private AnalyzerConfigDocumentState GetRequiredAnalyzerConfigDocumentState(DocumentId documentId) 823public StateChange WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds) 832foreach (var id in documentIds) 950DocumentId documentId, 970public StateChange WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 998public StateChange WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1014public StateChange WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1030public StateChange WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1046public StateChange WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1062public StateChange WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1078public StateChange WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind) 1090public StateChange UpdateDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1103public StateChange UpdateAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1116public StateChange UpdateAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1186public ImmutableArray<DocumentId> GetDocumentIdsWithFilePath(string? filePath) 1193static ImmutableArray<DocumentId> ComputeDocumentIdsWithFilePath(string filePath, SolutionState @this) 1195using var result = TemporaryArray<DocumentId>.Empty; 1252public DocumentId? GetFirstRelatedDocumentId(DocumentId documentId, ProjectId? relatedProjectIdHint) 1272foreach (var relatedDocumentId in relatedDocumentIds) 1305public 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)
137var documentId = assetPath.DocumentId;
Workspace\Solution\TextDocument.cs (1)
38public DocumentId Id => State.Id;
Workspace\Solution\TextDocumentState.cs (1)
48public DocumentId Id => Attributes.Id;
Workspace\Solution\TextDocumentStates.cs (43)
29using FilePathToDocumentIds = ReadOnlyDictionary<string, OneOrMany<DocumentId>>; 33/// Holds on a <see cref="DocumentId"/> to <see cref="TextDocumentState"/> map and an ordering. 44ImmutableSortedDictionary.Create<DocumentId, TState>(DocumentIdComparer.Instance), 48new(new Dictionary<string, OneOrMany<DocumentId>>())); 51private readonly ImmutableList<DocumentId> _ids; 56ImmutableList<DocumentId> ids, 57ImmutableSortedDictionary<DocumentId, TState> map, 81public TextDocumentStates<TState> WithCompilationOrder(ImmutableList<DocumentId> ids) 90public bool Contains(DocumentId id) 93public bool TryGetState(DocumentId documentId, [NotNullWhen(true)] out TState? state) 96public TState? GetState(DocumentId documentId) 99public TState GetRequiredState(DocumentId documentId) 103/// <see cref="DocumentId"/>s in the order in which they were added to the project (the compilation order). 105public IReadOnlyList<DocumentId> Ids => _ids; 108/// States ordered by <see cref="DocumentId"/>. 111/// The entries in the map are sorted by <see cref="DocumentId.Id"/>, which yields locally deterministic order but not the order that 115public ImmutableSortedDictionary<DocumentId, TState> States { get; } 144using var pooledIds = SharedPools.Default<List<DocumentId>>().GetPooledObject(); 156public TextDocumentStates<TState> RemoveRange(ImmutableArray<DocumentId> ids) 160using var _ = PooledHashSet<DocumentId>.GetInstance(out var set); 166foreach (var documentId in _ids) 173IEnumerable<DocumentId> enumerableIds = ids; 187var id = state.Id; 222/// Returns a <see cref="DocumentId"/>s of documents whose state changed when compared to older states. 224public IEnumerable<DocumentId> GetChangedStateIds(TextDocumentStates<TState> oldStates, bool ignoreUnchangedContent = false, bool ignoreUnchangeableDocuments = false) 228foreach (var id in Ids) 252/// Returns a <see cref="DocumentId"/>s of added documents. 254public IEnumerable<DocumentId> GetAddedStateIds(TextDocumentStates<TState> oldStates) 258/// Returns a <see cref="DocumentId"/>s of removed documents. 260public IEnumerable<DocumentId> GetRemovedStateIds(TextDocumentStates<TState> oldStates) 263private static IEnumerable<DocumentId> Except(ImmutableList<DocumentId> ids, ImmutableSortedDictionary<DocumentId, TState> map) 265foreach (var id in ids) 286private sealed class DocumentIdComparer : IComparer<DocumentId?> 288public static readonly IComparer<DocumentId?> Instance = new DocumentIdComparer(); 294public int Compare(DocumentId? x, DocumentId? y) 313var documentIds = new FixedSizeArrayBuilder<DocumentId>(States.Count); 329public void AddDocumentIdsWithFilePath(ref TemporaryArray<DocumentId> temporaryArray, string filePath) 336foreach (var value in oneOrMany) 341public DocumentId? GetFirstDocumentIdWithFilePath(string filePath) 358var result = new Dictionary<string, OneOrMany<DocumentId>>(SolutionState.FilePathComparer);
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)
22var documentId = workspace.GetDocumentIdInCurrentContext(text.Container); 63var id = workspace.GetDocumentIdInCurrentContext(text.Container); 110var documentId = workspace.GetDocumentIdInCurrentContext(container); 129var id = workspace.GetDocumentIdInCurrentContext(container);
Workspace\Workspace.cs (72)
199/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/> 204DocumentId? documentId = null, 231Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 251Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 295using var _1 = PooledHashSet<DocumentId>.GetInstance(out var changedDocumentIds); 296using var _2 = ArrayBuilder<DocumentId>.GetInstance(out var addedDocumentIds); 328Solution solution, ArrayBuilder<DocumentId> addedDocumentIds) 331using var _ = ArrayBuilder<(DocumentId, DocumentState)>.GetInstance(out var relatedDocumentIdsAndStates); 333foreach (var addedDocumentId in addedDocumentIds) 344var relatedDocumentId = solution.GetFirstRelatedDocumentId(addedDocumentId, relatedProjectIdHint); 368static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds) 372using var _ = PooledDictionary<DocumentId, DocumentState>.GetInstance(out var relatedDocumentIdsAndStates); 374foreach (var changedDocumentId in changedDocumentIds) 379foreach (var relatedDocumentId in relatedDocumentIds) 624protected virtual void OnDocumentClosing(DocumentId documentId) 682protected internal virtual void ClearDocumentData(DocumentId documentId) 1076protected internal void OnDocumentRemoved(DocumentId documentId) 1095protected virtual void CheckDocumentCanBeRemoved(DocumentId documentId) 1102protected internal void OnDocumentInfoChanged(DocumentId documentId, DocumentInfo newInfo) 1140protected internal void OnDocumentTextChanged(DocumentId documentId, SourceText newText, PreservationMode mode) 1143private protected void OnDocumentTextChanged(DocumentId documentId, SourceText newText, PreservationMode mode, bool requireDocumentPresent) 1158protected internal void OnAdditionalDocumentTextChanged(DocumentId documentId, SourceText newText, PreservationMode mode) 1173protected internal void OnAnalyzerConfigDocumentTextChanged(DocumentId documentId, SourceText newText, PreservationMode mode) 1188protected internal void OnDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1194private protected void OnDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader, bool requireDocumentPresent) 1209protected internal void OnAdditionalDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1224protected internal void OnAnalyzerConfigDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1251DocumentId documentId, 1253Func<Solution, DocumentId, TextDocument?> getDocumentInSolution, 1254Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText, 1261var updatedDocumentIds = new List<DocumentId>(); 1271var documentId = data.documentId; 1307foreach (var linkedDocumentId in linkedDocumentIds) 1324foreach (var updatedDocumentId in data.updatedDocumentIds) 1332foreach (var updatedDocumentInfo in data.updatedDocumentIds) 1346protected internal void OnDocumentSourceCodeKindChanged(DocumentId documentId, SourceCodeKind sourceCodeKind) 1377protected internal void OnAdditionalDocumentRemoved(DocumentId documentId) 1416protected internal void OnAnalyzerConfigDocumentRemoved(DocumentId documentId) 1621using var _1 = PooledHashSet<DocumentId>.GetInstance(out var infoChangedDocumentIds); 1625foreach (var docId in projectChange.GetChangedDocuments()) 1755foreach (var documentId in changedDocumentIds) 1919foreach (var documentId in projectChanges.GetRemovedDocuments()) 1925foreach (var documentId in projectChanges.GetRemovedAdditionalDocuments()) 1931foreach (var documentId in projectChanges.GetRemovedAnalyzerConfigDocuments()) 1937foreach (var documentId in projectChanges.GetAddedDocuments()) 1946foreach (var documentId in projectChanges.GetAddedAdditionalDocuments()) 1955foreach (var documentId in projectChanges.GetAddedAnalyzerConfigDocuments()) 1964foreach (var documentId in projectChanges.GetChangedDocuments()) 1970foreach (var documentId in projectChanges.GetChangedAdditionalDocuments()) 1980foreach (var documentId in projectChanges.GetChangedAnalyzerConfigDocuments()) 1991ProjectChanges projectChanges, DocumentId documentId) 2217protected virtual void ApplyDocumentRemoved(DocumentId documentId) 2228protected virtual void ApplyDocumentTextChanged(DocumentId id, SourceText text) 2239protected virtual void ApplyDocumentInfoChanged(DocumentId id, DocumentInfo info) 2261protected virtual void ApplyAdditionalDocumentRemoved(DocumentId documentId) 2272protected virtual void ApplyAdditionalDocumentTextChanged(DocumentId id, SourceText text) 2294protected virtual void ApplyAnalyzerConfigDocumentRemoved(DocumentId documentId) 2305protected virtual void ApplyAnalyzerConfigDocumentTextChanged(DocumentId id, SourceText text) 2469protected void CheckDocumentIsInCurrentSolution(DocumentId documentId) 2472private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId) 2485protected void CheckAdditionalDocumentIsInCurrentSolution(DocumentId documentId) 2488private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId) 2501protected void CheckAnalyzerConfigDocumentIsInCurrentSolution(DocumentId documentId) 2504private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId) 2517protected void CheckDocumentIsNotInCurrentSolution(DocumentId documentId) 2530protected void CheckAdditionalDocumentIsNotInCurrentSolution(DocumentId documentId) 2533private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId) 2546protected void CheckAnalyzerConfigDocumentIsNotInCurrentSolution(DocumentId documentId) 2549private static void CheckAnalyzerConfigDocumentIsNotInSolution(Solution solution, DocumentId documentId) 2572protected virtual string GetDocumentName(DocumentId documentId) 2582protected virtual string GetAdditionalDocumentName(DocumentId documentId) 2588protected 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)
66protected Task RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId projectId = null, DocumentId documentId = null) 264protected 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)
387protected override void ApplyDocumentTextChanged(DocumentId documentId, SourceText text) 405protected override void ApplyAdditionalDocumentTextChanged(DocumentId documentId, SourceText text) 489private void SaveDocumentText(DocumentId id, string fullPath, SourceText newText, Encoding encoding) 511protected override void ApplyDocumentRemoved(DocumentId documentId) 524private void DeleteDocumentFile(DocumentId documentId, string fullPath)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
2154var newDocId = DocumentId.CreateNewId(project.Id); 2191workspace.TryApplyChanges(workspace.CurrentSolution.AddAdditionalDocument(DocumentId.CreateNewId(csProjectId), "foo.xaml", SourceText.From("<foo></foo>")));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (49)
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\TestDocumentTrackingService.cs (5)
17private DocumentId? _activeDocumentId; 19public event EventHandler<DocumentId?>? ActiveDocumentChanged; 21public void SetActiveDocument(DocumentId? newActiveDocumentId) 27public DocumentId? TryGetActiveDocument() 30public ImmutableArray<DocumentId> GetVisibleDocuments()
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)
37DocumentId? id = null,
Workspaces\TestWorkspace`1.cs (23)
174DocumentId? id = null, 278public new void OnDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) 287public void OnDocumentRemoved(DocumentId documentId, bool closeDocument = false) 297public new void OnDocumentSourceCodeKindChanged(DocumentId documentId, SourceCodeKind sourceCodeKind) 300public DocumentId? GetDocumentId(TDocument hostDocument) 312public TDocument? GetTestDocument(DocumentId documentId) 315public TDocument? GetTestAdditionalDocument(DocumentId documentId) 318public TDocument? GetTestAnalyzerConfigDocument(DocumentId documentId) 321public TestHostProject<TDocument>? GetTestProject(DocumentId documentId) 386protected override void ApplyDocumentRemoved(DocumentId documentId) 408protected override void ApplyAdditionalDocumentRemoved(DocumentId documentId) 432protected override void ApplyAnalyzerConfigDocumentRemoved(DocumentId documentId) 460internal override void SetDocumentContext(DocumentId documentId) 467internal override ValueTask TryOnDocumentClosedAsync(DocumentId documentId, CancellationToken cancellationToken) 477public override void CloseDocument(DocumentId documentId) 487public override void CloseAdditionalDocument(DocumentId documentId) 497public override void CloseAnalyzerConfigDocument(DocumentId documentId) 507public async Task CloseSourceGeneratedDocumentAsync(DocumentId documentId) 519public Task ChangeDocumentAsync(DocumentId documentId, SourceText text) 524public Task ChangeDocumentAsync(DocumentId documentId, Solution solution) 533var documentId = documentInfo.Id; 540public void ChangeAdditionalDocument(DocumentId documentId, SourceText text) 547public void ChangeAnalyzerConfigDocument(DocumentId documentId, SourceText text)
Microsoft.CodeAnalysis.Workspaces.UnitTests (339)
FindAllDeclarationsTests.cs (6)
159var submission0DocId = DocumentId.CreateNewId(submission0Id); 174var submission1DocId = DocumentId.CreateNewId(submission1Id); 702var did = DocumentId.CreateNewId(pid);
FindAllDeclarationsTests.TestSolutionsAndProject.cs (4)
99var did = DocumentId.CreateNewId(pid); 113var 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)
38var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "doc"); 74var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc"); 93var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc"); 183var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "doc");
SolutionTests\SolutionTests.cs (256)
48private static readonly DocumentId s_unrelatedDocumentId = DocumentId.CreateNewId(ProjectId.CreateNewId()); 58.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", SourceText.From("public class Goo { }", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "goo.cs")) 59.AddAdditionalDocument(DocumentId.CreateNewId(projectId), "add.txt", SourceText.From("text", Encoding.UTF8, SourceHashAlgorithms.Default)) 60.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From(editorConfig ?? "#empty", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg")))); 80.AddDocument(DocumentId.CreateNewId(projectId1), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs") 81.AddAdditionalDocument(DocumentId.CreateNewId(projectId1), "add.txt", SourceText.From("text", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "add.txt") 82.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId1), "editorcfg", SourceText.From("config", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "/a/b") 84.AddDocument(DocumentId.CreateNewId(projectId2), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs") 85.AddAdditionalDocument(DocumentId.CreateNewId(projectId2), "add.txt", SourceText.From("text", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "add.txt") 86.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId2), "editorcfg", SourceText.From("config", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "/a/b"))); 127Assert.Throws<ArgumentNullException>(() => solution.RemoveDocuments(ImmutableArray.Create((DocumentId)null!))); 146Assert.Throws<ArgumentNullException>(() => solution.RemoveAdditionalDocuments(ImmutableArray.Create((DocumentId)null!))); 165Assert.Throws<ArgumentNullException>(() => solution.RemoveAnalyzerConfigDocuments(ImmutableArray.Create((DocumentId)null!))); 173var documentId = solution.Projects.Single().DocumentIds.Single(); 193var documentId = solution.Projects.Single().DocumentIds.Single(); 224var documentId = solution.Projects.Single().DocumentIds.Single(); 251var documentId = solution.Projects.Single().DocumentIds.Single(); 270var documentId = solution.Projects.Single().DocumentIds.Single(); 289var documentId = solution.Projects.Single().DocumentIds.Single(); 300var documentId = solution.Projects.Single().DocumentIds.Single(); 331.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", "public class Goo { }") 332.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From("config")); 346var documentId = solution.Projects.Single().DocumentIds.Single(); 362Assert.Throws<ArgumentNullException>(() => solution.WithDocumentText((DocumentId)null!, text, PreservationMode.PreserveIdentity)); 371var documentId = solution.Projects.Single().DocumentIds.Single(); 386Assert.Throws<ArgumentNullException>(() => solution.WithDocumentText((DocumentId)null!, textAndVersion, PreservationMode.PreserveIdentity)); 395var documentId = solution.Projects.Single().DocumentIds.Single(); 409Assert.Throws<ArgumentNullException>(() => solution.WithDocumentText((DocumentId[])null!, text, PreservationMode.PreserveIdentity)); 429var documentId1 = solution.Projects.First().DocumentIds.Single(); 430var documentId2 = solution.Projects.Last().DocumentIds.Single(); 494private static Solution UpdateSolution(PreservationMode mode, TextUpdateType updateType, Solution solution, DocumentId documentId1, SourceText text, TextAndVersion textAndVersion) 517var documentId1 = solution.Projects.First().DocumentIds.Single(); 518var documentId2 = solution.Projects.Last().DocumentIds.Single(); 596var documentId1 = solution.Projects.First().DocumentIds.Single(); 597var documentId2 = solution.Projects.Last().DocumentIds.Single(); 682var documentId1 = solution.Projects.First().DocumentIds.Single(); 683var documentId2 = solution.Projects.Last().DocumentIds.Single(); 759var documentId1 = solution.Projects.First().DocumentIds.Single(); 760var documentId2 = solution.Projects.Last().DocumentIds.Single(); 841.AddDocument(DocumentId.CreateNewId(projectId1), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs") 843.AddDocument(DocumentId.CreateNewId(projectId2), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs"))); 847var documentId1 = solution.Projects.First().DocumentIds.Single(); 848var documentId2 = solution.Projects.Last().DocumentIds.Single(); 917var documentId = solution.Projects.Single().AdditionalDocumentIds.Single(); 930Assert.Throws<ArgumentNullException>(() => solution.WithAdditionalDocumentText((DocumentId)null!, text, PreservationMode.PreserveIdentity)); 939var documentId = solution.Projects.Single().AdditionalDocumentIds.Single(); 954Assert.Throws<ArgumentNullException>(() => solution.WithAdditionalDocumentText((DocumentId)null!, textAndVersion, PreservationMode.PreserveIdentity)); 976Assert.Throws<ArgumentNullException>(() => solution.WithAnalyzerConfigDocumentText((DocumentId)null!, text, PreservationMode.PreserveIdentity)); 1000Assert.Throws<ArgumentNullException>(() => solution.WithAnalyzerConfigDocumentText((DocumentId)null!, textAndVersion, PreservationMode.PreserveIdentity)); 1009var documentId = solution.Projects.Single().DocumentIds.Single(); 1031var documentId = solution.Projects.Single().AdditionalDocumentIds.Single(); 1078var d1 = DocumentId.CreateNewId(projectId); 1079var d2 = DocumentId.CreateNewId(projectId); 1080var d3 = DocumentId.CreateNewId(projectId); 1081var a1 = DocumentId.CreateNewId(projectId); 1082var a2 = DocumentId.CreateNewId(projectId); 1083var a3 = DocumentId.CreateNewId(projectId); 1084var c1 = DocumentId.CreateNewId(projectId); 1085var c2 = DocumentId.CreateNewId(projectId); 1086var c3 = DocumentId.CreateNewId(projectId); 1597var documentAId = DocumentId.CreateNewId(projectId); 1598var documentBId = DocumentId.CreateNewId(projectId); 1599var documentCId = DocumentId.CreateNewId(projectId); 1600var fileDocumentId = DocumentId.CreateNewId(projectId); 1782var documentId = DocumentId.CreateNewId(projectId); 1816var documentId = DocumentId.CreateNewId(projectId); 1854var documentId = DocumentId.CreateNewId(projectId); 1873var documentId = DocumentId.CreateNewId(projectId); 1892var documentId = DocumentId.CreateNewId(projectId); 2308var editorConfigId = DocumentId.CreateNewId(solution3.Projects.Single().Id); 2364var documentId = DocumentId.CreateNewId(projectId); 2376Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", loader)); 2389var documentId = DocumentId.CreateNewId(projectId); 2407Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", "text")); 2419var documentId = DocumentId.CreateNewId(projectId); 2435Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", sourceText)); 2448var documentId = DocumentId.CreateNewId(projectId); 2464Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", syntaxRoot: root)); 2477var documentId = DocumentId.CreateNewId(projectId); 2508var documentId = DocumentId.CreateNewId(projectId); 2564var did = DocumentId.CreateNewId(pid); 2589var did2 = DocumentId.CreateNewId(pid2); 2609var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file1.cs"); 2610var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file2.cs"); 2633var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs"); 2634var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "file2.cs"); 2660var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs"); 2661var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "file2.cs"); 2685var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file1.cs"); 2686var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file2.cs"); 2706var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs"); 2707var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "file2.cs"); 2728var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs"); 2747var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.txt"); 2766var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), ".editorconfig"); 2800var doc1 = DocumentId.CreateNewId(pm1); 2801var doc2 = DocumentId.CreateNewId(pm2); 2829.AddDocument(DocumentId.CreateNewId(pm1), "goo.cs", "public class X { }") 2830.AddDocument(DocumentId.CreateNewId(pm2), "bar.vb", "Public Class Y\r\nInherits X\r\nEnd Class"); 3136var did = DocumentId.CreateNewId(pid); 3158var documentId = DocumentId.CreateNewId(projectId); 3180var did = DocumentId.CreateNewId(pid); 3218var did = DocumentId.CreateNewId(pid); 3259var documentId = DocumentId.CreateNewId(projectId); 3299var did = DocumentId.CreateNewId(pid); 3323var did = DocumentId.CreateNewId(pid); 3343var did = DocumentId.CreateNewId(pid); 3366var did = DocumentId.CreateNewId(pid); 3390var did = DocumentId.CreateNewId(pid); 3410var did = DocumentId.CreateNewId(pid); 3431var did = DocumentId.CreateNewId(pid); 3453var did = DocumentId.CreateNewId(pid); 3473var did = DocumentId.CreateNewId(pid); 3493var did = DocumentId.CreateNewId(pid); 3512var did = DocumentId.CreateNewId(pid); 3526private static ObjectReference<SourceText> GetObservedText(Solution solution, DocumentId documentId, string expectedText = null) 3543var did = DocumentId.CreateNewId(pid); 3557private static ObjectReference<SourceText> GetObservedTextAsync(Solution solution, DocumentId documentId, string expectedText = null) 3574var did = DocumentId.CreateNewId(pid); 3589private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRoot(Solution solution, DocumentId documentId) 3600var did = DocumentId.CreateNewId(pid); 3615private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRootAsync(Solution solution, DocumentId documentId) 3627var did = DocumentId.CreateNewId(pid); 3651var did = DocumentId.CreateNewId(pid); 3676private static void TestRecoverableSyntaxTree(Solution sol, DocumentId did) 3716var did = DocumentId.CreateNewId(pid); 3741var did = DocumentId.CreateNewId(pid); 3770var did = DocumentId.CreateNewId(pid); 3909var did = DocumentId.CreateNewId(pid); 3936var did1 = DocumentId.CreateNewId(pid1); 3937var did2 = DocumentId.CreateNewId(pid2); 3938var did3 = DocumentId.CreateNewId(pid3); 4369var documentId1 = DocumentId.CreateNewId(solution.ProjectIds.Single()); 4370var documentId2 = DocumentId.CreateNewId(solution.ProjectIds.Single()); 4371var documentId3 = DocumentId.CreateNewId(solution.ProjectIds.Single()); 4388var documentIdToFreeze = documentToFreeze == 1 ? documentId1 : documentToFreeze == 2 ? documentId2 : documentId3; 4583ImmutableArray<DocumentId> GetDocumentIds() => [.. solution.GetProject(pid).DocumentIds]; 4592var did1 = DocumentId.CreateNewId(pid); 4596var did2 = DocumentId.CreateNewId(pid); 4600var did3 = DocumentId.CreateNewId(pid); 4604var did4 = DocumentId.CreateNewId(pid); 4608var did5 = DocumentId.CreateNewId(pid); 4656var did1 = DocumentId.CreateNewId(pid); 4660var did2 = DocumentId.CreateNewId(pid); 4664var did3 = DocumentId.CreateNewId(pid); 4668var did4 = DocumentId.CreateNewId(pid); 4672var did5 = DocumentId.CreateNewId(pid); 4677Assert.Throws<ArgumentException>(() => solution = solution.WithProjectDocumentsOrder(pid, ImmutableList.Create<DocumentId>())); 4690var sourceDocumentId = DocumentId.CreateNewId(projectId); 4698var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4726var sourceDocumentId = DocumentId.CreateNewId(projectId); 4731var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4767var sourceDocumentId = DocumentId.CreateNewId(projectId); 4772var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4812var sourceDocumentId = DocumentId.CreateNewId(projectId); 4820var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4843var sourceDocumentId = DocumentId.CreateNewId(projectId); 4866var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 4894var documentId = DocumentId.CreateNewId(projectId); 4914var documentId = DocumentId.CreateNewId(projectId); 4916var solution = workspace.CurrentSolution 4935var documentId = DocumentId.CreateNewId(projectId); 4953var editorConfigDocumentId = DocumentId.CreateNewId(projectId); 5456var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version))); 5495var documentId = solution.Projects.Single().DocumentIds.Single(); 5546var documentId = DocumentId.CreateNewId(projectId); 5551.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), ".editorconfig", SourceText.From($"[{pattern}]\nindent_style = tab"), filePath: configPath); 5584var regularDocumentId = solution.Projects.Single().DocumentIds.Single(); 5840var documentId1 = project1.DocumentIds.Single(); 5850var documentId2 = project2.DocumentIds.Single();
SolutionTests\SolutionWithSourceGeneratorTests.cs (6)
258var documentId = project.DocumentIds.Single(); 266static async Task AssertCompilationContainsOneRegularAndOneGeneratedFile(Project project, DocumentId documentId, string expectedGeneratedContents) 300var additionalDocumentId = project.AdditionalDocumentIds.Single(); 820foreach (var documentIdToTest in documentIdsToTest) 848DocumentId.CreateNewId(project.Id), 1297var documentId = Assert.Single(changes.GetExplicitlyChangedSourceGeneratedDocuments());
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)
35var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 75var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 115var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 155var referenceDocumentInfo = DocumentInfo.Create(DocumentId.CreateNewId(referenceProject.Id), "code.cs"); 159var 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.MetadataExtractor.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 (152)
CallHierarchy\CallHierarchyDetail.cs (1)
21private readonly DocumentId _documentId;
CallHierarchy\Finders\AbstractCallFinder.cs (1)
121var activeDocument = documentTrackingService.TryGetActiveDocument();
CodeCleanup\AbstractCodeCleanUpFixer.cs (1)
204var 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)
41public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, 66public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 87public async Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 112public async Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 143var referencedDocumentId = DocumentId.CreateFromSerialized( 252private static async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsWorkerAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
DebuggerIntelliSense\AbstractDebuggerIntelliSenseContext.cs (2)
158foreach (var link in document.GetLinkedDocumentIds()) 167foreach (var link in document.GetLinkedDocumentIds())
DebuggerIntelliSense\DebuggerIntellisenseWorkspace.cs (1)
18public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer)
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
153using 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)
19DocumentId 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)
323var 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, 168private Dictionary<IVsHierarchy, List<uint>> GetHierarchiesAndItemIDsFromDocumentIDs(VisualStudioWorkspace visualStudioWorkspace, IEnumerable<DocumentId> changedDocumentIDs) 174foreach (var documentId in changedDocumentIDs)
Library\ObjectBrowser\Extensions.cs (1)
107foreach (var documentId in project.DocumentIds)
Packaging\PackageInstallerServiceFactory.cs (1)
260DocumentId documentId,
Preview\FileChange.cs (2)
31public readonly DocumentId Id; 99private 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)
20private DocumentId? _currentDocumentId;
Preview\SpanChange.cs (2)
14private readonly DocumentId _id; 22public 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)
113dataType: typeof(DocumentId),
ProjectSystem\MiscellaneousFilesWorkspace.cs (2)
268if (_fileTrackingMetadataAsSourceService.Value.TryAddDocumentToWorkspace(moniker, textBuffer.AsTextContainer(), out var _)) 320protected 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)
290public override EnvDTE.FileCodeModel GetFileCodeModel(DocumentId documentId) 335bool CanApplyChange(DocumentId documentId) 661foreach (var changedDocumentId in projectChanges.GetChangedDocuments()) 874DocumentId documentId, 892DocumentId documentId, 975DocumentId documentId, 1002private void RemoveDocumentCore(DocumentId documentId, TextDocumentKind documentKind) 1051protected override void ApplyDocumentRemoved(DocumentId documentId) 1054protected override void ApplyAdditionalDocumentRemoved(DocumentId documentId) 1057protected override void ApplyAnalyzerConfigDocumentRemoved(DocumentId documentId) 1060public override void OpenDocument(DocumentId documentId, bool activate = true) 1063public override void OpenAdditionalDocument(DocumentId documentId, bool activate = true) 1066public override void OpenAnalyzerConfigDocument(DocumentId documentId, bool activate = true) 1069public override void CloseDocument(DocumentId documentId) 1072public override void CloseAdditionalDocument(DocumentId documentId) 1075public override void CloseAnalyzerConfigDocument(DocumentId documentId) 1078public 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)
33var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(_filePath).FirstOrDefault();
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
452var builder = ImmutableDictionary.CreateBuilder<DocumentId, List<DiagnosticData>>(); 472var latestDocumentDiagnosticsMap = filterStaleDiagnostics ? new Dictionary<DocumentId, ImmutableHashSet<DiagnosticData>>() : null;
TaskList\ProjectExternalErrorReporter.cs (4)
129private DocumentId TryGetDocumentId(string filePath) 138var documentId = TryGetDocumentId(error.bstrFileName); 221DocumentId documentId; 261DocumentId 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)
98DocumentId documentId; 112documentId = DocumentId.CreateNewId(projectId, $"{nameof(ContainedDocument)}: {filePath}");
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (1)
50var targetDocumentId = this.ContainedDocument.FindProjectDocumentIdWithItemId(itemidInsertionPoint);
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
56public 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, 225var documentIdToNavigate = documentIdsForFilePath.Contains(documentId) ? documentId : documentIdsForFilePath.First(); 243DocumentId documentId, 286IThreadingContext threadingContext, Workspace workspace, DocumentId documentId, CancellationToken cancellationToken) 409private static bool IsSecondaryBuffer(DocumentId documentId) 413DocumentId 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)
27public bool ShouldUseBaseIndentation(DocumentId documentId) 30public bool ShouldNotFormatOrCommitOnPaste(DocumentId documentId) 33private static bool IsContainedDocument(DocumentId documentId) 90public 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 (6)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (1)
319Public Function GetDiagnosticsForIdsAsync(project As Project, documentId As DocumentId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, 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)
64var 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 (42)
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 (31)
158var priorityDocumentId = solution.Projects.Single().Documents.Single().Id; 434DocumentId tempDocId; 448var tempDoc = project.AddDocument("X.cs", SourceText.From("// ")); 735var tempDocId = AddSimpleDocument(workspace, generator); 776private static DocumentId AddSimpleDocument(TestWorkspace workspace, CallbackGenerator generator) 787var tempDoc = project.AddDocument("X.cs", SourceText.From("// ")); 819var tempDocId = AddSimpleDocument(workspace, generator); 874var tempDocId = AddSimpleDocument(workspace, generator); 925var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 934var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 976var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 985var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1017var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1026var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1060var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1069var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1112var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1122var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1165var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1175var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1218var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1228var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1263var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1273var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1308var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1317var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1351var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1360var tempDoc = project2.AddDocument("X.cs", SourceText.From("// ")); 1430var normalDocId = AddSimpleDocument(workspace, new CallbackGenerator(() => ("hintName.cs", "// callCount: " + callCount++))); 1557var tempDoc = project1.AddDocument("X.cs", SourceText.From("// ")); 1611var currentDocumentId = documentIdsInProject[j];
Services\SolutionServiceTests.cs (7)
312var existingDocumentId = project.DocumentIds.First(); 331var additionalDocumentId = DocumentId.CreateNewId(projectId); 362var analyzerConfigDocumentId = DocumentId.CreateNewId(projectId); 395var documentId = DocumentId.CreateNewId(projectId);
Test.Utilities (2)
CodeMetricsTestsBase.cs (2)
55var documentId = DocumentId.CreateNewId(projectId, debugName: newFileName);