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\NavigationActionFactory.cs (1)
64var project = solution.GetRequiredProject(documentId.ProjectId);
Preview\AbstractPreviewFactoryService.cs (6)
96previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 103previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 117previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 124previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 138previewItems.Add(new SolutionPreviewItem(documentId.ProjectId, documentId, async c => 145previewItems.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)
410missingSymbols.GetOrAdd(symbol, m => []).Add(documentId.ProjectId);
Completion\Providers\SymbolCompletionItem.cs (2)
211if (supportedPlatforms != null && supportedPlatforms.InvalidProjects.Contains(document.Id.ProjectId)) 213var 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)
670documentIndicesByMappedPath.MultiAdd(document.FilePath, (documentId.ProjectId, i)); 671projectIds.Add(documentId.ProjectId);
EditAndContinue\EditAndContinueService.cs (1)
187group documentId by documentId.ProjectId into projectDocumentIds
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
238linkedProjectIds.AddRange(linkedDocumentIds.Select(d => d.ProjectId));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (5)
278var project = solution.GetRequiredProject(documentId.ProjectId); 289var oldProject = oldSolution.GetRequiredProject(documentId.ProjectId); 290var newProject = newSolution.GetRequiredProject(documentId.ProjectId); 539if (_projectOrDocumentIds.Contains(documentId.ProjectId)) 676var 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 (8)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (1)
392if (documentId.ProjectId == project.Id)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (4)
55return [documentId.ProjectId]; 60.Select(kv => kv.Key.ProjectId) 74if (documentId.ProjectId == projectId && !state.IsEmpty) 170if (_projectStates.TryGetValue(id.ProjectId, out var state))
Handler\ProjectContext\GetTextDocumentWithContextHandler.cs (1)
51var project = context.Solution.GetRequiredProject(documentId.ProjectId);
Handler\SourceGenerators\SourceGeneratorRefreshQueue.cs (1)
75var projectId = e.ProjectId ?? e.DocumentId?.ProjectId;
Workspaces\LspMiscellaneousFilesWorkspace.cs (1)
99var 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)
311if (this.Id != documentId.ProjectId) 346if (this.Id != documentId.ProjectId) 814if (documentId?.ProjectId != this.Id)
Workspace\Solution\Solution.cs (12)
238=> GetProject(documentId?.ProjectId)?.GetDocument(documentId!); 245var project = GetProject(documentId?.ProjectId); 260var project = GetProject(documentId?.ProjectId); 277return this.GetProject(documentId.ProjectId)!.GetAdditionalDocument(documentId); 290return this.GetProject(documentId.ProjectId)!.GetAnalyzerConfigDocument(documentId); 298var project = GetProject(documentId.ProjectId); 327var generatedDocument = this.GetRequiredProject(documentState.Id.ProjectId).TryGetSourceGeneratedDocumentForAlreadyGeneratedId(documentState.Id); 937var project = GetRequiredProjectState(documentId.ProjectId); 958var project = GetRequiredProjectState(documentId.ProjectId); 977var project = GetRequiredProjectState(documentId.ProjectId); 1009var project = GetRequiredProjectState(documentId.ProjectId); 1102var project = GetRequiredProjectState(documentId.ProjectId);
Workspace\Solution\SolutionCompilationState.cs (8)
803.GroupBy(static d => d.documentId.ProjectId) 1205return GetCompilationTracker(documentId.ProjectId).TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentId); 1346var projectState = this.SolutionState.GetRequiredProjectState(documentIdentity.DocumentId.ProjectId); 1363var documentStatesByProjectId = documentStates.ToDictionary(static state => state.Id.ProjectId); 1630var oldProjectState = currentState.SolutionState.GetRequiredProjectState(documentId.ProjectId); 1635missingDocumentStates.MultiAdd(documentId.ProjectId, newDocumentState); 1691var documentIdsByProjectId = documentIds.ToLookup(id => id.ProjectId); 1794var 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); 940var oldProject = GetRequiredProjectState(documentId.ProjectId); 956var oldProject = GetRequiredProjectState(documentId.ProjectId); 968var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 984var oldProject = GetRequiredProjectState(documentId.ProjectId); 1000var oldProject = GetRequiredProjectState(documentId.ProjectId); 1016var oldProject = GetRequiredProjectState(documentId.ProjectId); 1032var oldProject = GetRequiredProjectState(documentId.ProjectId); 1048var oldProject = GetRequiredProjectState(documentId.ProjectId); 1064var oldProject = GetRequiredProjectState(documentId.ProjectId); 1108var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1121var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1132var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1239Contract.ThrowIfTrue(documentId.ProjectId == relatedProjectIdHint); 1241var projectState = this.GetProjectState(documentId.ProjectId); 1292var projectState = this.GetProjectState(documentId.ProjectId); 1319var projectState = @this.GetProjectState(documentId.ProjectId);
Workspace\Workspace.cs (4)
338if (addedDocumentId.ProjectId == relatedProjectIdHint) 358Contract.ThrowIfTrue(relatedDocumentId.ProjectId == addedDocumentId.ProjectId); 360relatedProjectIdHint = 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)
167Contract.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; 5828(_, _) => (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 (26)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
126var currentProject = project.Solution.GetProject(activeDocument.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)
475foreach (var group in builder.GroupBy(kvp => kvp.Key.ProjectId))
TaskList\ProjectExternalErrorReporter.cs (1)
134.Where(f => f.ProjectId == _projectId)
Workspace\VisualStudioDocumentNavigationService.cs (1)
195var 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);