1 write to ProjectId
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\DocumentId.cs (1)
32this.ProjectId = projectId;
188 references to ProjectId
AnalyzerRunner (3)
DiagnosticAnalyzerRunner.cs (3)
126var sumOfDocumentAverages = documentPerformance.Where(x => x.Key.ProjectId == projectId).Sum(x => x.Value.EditsPerSecond); 127double documentCount = documentPerformance.Where(x => x.Key.ProjectId == projectId).Count(); 134var slowestFiles = documentPerformance.OrderBy(pair => pair.Value.EditsPerSecond).GroupBy(pair => pair.Key.ProjectId);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
174workspace.OnParseOptionsChanged(document.Id.ProjectId, 202workspace.OnParseOptionsChanged(document.Id.ProjectId,
Microsoft.CodeAnalysis.EditorFeatures (10)
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (1)
292if (args.ProjectId != documentId?.ProjectId)
EditAndContinue\ActiveStatementTrackingService.cs (1)
203solution = solution.WithUpToDateSourceGeneratorDocuments(openDocumentIds.Select(static d => d.ProjectId));
IntelliSense\Helpers.cs (1)
209var project = solution.GetRequiredProject(documentId.ProjectId);
Preview\AbstractPreviewFactoryService.cs (6)
95previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 102previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 116previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 123previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 137previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 144previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c =>
SolutionEvents\HostLegacySolutionEventsWorkspaceEventListener.cs (1)
71var projectId = e.ProjectId ?? e.DocumentId?.ProjectId;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Diagnostics\DiagnosticDataTests.cs (2)
186var project = workspace.CurrentSolution.GetRequiredProject(documentId.ProjectId); 201projectId: documentId.ProjectId,
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Suggestions\SuggestedActionWithNestedFlavors.cs (1)
159var preferredProjectId = preferredDocumentId?.ProjectId;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Diagnostics\DiagnosticProviderTests.vb (2)
313result.Add(SourceError(Id, message, documentId, documentId.ProjectId, mappedLine, originalLine, mappedColumn, originalColumn, mappedFile, originalFile)) 315result.Add(SourceWarning(Id, message, documentId, documentId.ProjectId, mappedLine, originalLine, mappedColumn, originalColumn, mappedFile, originalFile))
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
Remote\JsonSerializableDocumentId.cs (1)
19return new JsonSerializableDocumentId(documentId.ProjectId.Id, documentId.Id);
Microsoft.CodeAnalysis.Features (35)
CodeLens\CodeLensReferencesService.cs (2)
91var projectVersion = await GetProjectCodeLensVersionAsync(solution, documentId.ProjectId, cancellationToken).ConfigureAwait(false); 158documentId.ProjectId.Id,
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
406missingSymbols.GetOrAdd(symbol, m => []).Add(documentId.ProjectId);
Completion\Providers\SymbolCompletionItem.cs (2)
213if (supportedPlatforms != null && supportedPlatforms.InvalidProjects.Contains(document.Id.ProjectId)) 215var contextId = document.GetLinkedDocumentIds().FirstOrDefault(id => !supportedPlatforms.InvalidProjects.Contains(id.ProjectId));
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
125if (!solution.GetRequiredProject(priorityDocumentId.ProjectId).SupportsCompilation)
Diagnostics\CodeAnalysisDiagnosticAnalyzerService.cs (2)
141=> _clearedProjectIds.Contains(documentId.ProjectId) 143: _diagnosticAnalyzerService.GetCachedDiagnosticsAsync(_workspace, documentId.ProjectId,
EditAndContinue\CommittedSolution.cs (1)
267Debug.Assert(_solution.ContainsProject(documentId.ProjectId));
EditAndContinue\DebuggingSession.cs (2)
652documentIndicesByMappedPath.MultiAdd(document.FilePath, (documentId.ProjectId, i)); 653projectIds.Add(documentId.ProjectId);
EditAndContinue\EditAndContinueService.cs (1)
187group documentId by documentId.ProjectId into projectDocumentIds
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
240linkedProjectIds.AddRange(linkedDocumentIds.Select(d => d.ProjectId));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (5)
269var project = solution.GetRequiredProject(documentId.ProjectId); 282var oldProject = oldSolution.GetRequiredProject(documentId.ProjectId); 283var newProject = newSolution.GetRequiredProject(documentId.ProjectId); 532if (_projectOrDocumentIds.Contains(documentId.ProjectId)) 669var project = solution.GetProject(documentId.ProjectId);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncDocumentWorkItemQueue.cs (4)
25if (_documentWorkQueue.TryGetValue(key.ProjectId, out var documentMap) && 32_documentWorkQueue.Remove(key.ProjectId); 101if (_documentWorkQueue.TryGetValue(key.ProjectId, out var documentMap) && 116_documentWorkQueue.Add(key.ProjectId, documentMap);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (1)
249return $"Tick:{tick}, {documentId}, {documentId.ProjectId}, Replaced:{replaced}";
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (3)
31private static readonly Func<int, DocumentId, bool, string> s_enqueueLogger = (tick, documentId, hint) => $"Tick:{tick}, {documentId}, {documentId.ProjectId}, hint:{hint}"; 177var projectId = thisDocument.Id.ProjectId; 187await _processor.EnqueueWorkItemAsync(solution.GetRequiredProject(documentId.ProjectId), documentId, document: null).ConfigureAwait(false);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingWorkItem.cs (4)
66Debug.Assert(documentId == null || documentId.ProjectId == projectId); 83: this(documentId, documentId.ProjectId, language, invocationReasons, isLowPriority, activeMember, [], retry: false, asyncToken) 88: this(documentId, documentId.ProjectId, language, invocationReasons, isLowPriority, activeMember: null, 149DocumentId.ProjectId,
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (1)
193oldSolution, sourceDocId.ProjectId, selectedMembers, cancellationToken).ConfigureAwait(false);
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
60linkedIndices.Add((linkedIndex, linkedDocumentId.ProjectId));
QuickInfo\CommonSemanticQuickInfoProvider.cs (2)
106candidateProjects.Add(linkedDocumentId.ProjectId); 126invalidProjects.Add(docId.ProjectId);
ValueTracking\ValueTrackingService.cs (1)
63var project = solution.GetRequiredProject(previousTrackedItem.DocumentId.ProjectId);
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (1)
378if (documentId.ProjectId == project.Id)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (4)
53return [documentId.ProjectId]; 58.Select(kv => kv.Key.ProjectId) 72if (documentId.ProjectId == projectId && !state.IsEmpty) 168if (_projectStates.TryGetValue(id.ProjectId, out var state))
Handler\ProjectContext\GetTextDocumentWithContextHandler.cs (1)
51var project = context.Solution.GetRequiredProject(documentId.ProjectId);
Workspaces\LspMiscellaneousFilesWorkspace.cs (1)
100var project = CurrentSolution.GetRequiredProject(matchingDocument.ProjectId);
Microsoft.CodeAnalysis.Remote.ServiceHub (4)
Services\CodeLensReferences\RemoteCodeLensReferencesService.cs (4)
45using (Logger.LogBlock(FunctionId.CodeAnalysisService_GetReferenceCountAsync, documentId.ProjectId.DebugName, cancellationToken)) 68using (Logger.LogBlock(FunctionId.CodeAnalysisService_FindReferenceLocationsAsync, documentId.ProjectId.DebugName, cancellationToken)) 86using (Logger.LogBlock(FunctionId.CodeAnalysisService_FindReferenceMethodsAsync, documentId.ProjectId.DebugName, cancellationToken)) 106using (Logger.LogBlock(FunctionId.CodeAnalysisService_GetFullyQualifiedName, documentId.ProjectId.DebugName, cancellationToken))
Microsoft.CodeAnalysis.Workspaces (74)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
70foreach (var group in docIdToTextMerger.GroupBy(kvp => kvp.Key.ProjectId))
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
105.GroupBy(d => d.ProjectId) 437if (_documentIdOfRenameSymbolDeclaration.ProjectId == projectId)
Rename\Renamer.RenameDocumentActionSet.cs (1)
140var project = solution.GetRequiredProject(_documentId.ProjectId);
Rename\RenameUtilities.cs (1)
95.Select(d => d.ProjectId).Distinct();
Shared\Extensions\ProjectExtensions.cs (1)
32=> project.Solution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(id => id.ProjectId == project.Id);
Workspace\ProjectSystem\SolutionChangeAccumulator.cs (2)
48WorkspaceChangeProjectId = documentId.ProjectId; 55if (documentId.ProjectId == WorkspaceChangeProjectId)
Workspace\Solution\AssetPath.cs (1)
52: this(kind, documentId?.ProjectId, documentId)
Workspace\Solution\DocumentId.cs (4)
77this.ProjectId == other.ProjectId; 81=> Hash.Combine(this.ProjectId, this.Id.GetHashCode()); 91this.ProjectId.WriteTo(writer);
Workspace\Solution\Project.cs (3)
306if (this.Id != documentId.ProjectId) 341if (this.Id != documentId.ProjectId) 800if (documentId?.ProjectId != this.Id)
Workspace\Solution\Solution.cs (12)
237=> GetProject(documentId?.ProjectId)?.GetDocument(documentId!); 244var project = GetProject(documentId?.ProjectId); 259var project = GetProject(documentId?.ProjectId); 276return this.GetProject(documentId.ProjectId)!.GetAdditionalDocument(documentId); 289return this.GetProject(documentId.ProjectId)!.GetAnalyzerConfigDocument(documentId); 297var project = GetProject(documentId.ProjectId); 326var generatedDocument = this.GetRequiredProject(documentState.Id.ProjectId).TryGetSourceGeneratedDocumentForAlreadyGeneratedId(documentState.Id); 916var project = GetRequiredProjectState(documentId.ProjectId); 937var project = GetRequiredProjectState(documentId.ProjectId); 956var project = GetRequiredProjectState(documentId.ProjectId); 988var project = GetRequiredProjectState(documentId.ProjectId); 1081var project = GetRequiredProjectState(documentId.ProjectId);
Workspace\Solution\SolutionCompilationState.cs (8)
814.GroupBy(static d => d.documentId.ProjectId) 1216return GetCompilationTracker(documentId.ProjectId).TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentId); 1357var projectState = this.SolutionState.GetRequiredProjectState(documentIdentity.DocumentId.ProjectId); 1374var documentStatesByProjectId = documentStates.ToDictionary(static state => state.Id.ProjectId); 1613var oldProjectState = currentState.SolutionState.GetRequiredProjectState(documentId.ProjectId); 1618missingDocumentStates.MultiAdd(documentId.ProjectId, newDocumentState); 1674var documentIdsByProjectId = documentIds.ToLookup(id => id.ProjectId); 1777var documentState = this.SolutionState.GetProjectState(documentId.ProjectId)?.DocumentStates.GetState(documentId);
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (5)
21if (documentId != null && (projectId == null || documentId.ProjectId == projectId)) 24var projectState = this.SolutionState.GetProjectState(documentId.ProjectId); 96else if (documentId.ProjectId != projectId) 101$"Syntax tree for a body symbol should map to the same project as the body symbol's assembly:\r\n{symbol.Kind}\r\n{symbol.Name}\r\n{syntaxTree.FilePath}\r\n{projectId}\r\n{documentId.ProjectId}"); 184return new OriginatingProjectInfo(document.Id.ProjectId, Compilation: null, ReferencedThrough: null);
Workspace\Solution\SolutionState.cs (25)
275this.ContainsProject(documentId.ProjectId) && 276this.GetProjectState(documentId.ProjectId)!.DocumentStates.Contains(documentId); 286this.ContainsProject(documentId.ProjectId) && 287this.GetProjectState(documentId.ProjectId)!.AdditionalDocumentStates.Contains(documentId); 297this.ContainsProject(documentId.ProjectId) && 298this.GetProjectState(documentId.ProjectId)!.AnalyzerConfigDocumentStates.Contains(documentId); 302=> GetRequiredProjectState(documentId.ProjectId).DocumentStates.GetRequiredState(documentId); 305=> GetRequiredProjectState(documentId.ProjectId).AdditionalDocumentStates.GetRequiredState(documentId); 308=> GetRequiredProjectState(documentId.ProjectId).AnalyzerConfigDocumentStates.GetRequiredState(documentId); 957var oldProject = GetRequiredProjectState(documentId.ProjectId); 973var oldProject = GetRequiredProjectState(documentId.ProjectId); 985var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1001var oldProject = GetRequiredProjectState(documentId.ProjectId); 1017var oldProject = GetRequiredProjectState(documentId.ProjectId); 1033var oldProject = GetRequiredProjectState(documentId.ProjectId); 1049var oldProject = GetRequiredProjectState(documentId.ProjectId); 1065var oldProject = GetRequiredProjectState(documentId.ProjectId); 1081var oldProject = GetRequiredProjectState(documentId.ProjectId); 1125var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1138var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1149var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1259Contract.ThrowIfTrue(documentId.ProjectId == relatedProjectIdHint); 1261var projectState = this.GetProjectState(documentId.ProjectId); 1312var projectState = this.GetProjectState(documentId.ProjectId); 1337var projectState = args.solution.GetProjectState(documentId.ProjectId);
Workspace\Workspace.cs (4)
328if (addedDocumentId.ProjectId == relatedProjectIdHint) 348Contract.ThrowIfTrue(relatedDocumentId.ProjectId == addedDocumentId.ProjectId); 350relatedProjectIdHint = relatedDocumentId.ProjectId;
Workspace\Workspace_Editor.cs (3)
88_projectToOpenDocumentsMap.MultiRemove(documentId.ProjectId, documentId); 182return _projectToOpenDocumentsMap.TryGetValue(documentId.ProjectId, out var openDocuments) && 507_projectToOpenDocumentsMap.MultiAdd(documentId.ProjectId, documentId);
Workspace\Workspace_Events.cs (1)
59projectId = documentId.ProjectId;
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildWorkspace.cs (1)
453var project = this.CurrentSolution.GetRequiredProject(info.Id.ProjectId);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (11)
Workspaces\TestHostDocument.cs (1)
166Contract.ThrowIfFalse(project.Id == this.Id.ProjectId);
Workspaces\TestWorkspace`1.cs (10)
329=> GetTestProject(documentId.ProjectId); 393var hostProject = this.GetTestProject(info.Id.ProjectId); 407var hostProject = this.GetTestProject(documentId.ProjectId); 419var hostProject = this.GetTestProject(info.Id.ProjectId); 429var hostProject = this.GetTestProject(documentId.ProjectId); 443var hostProject = this.GetTestProject(info.Id.ProjectId); 453var hostProject = this.GetTestProject(documentId.ProjectId); 549return this.RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind.DocumentChanged, oldSolution, newSolution, documentId.ProjectId, documentId); 565this.RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind.AdditionalDocumentChanged, oldSolution, newSolution, documentId.ProjectId, documentId); 572this.RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind.AnalyzerConfigDocumentChanged, oldSolution, newSolution, documentId.ProjectId, documentId);
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SolutionTests\SolutionTests.cs (2)
273var projectId = documentId.ProjectId; 5681(_, _) => (WorkspaceChangeKind.DocumentChanged, documentId1.ProjectId, documentId1));
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
112var docProjectId = documentId.ProjectId;
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
112var docProjectId = documentId.ProjectId;
Microsoft.VisualStudio.LanguageServices (27)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
126var currentProject = project.Solution.GetProject(activeDocument.ProjectId);
CodeCleanup\AbstractCodeCleanUpFixer.cs (1)
128var documentId = documentIds.FirstOrDefault(id => id.ProjectId == projectId);
CodeLens\CodeLensCallbackListener.cs (3)
93var currentProjectVersion = await service.GetProjectCodeLensVersionAsync(solution, documentId.ProjectId, cancellationToken).ConfigureAwait(false); 122var projectVersion = await service.GetProjectCodeLensVersionAsync(solution, documentId.ProjectId, cancellationToken).ConfigureAwait(false); 215if (_workspace.GetProjectGuid(candidateId.ProjectId) == projectGuid)
Extensions\VisualStudioWorkspaceImplExtensions.cs (1)
69var hierarchy = workspace.GetHierarchy(id.ProjectId);
Implementation\VsRefactorNotifyService.cs (1)
184var hierarchy = visualStudioWorkspace.GetHierarchy(documentId.ProjectId);
Packaging\PackageInstallerServiceFactory.cs (1)
274var projectId = documentId.ProjectId;
Preview\PreviewEngine.cs (1)
162var orderedChangedDocuments = changedDocuments.GroupBy(d => d.ProjectId).OrderByDescending(g => g.Count()).Flatten();
Progression\GraphBuilder.cs (1)
88var projectState = _solution.GetProjectState(docIdWithPath.ProjectId);
ProjectSystem\MiscellaneousFilesWorkspace.cs (1)
325if (projectId == documentId.ProjectId)
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
22: base(workspace, docInfo.Id.ProjectId)
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (1)
21: base(workspace, documentId.ProjectId)
ProjectSystem\VisualStudioWorkspaceImpl.cs (8)
308return _projectCodeModelFactory.Value.GetOrCreateFileCodeModel(documentId.ProjectId, document.FilePath); 772GetProjectData(info.Id.ProjectId, out _, out var project); 930if (PathUtilities.GetDirectoryName(CurrentSolution.GetProject(documentInfo.Id.ProjectId)?.FilePath) == solutionDirectory) 1011var hierarchy = this.GetHierarchy(documentId.ProjectId); 1228GetProjectData(updatedInfo.Id.ProjectId, out var _, out var dteProject); 1316return CurrentSolution.GetRequiredProject(documentId.ProjectId).Language switch 1353var hierarchy = GetHierarchy(documentId.ProjectId); 1368if (projects.Any(p => p.Id == documentId.ProjectId))
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (2)
286var activeProjectId = GetActiveContextProjectIdAndWatchHierarchies_NoLock(moniker, documentIds.Select(d => d.ProjectId), hierarchy); 287w.OnDocumentContextUpdated(documentIds.First(d => d.ProjectId == activeProjectId));
ProjectSystem\VisualStudioWorkspaceImpl_SourceGenerators.cs (1)
72foreach (var projectId in documentIds.Select(i => i.ProjectId).Distinct())
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (1)
489foreach (var group in builder.GroupBy(kvp => kvp.Key.ProjectId))
TaskList\ProjectExternalErrorReporter.cs (1)
134.Where(f => f.ProjectId == _projectId)
Workspace\VisualStudioDocumentNavigationService.cs (1)
190var project = solution.GetProject(documentId.ProjectId);
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Client\RemoteLanguageServiceWorkspace.cs (1)
370if (CurrentSolution.ContainsProject(id.ProjectId))
Microsoft.VisualStudio.LanguageServices.Xaml (3)
Implementation\LanguageServer\Handler\Completion\CompletionHandler.cs (1)
97Data = new CompletionResolveData { ProjectGuid = documentId.ProjectId.Id, DocumentGuid = documentId.Id, Position = position, DisplayText = xamlCompletion.DisplayText }
Implementation\XamlProjectService.cs (2)
165var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath).Single(d => d.ProjectId == project.Id); 255var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(newMoniker).Single(d => d.ProjectId == project.Id);