1 write to ProjectId
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\DocumentId.cs (1)
32this.ProjectId = projectId;
186 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)
173workspace.OnParseOptionsChanged(document.Id.ProjectId, 201workspace.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)
72var projectId = e.ProjectId ?? e.DocumentId?.ProjectId;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Diagnostics\DiagnosticDataTests.cs (2)
223var project = workspace.CurrentSolution.GetRequiredProject(documentId.ProjectId); 238projectId: documentId.ProjectId,
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Suggestions\SuggestedActionWithNestedFlavors.cs (1)
158var preferredProjectId = preferredDocumentId?.ProjectId;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Diagnostics\DiagnosticProviderTests.vb (2)
317result.Add(SourceError(Id, message, documentId, documentId.ProjectId, mappedLine, originalLine, mappedColumn, originalColumn, mappedFile, originalFile)) 319result.Add(SourceWarning(Id, message, documentId, documentId.ProjectId, mappedLine, originalLine, mappedColumn, originalColumn, mappedFile, originalFile))
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
src\Tools\ExternalAccess\Razor\Shared\Remote\JsonSerializableDocumentId.cs (1)
19return new JsonSerializableDocumentId(documentId.ProjectId.Id, documentId.Id);
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
src\Tools\ExternalAccess\Razor\Shared\Remote\JsonSerializableDocumentId.cs (1)
19return new JsonSerializableDocumentId(documentId.ProjectId.Id, documentId.Id);
Microsoft.CodeAnalysis.Features (34)
CodeLens\CodeLensReferencesService.cs (2)
91var projectVersion = await GetProjectCodeLensVersionAsync(solution, documentId.ProjectId, cancellationToken).ConfigureAwait(false); 158documentId.ProjectId.Id,
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
462missingSymbols.GetOrAdd(symbol, m => ArrayBuilder<ProjectId>.GetInstance()).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)
125if (_clearedProjectIds.Contains(documentId.ProjectId)) 128if (!_analyzedProjectToDiagnostics.TryGetValue(documentId.ProjectId, out var diagnostics))
EditAndContinue\CommittedSolution.cs (1)
267Debug.Assert(_solution.ContainsProject(documentId.ProjectId));
EditAndContinue\DebuggingSession.cs (2)
699documentIndicesByMappedPath.MultiAdd(document.FilePath, (documentId.ProjectId, i)); 700projectIds.Add(documentId.ProjectId);
EditAndContinue\EditAndContinueService.cs (1)
186group documentId by documentId.ProjectId into projectDocumentIds
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
238linkedProjectIds.AddRange(linkedDocumentIds.Select(d => d.ProjectId));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (5)
277var project = solution.GetRequiredProject(documentId.ProjectId); 288var oldProject = oldSolution.GetRequiredProject(documentId.ProjectId); 289var newProject = newSolution.GetRequiredProject(documentId.ProjectId); 533if (_projectOrDocumentIds.Contains(documentId.ProjectId)) 670var 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 (1)
127invalidProjects.Add(docId.ProjectId);
ValueTracking\ValueTrackingService.cs (1)
63var project = solution.GetRequiredProject(previousTrackedItem.DocumentId.ProjectId);
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (1)
199if (documentId.ProjectId == project.Id)
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.PublicApiAnalyzers.CodeFixes (1)
PublicApiFixHelpers.cs (1)
33return $"{ApiDocEquivalenceKeyPrefix};{doc.ProjectId.Id};{doc.Id};{isPublic}";
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 (76)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
69foreach (var group in docIdToTextMerger.GroupBy(kvp => kvp.Key.ProjectId))
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
104.GroupBy(d => d.ProjectId) 433if (_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);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
81var project = solution.GetRequiredProject(documentId.ProjectId);
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) 345if (this.Id != documentId.ProjectId) 785if (documentId?.ProjectId != this.Id)
Workspace\Solution\Solution.cs (13)
246=> GetProject(documentId?.ProjectId)?.GetDocument(documentId!); 253var project = GetProject(documentId?.ProjectId); 268var project = GetProject(documentId?.ProjectId); 285return this.GetProject(documentId.ProjectId)!.GetAdditionalDocument(documentId); 298return this.GetProject(documentId.ProjectId)!.GetAnalyzerConfigDocument(documentId); 306var project = GetProject(documentId.ProjectId); 335var generatedDocument = this.GetRequiredProject(documentState.Id.ProjectId).TryGetSourceGeneratedDocumentForAlreadyGeneratedId(documentState.Id); 945var project = GetRequiredProjectState(documentId.ProjectId); 966var project = GetRequiredProjectState(documentId.ProjectId); 985var project = GetRequiredProjectState(documentId.ProjectId); 1017var project = GetRequiredProjectState(documentId.ProjectId); 1110var project = GetRequiredProjectState(documentId.ProjectId); 1767var project = this.GetProject(documentId.ProjectId);
Workspace\Solution\SolutionCompilationState.cs (8)
839.GroupBy(static d => d.documentId.ProjectId) 1272return GetCompilationTracker(documentId.ProjectId).TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentId); 1420var projectState = this.SolutionState.GetRequiredProjectState(documentIdentity.DocumentId.ProjectId); 1450var documentStatesByProjectId = documentStates.Values.ToMultiDictionary(static state => state.Id.ProjectId); 1730var oldProjectState = currentState.SolutionState.GetRequiredProjectState(documentId.ProjectId); 1735missingDocumentStates.MultiAdd(documentId.ProjectId, newDocumentState); 1791var documentIdsByProjectId = documentIds.ToLookup(id => id.ProjectId); 1894var 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)
285this.ContainsProject(documentId.ProjectId) && 286this.GetProjectState(documentId.ProjectId)!.DocumentStates.Contains(documentId); 296this.ContainsProject(documentId.ProjectId) && 297this.GetProjectState(documentId.ProjectId)!.AdditionalDocumentStates.Contains(documentId); 307this.ContainsProject(documentId.ProjectId) && 308this.GetProjectState(documentId.ProjectId)!.AnalyzerConfigDocumentStates.Contains(documentId); 312=> GetRequiredProjectState(documentId.ProjectId).DocumentStates.GetRequiredState(documentId); 315=> GetRequiredProjectState(documentId.ProjectId).AdditionalDocumentStates.GetRequiredState(documentId); 318=> GetRequiredProjectState(documentId.ProjectId).AnalyzerConfigDocumentStates.GetRequiredState(documentId); 959var oldProject = GetRequiredProjectState(documentId.ProjectId); 975var oldProject = GetRequiredProjectState(documentId.ProjectId); 987var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1003var oldProject = GetRequiredProjectState(documentId.ProjectId); 1019var oldProject = GetRequiredProjectState(documentId.ProjectId); 1035var oldProject = GetRequiredProjectState(documentId.ProjectId); 1051var oldProject = GetRequiredProjectState(documentId.ProjectId); 1067var oldProject = GetRequiredProjectState(documentId.ProjectId); 1083var oldProject = GetRequiredProjectState(documentId.ProjectId); 1127var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1140var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1151var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1254Contract.ThrowIfTrue(documentId.ProjectId == relatedProjectIdHint); 1256var projectState = this.GetProjectState(documentId.ProjectId); 1307var projectState = this.GetProjectState(documentId.ProjectId); 1334var projectState = @this.GetProjectState(documentId.ProjectId);
Workspace\Workspace.cs (4)
336if (addedDocumentId.ProjectId == relatedProjectIdHint) 356Contract.ThrowIfTrue(relatedDocumentId.ProjectId == addedDocumentId.ProjectId); 358relatedProjectIdHint = 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)
80projectId = documentId.ProjectId;
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildWorkspace.cs (1)
455var 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)
322=> GetTestProject(documentId.ProjectId); 374var hostProject = this.GetTestProject(info.Id.ProjectId); 388var hostProject = this.GetTestProject(documentId.ProjectId); 400var hostProject = this.GetTestProject(info.Id.ProjectId); 410var hostProject = this.GetTestProject(documentId.ProjectId); 424var hostProject = this.GetTestProject(info.Id.ProjectId); 434var hostProject = this.GetTestProject(documentId.ProjectId); 528return this.RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind.DocumentChanged, oldSolution, newSolution, documentId.ProjectId, documentId); 544this.RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind.AdditionalDocumentChanged, oldSolution, newSolution, documentId.ProjectId, documentId); 551this.RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind.AnalyzerConfigDocumentChanged, oldSolution, newSolution, documentId.ProjectId, documentId);
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SolutionTests\SolutionTests.cs (2)
271var projectId = documentId.ProjectId; 5861(_, _) => (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 (25)
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)
176var hierarchy = visualStudioWorkspace.GetHierarchy(documentId.ProjectId);
Packaging\PackageInstallerServiceFactory.cs (1)
275var 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)
324if (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)
309return _projectCodeModelFactory.Value.GetOrCreateFileCodeModel(documentId.ProjectId, document.FilePath!); 773GetProjectData(info.Id.ProjectId, out _, out var project); 931if (PathUtilities.GetDirectoryName(CurrentSolution.GetProject(documentInfo.Id.ProjectId)?.FilePath) == solutionDirectory) 1012var 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)
473foreach (var group in builder.GroupBy(kvp => kvp.Key.ProjectId))
TaskList\ProjectExternalErrorReporter.cs (1)
132.Where(f => f.ProjectId == _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);