2 instantiations of ProjectId
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\Solution\ProjectId.cs (2)
57=> new(Guid.NewGuid(), debugName); 66return new ProjectId(id, debugName);
2063 references to ProjectId
AnalyzerRunner (11)
DiagnosticAnalyzerRunner.cs (10)
43foreach (var projectId in solution.ProjectIds) 103var projectPerformance = new Dictionary<ProjectId, double>(); 105foreach (var projectId in solution.ProjectIds) 146foreach (var projectId in solution.ProjectIds) 200private static void WriteDiagnosticResults(ImmutableArray<Tuple<ProjectId, Diagnostic>> diagnostics, string fileName) 314private static async Task<ImmutableDictionary<ProjectId, AnalysisResult>> GetAnalysisResultAsync( 320var projectDiagnosticBuilder = ImmutableDictionary.CreateBuilder<ProjectId, AnalysisResult>(); 324var projectDiagnosticTasks = new List<KeyValuePair<ProjectId, Task<AnalysisResult>>>(); 345projectDiagnosticTasks.Add(new KeyValuePair<ProjectId, Task<AnalysisResult>>(project.Id, resultTask)); 407internal static void WriteTelemetry(ImmutableDictionary<ProjectId, AnalysisResult> dictionary)
Program.cs (1)
140foreach (var projectId in projectIds)
IdeCoreBenchmarks (8)
FormatterBenchmarks.cs (2)
46var projectId = ProjectId.CreateNewId();
ProjectOperationBenchmarks.cs (2)
65var projectId = ProjectId.CreateNewId(name);
RenameBenchmarks.cs (2)
40var projectId = ProjectId.CreateNewId();
SwitchStatementBenchmarks.cs (2)
62var projectId = ProjectId.CreateNewId();
Microsoft.AspNetCore.Analyzer.Testing (5)
DiagnosticProject.cs (3)
40var projectId = ProjectId.CreateNewId(debugName: TestProjectName); 67var testProject = solution.ProjectIds.Single();
DiagnosticVerifier.cs (2)
158var projectId = ProjectId.CreateNewId(debugName: TestProjectName);
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Helpers\DiagnosticVerifier.Helper.cs (2)
149var projectId = ProjectId.CreateNewId(debugName: TestProjectName);
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Helpers\DiagnosticVerifier.Helper.cs (2)
149var projectId = ProjectId.CreateNewId(debugName: TestProjectName);
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
79foreach (var projectId in solution.Projects.Select(p => p.Id))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
38public static Project GetRequiredProject(this Solution solution, ProjectId projectId)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
src\Features\DiagnosticsTestUtilities\CodeActions\SharedVerifierState.cs (1)
33private Func<Solution, ProjectId, Solution>? _remainingOptionsSolutionTransform;
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceTests.cs (1)
989foreach (var id in solution.ProjectIds)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (42)
CodeActions\AddUsing\AddUsingNuGetTests.cs (18)
56installerServiceMock.Setup(i => i.IsEnabled(It.IsAny<ProjectId>())).Returns(true); 57installerServiceMock.Setup(i => i.IsInstalled(It.IsAny<ProjectId>(), "NuGetPackage")).Returns(false); 93installerServiceMock.Setup(i => i.IsEnabled(It.IsAny<ProjectId>())).Returns(true); 94installerServiceMock.Setup(i => i.IsInstalled(It.IsAny<ProjectId>(), "NuGetPackage")).Returns(false); 128installerServiceMock.Setup(i => i.IsEnabled(It.IsAny<ProjectId>())).Returns(true); 129installerServiceMock.Setup(i => i.IsInstalled(It.IsAny<ProjectId>(), "NuGetPackage")).Returns(false); 163installerServiceMock.Setup(i => i.IsEnabled(It.IsAny<ProjectId>())).Returns(true); 164installerServiceMock.Setup(i => i.IsInstalled(It.IsAny<ProjectId>(), "NuGetPackage")).Returns(false); 198installerServiceMock.Setup(i => i.IsEnabled(It.IsAny<ProjectId>())).Returns(true); 200installerServiceMock.Setup(s => s.IsInstalled(It.IsAny<ProjectId>(), "NuGetPackage")) 223installerServiceMock.Setup(i => i.IsEnabled(It.IsAny<ProjectId>())).Returns(true); 224installerServiceMock.Setup(i => i.IsInstalled(It.IsAny<ProjectId>(), "NuGetPackage")).Returns(false); 274installerServiceMock.Setup(i => i.IsEnabled(It.IsAny<ProjectId>())).Returns(true); 275installerServiceMock.Setup(i => i.IsInstalled(It.IsAny<ProjectId>(), "NuGetPackage")).Returns(false); 310installerServiceMock.Setup(i => i.IsEnabled(It.IsAny<ProjectId>())).Returns(true); 311installerServiceMock.Setup(i => i.IsInstalled(It.IsAny<ProjectId>(), "NuGetPackage")).Returns(false); 347installerServiceMock.Setup(i => i.IsEnabled(It.IsAny<ProjectId>())).Returns(true); 348installerServiceMock.Setup(i => i.IsInstalled(It.IsAny<ProjectId>(), "NuGetPackage")).Returns(false);
CodeActions\PreviewTests.cs (2)
35private static readonly ProjectId s_addedProjectId = ProjectId.CreateNewId();
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (2)
35var projectId = ProjectId.CreateNewId();
ExtractMethod\ExtractMethodTests.cs (2)
11482var projectId = ProjectId.CreateNewId();
SymbolKey\SymbolKeyTests.cs (3)
304(ProjectId bodyLocalProjectId, ProjectId referenceAssemblyProjectId) GetOriginatingProjectIds(Solution solution, ISymbol bodyLocalSymbol, ISymbol referenceAssemblySymbol) 307ProjectId bodyLocalProjectId, referenceAssemblyProjectId;
Workspaces\WorkspaceTests_EditorFeatures.cs (15)
286var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 287var id2 = snapshot.Projects.First(p => p.Name == project2.Name).Id; 325var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 326var id2 = snapshot.Projects.First(p => p.Name == project2.Name).Id; 412var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 434var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 435var id2 = snapshot.Projects.First(p => p.Name == project2.Name).Id; 462var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 463var id2 = snapshot.Projects.First(p => p.Name == project2.Name).Id; 495var id1 = solutionY.Projects.First(p => p.Name == project1.Name).Id; 496var id2 = solutionY.Projects.First(p => p.Name == project2.Name).Id; 549var id1 = solutionY.Projects.First(p => p.Name == project1.Name).Id; 550var id2 = solutionY.Projects.First(p => p.Name == project2.Name).Id; 617var id1 = solutionY.Projects.First(p => p.Name == project1.Name).Id; 618var id2 = solutionY.Projects.First(p => p.Name == project2.Name).Id;
Microsoft.CodeAnalysis.CSharp.Features (1)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.FixAllProvider.cs (1)
43foreach (var projectId in solution.ProjectIds)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (9)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
1062var projectId = workspace.Projects[0].Id;
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (4)
41var projectId = ProjectId.CreateNewId(); 461var projectId = ProjectId.CreateNewId();
EnableNullable\EnableNullableTests.cs (3)
27private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolution = 43private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolutionFromRestoreKeyword = 59private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolutionFromDisableKeyword =
src\Analyzers\CSharp\Tests\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceTests.cs (1)
989foreach (var id in solution.ProjectIds)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\AddAttributesTests.cs (1)
29ProjectId.CreateNewId(),
CodeGeneration\AddImportsTests.cs (2)
33ProjectId.CreateNewId(), 779ProjectId.CreateNewId(),
CodeGeneration\SymbolEditorTests.cs (2)
34var pid = ProjectId.CreateNewId();
Microsoft.CodeAnalysis.EditorFeatures (21)
EditAndContinue\EditAndContinueLanguageService.cs (4)
284private async ValueTask<ImmutableArray<ProjectId>> GetProjectIdsAsync(ImmutableArray<string> projectPaths, Solution solution, CancellationToken cancellationToken) 286using var _ = ArrayBuilder<ProjectId>.GetInstance(out var projectIds); 289var projectId = solution.Projects.FirstOrDefault(project => project.FilePath == path)?.Id; 409ImmutableArray<string> GetProjectPaths(ImmutableArray<ProjectId> ids)
ExternalAccess\UnitTestGenerator\Api\WrappedAddImportFixData.cs (2)
33public ProjectId ProjectReferenceToAdd => Underlying.ProjectReferenceToAdd; 39public ProjectId PortableExecutableReferenceProjectId => Underlying.PortableExecutableReferenceProjectId;
Interactive\InteractiveSession.cs (7)
56private ProjectId? _lastSuccessfulSubmissionProjectId; 57private ProjectId? _currentSubmissionProjectId; 182ProjectId? initializationScriptProjectId = null; 209initializationScriptProjectId = ProjectId.CreateNewId(CreateNewSubmissionName()); 223_currentSubmissionProjectId = ProjectId.CreateNewId(newSubmissionProjectName); 270private Project CreateSubmissionProjectNoLock(Solution solution, ProjectId newSubmissionProjectId, ProjectId? previousSubmissionProjectId, string languageName, ImmutableArray<string> imports, ImmutableArray<MetadataReference> references)
Preview\AbstractPreviewFactoryService.cs (2)
88var projectId = projectChanges.ProjectId; 235foreach (var projectId in preservedProjectIds)
Preview\SolutionPreviewItem.cs (4)
15/// <param name="projectId"><see cref="ProjectId"/> for the <see cref="Project"/> that contains the content being visualized in the supplied <paramref name="lazyPreview"/></param> 21internal class SolutionPreviewItem(ProjectId? projectId, DocumentId? documentId, Func<CancellationToken, Task<object?>> lazyPreview) 23public readonly ProjectId? ProjectId = projectId; 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)
SolutionEvents\HostLegacySolutionEventsWorkspaceEventListener.cs (1)
71var projectId = e.ProjectId ?? e.DocumentId?.ProjectId;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (18)
Diagnostics\GenerateType\TestProjectManagementService.cs (1)
26public IList<string> GetFolders(ProjectId projectId, Workspace workspace)
Diagnostics\MockDiagnosticAnalyzerService.cs (5)
52public bool ContainsDiagnostics(Workspace workspace, ProjectId projectId) 58public Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 61public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 64public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 70public Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
LanguageServer\AbstractLanguageServerProtocolTests.cs (3)
209private protected static LSP.TextDocumentIdentifier CreateTextDocumentIdentifier(Uri uri, ProjectId? projectContext = null) 222private protected static LSP.TextDocumentPositionParams CreateTextDocumentPositionParams(LSP.Location caret, ProjectId? projectContext = null) 795internal Task RunCodeAnalysisAsync(ProjectId? projectId)
Rename\RenamerTests.cs (6)
43var projectId = ProjectId.CreateNewId(); 178var projectId = ProjectId.CreateNewId(); 217var projectId = ProjectId.CreateNewId();
Workspaces\TestAddMetadataReferenceCodeActionOperationFactoryWorkspaceService.cs (3)
24public CodeActionOperation CreateAddMetadataReferenceOperation(ProjectId projectId, AssemblyIdentity assemblyIdentity) 29public readonly ProjectId ProjectId; 32public Operation(ProjectId projectId, AssemblyIdentity assemblyIdentity)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (24)
CodeGeneration\AbstractCodeGenerationTests.cs (2)
29var projectId = ProjectId.CreateNewId();
CodeGeneration\CodeGenerationTests.cs (2)
629var projectId = ProjectId.CreateNewId();
Diagnostics\DiagnosticAnalyzerServiceTests.cs (8)
158ProjectId.CreateNewId(), 261ProjectId.CreateNewId(), 301var projectId = ProjectId.CreateNewId(); 375var projectId = ProjectId.CreateNewId(); 425var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), "CSharpProject", "CSharpProject", LanguageNames.CSharp); 885ProjectId.CreateNewId(),
EditAndContinue\EditAndContinueLanguageServiceTests.cs (2)
243var projectId = ProjectId.CreateNewId();
MetadataAsSource\AbstractMetadataAsSourceTests.cs (2)
76var projectId = ProjectId.CreateNewId();
MetadataAsSource\MetadataAsSourceTests.cs (4)
1924var projectId = ProjectId.CreateNewId(); 1938var projectId = ProjectId.CreateNewId();
SymbolFinder\DependentTypeFinderTests.cs (3)
27private static Solution AddProjectWithMetadataReferences(Solution solution, string projectName, string languageName, string code, MetadataReference metadataReference, params ProjectId[] projectReferences) 30var pid = ProjectId.CreateNewId();
TextEditor\OpenDocumentTests.cs (1)
41var projectId = workspace.AddProject($"Project{i}", LanguageNames.CSharp).Id;
Microsoft.CodeAnalysis.EditorFeatures.Wpf (3)
Peek\DefinitionPeekableItem.cs (2)
20private readonly ProjectId _projectId; 27Workspace workspace, ProjectId projectId, SymbolKey symbolKey,
Suggestions\SuggestedActionWithNestedFlavors.cs (1)
159var preferredProjectId = preferredDocumentId?.ProjectId;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (5)
Diagnostics\DiagnosticProviderTests.vb (4)
322Private Shared Function GetProjectId(workspace As EditorTestWorkspace, projectName As String) As ProjectId 334Private Shared Function SourceError(id As String, message As String, docId As DocumentId, projId As ProjectId, mappedLine As Integer, originalLine As Integer, mappedColumn As Integer, 339Private Shared Function SourceWarning(id As String, message As String, docId As DocumentId, projId As ProjectId, mappedLine As Integer, originalLine As Integer, mappedColumn As Integer, 344Private Shared Function CreateDiagnostic(id As String, message As String, severity As DiagnosticSeverity, docId As DocumentId, projId As ProjectId, mappedLine As Integer, originalLine As Integer, mappedColumn As Integer,
Simplification\ParameterSimplificationTests.vb (1)
19Dim projId = ProjectId.CreateNewId()
Microsoft.CodeAnalysis.ExternalAccess.FSharp (8)
Diagnostics\IFSharpDiagnosticAnalyzerService.cs (1)
16void Reanalyze(Workspace workspace, IEnumerable<ProjectId> projectIds = null, IEnumerable<DocumentId> documentIds = null, bool highPriority = false);
Internal\Diagnostics\FSharpDiagnosticAnalyzerService.cs (1)
28public void Reanalyze(Workspace workspace, IEnumerable<ProjectId> projectIds = null, IEnumerable<DocumentId> documentIds = null, bool highPriority = false)
LanguageServices\FSharpVisualStudioWorkspaceExtensions.cs (4)
22public static bool TryGetProjectIdByBinPath(this VisualStudioWorkspace workspace, string filePath, [NotNullWhen(true)] out ProjectId? projectId) 39public static ProjectId GetOrCreateProjectIdForPath(this VisualStudioWorkspace workspace, string filePath, string projectDisplayName) 44return workspace.CurrentSolution.Projects.FirstOrDefault(p => p.FilePath == filePath)?.Id ?? ProjectId.CreateNewId("ProjectNotFound"); 48public static string? GetProjectFilePath(this VisualStudioWorkspace workspace, ProjectId projectId)
VS\IFSharpWorkspaceProjectContextFactory.cs (2)
26ProjectId Id { get; } 130public ProjectId Id
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Workspace\OmniSharpDocumentId.cs (1)
11public static DocumentId CreateFromSerialized(ProjectId projectId, Guid id, bool isSourceGenerated, string? debugName)
Microsoft.CodeAnalysis.ExternalAccess.Razor (8)
IRazorDynamicFileInfoProvider.cs (5)
17/// <param name="projectId"><see cref="ProjectId"/> this file belongs to</param> 20Task<RazorDynamicFileInfo?> GetDynamicFileInfoAsync(ProjectId projectId, string? projectFilePath, string filePath, CancellationToken cancellationToken); 25/// <param name="projectId"><see cref="ProjectId"/> this file belongs to</param> 28Task RemoveDynamicFileInfoAsync(ProjectId projectId, string? projectFilePath, string filePath, CancellationToken cancellationToken); 31/// indicate content of a file has updated. the event argument "string" should be same as "filepath" given to <see cref="GetDynamicFileInfoAsync(ProjectId, string, string, CancellationToken)"/>
RazorDynamicFileInfoProviderWrapper.cs (2)
33public async Task<DynamicFileInfo?> GetDynamicFileInfoAsync(ProjectId projectId, string? projectFilePath, string filePath, CancellationToken cancellationToken) 57public Task RemoveDynamicFileInfoAsync(ProjectId projectId, string? projectFilePath, string filePath, CancellationToken cancellationToken)
Remote\JsonSerializableDocumentId.cs (1)
24return DocumentId.CreateFromSerialized(CodeAnalysis.ProjectId.CreateFromSerialized(serializableDocumentId.ProjectId), serializableDocumentId.Id);
Microsoft.CodeAnalysis.Features (180)
AddImport\AddImportFixData.cs (5)
22ProjectId projectReferenceToAdd = null, 67public readonly ProjectId ProjectReferenceToAdd = projectReferenceToAdd; 79public readonly ProjectId PortableExecutableReferenceProjectId = portableExecutableReferenceProjectId; 113public static AddImportFixData CreateForProjectSymbol(ImmutableArray<TextChange> textChanges, string title, ImmutableArray<string> tags, CodeActionPriority priority, ProjectId projectReferenceToAdd) 121public static AddImportFixData CreateForMetadataSymbol(ImmutableArray<TextChange> textChanges, string title, ImmutableArray<string> tags, CodeActionPriority priority, ProjectId portableExecutableReferenceProjectId, string portableExecutableReferenceFilePathToAdd)
AddImport\CodeActions\ProjectSymbolReferenceCodeAction.cs (4)
55private sealed class AddProjectReferenceCodeActionOperation(ProjectId referencingProject, ProjectId referencedProject, ApplyChangesOperation applyOperation) : CodeActionOperation 57private readonly ProjectId _referencingProject = referencingProject; 58private readonly ProjectId _referencedProject = referencedProject;
AddImport\References\MetadataSymbolReference.cs (2)
24ProjectId referenceProjectId, 27private readonly ProjectId _referenceProjectId = referenceProjectId;
AddMissingReference\AddMissingReferenceCodeAction.cs (1)
50foreach (var candidateProjectId in dependencyGraph.GetProjectsThatThisProjectTransitivelyDependsOn(project.Id))
CodeFixes\Configuration\ConfigurationUpdater.cs (1)
305foreach (var projectId in _project.Solution.ProjectIds)
CodeLens\CodeLensReferencesService.cs (1)
84public async ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken)
CodeLens\ICodeLensReferencesService.cs (1)
14ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken);
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
82private static bool DoesNotAddReference(AddImportFixData fixData, ProjectId currentProjectId)
CodeRefactorings\WorkspaceServices\IAddMetadataReferenceCodeActionOperationFactoryWorkspaceService.cs (1)
13CodeActionOperation CreateAddMetadataReferenceOperation(ProjectId projectId, AssemblyIdentity assemblyIdentity);
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (2)
271var projectId = ProjectId.CreateFromSerialized(new Guid(projectIdGuid));
Completion\Providers\AbstractSymbolCompletionProvider.cs (8)
101Dictionary<ISymbol, ArrayBuilder<ProjectId>>? invalidProjectMap, 102ImmutableArray<ProjectId> totalProjects) 200Dictionary<ISymbol, ArrayBuilder<ProjectId>>? invalidProjectMap, 201ImmutableArray<ProjectId> totalProjects) 206ArrayBuilder<ProjectId>? invalidProjects = null; 403private static Dictionary<ISymbol, ArrayBuilder<ProjectId>> FindSymbolsMissingInLinkedContexts( 407var missingSymbols = new Dictionary<ISymbol, ArrayBuilder<ProjectId>>(LinkedFilesSymbolEquivalenceComparer.Instance); 413missingSymbols.GetOrAdd(symbol, m => ArrayBuilder<ProjectId>.GetInstance()).Add(documentId.ProjectId);
Completion\Providers\CompletionUtilities.cs (1)
34using var _ = PooledHashSet<ProjectId>.GetInstance(out var projectIds);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionCacheServiceFactory.cs (3)
22private readonly ConcurrentDictionary<ProjectId, TProjectCacheEntry> _projectItemsCache = []; 68ConcurrentDictionary<ProjectId, TProjectCacheEntry> projectCache, 73public IDictionary<ProjectId, TProjectCacheEntry> ProjectItemsCache { get; } = projectCache;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
74using var _3 = PooledHashSet<ProjectId>.GetInstance(out var nonGlobalAliasedProjectReferencesSet);
Completion\Providers\ImportCompletionProvider\IImportCompletionCacheService.cs (1)
16IDictionary<ProjectId, TProject> ProjectItemsCache { get; }
Completion\Providers\ImportCompletionProvider\IRemoteExtensionMethodImportCompletionService.cs (1)
24ValueTask WarmUpCacheAsync(Checksum solutionChecksum, ProjectId projectId, CancellationToken cancellationToken);
Completion\Providers\SymbolCompletionItem.cs (2)
239invalidProjects.Split(s_projectSeperators).SelectAsArray(s => ProjectId.CreateFromSerialized(Guid.Parse(s))), 240candidateProjects.Split(s_projectSeperators).SelectAsArray(s => ProjectId.CreateFromSerialized(Guid.Parse(s))));
Contracts\EditAndContinue\ManagedHotReloadUpdate.cs (2)
15ProjectId projectId, 33public ProjectId ProjectId { get; } = projectId;
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
461var allProjects = dependentProjects.Select<ProjectId, Project>(solution.GetRequiredProject)
Diagnostics\CodeAnalysisDiagnosticAnalyzerService.cs (5)
41private readonly ConcurrentSet<ProjectId> _analyzedProjectIds = []; 50private readonly ConcurrentSet<ProjectId> _clearedProjectIds = []; 91public bool HasProjectBeenAnalyzed(ProjectId projectId) => _analyzedProjectIds.Contains(projectId); 93public async Task RunAnalysisAsync(Solution solution, ProjectId? projectId, Action<Project> onAfterProjectAnalyzed, CancellationToken cancellationToken) 151public Task<ImmutableArray<DiagnosticData>> GetLastComputedProjectDiagnosticsAsync(ProjectId projectId, CancellationToken cancellationToken)
Diagnostics\DiagnosticArguments.cs (2)
64public ProjectId ProjectId; 92ProjectId projectId,
Diagnostics\DiagnosticsUpdatedArgs.cs (4)
19public readonly ProjectId? ProjectId; 29ProjectId? projectId, 46ProjectId? projectId, 55ProjectId? projectId,
Diagnostics\ICodeAnalysisDiagnosticAnalyzerService.cs (8)
23Task RunAnalysisAsync(Solution solution, ProjectId? projectId, Action<Project> onAfterProjectAnalyzed, CancellationToken cancellationToken); 26/// Returns true if <see cref="RunAnalysisAsync(Solution, ProjectId?, Action{Project}, CancellationToken)"/> was invoked 32bool HasProjectBeenAnalyzed(ProjectId projectId); 36/// <see cref="RunAnalysisAsync(Solution, ProjectId?, Action{Project}, CancellationToken)"/> invocation on the containing project or solution. 37/// The caller is expected to check <see cref="HasProjectBeenAnalyzed(ProjectId)"/> prior to calling this method. 46/// <see cref="RunAnalysisAsync(Solution, ProjectId?, Action{Project}, CancellationToken)"/> invocation on the given project or solution. 47/// The caller is expected to check <see cref="HasProjectBeenAnalyzed(ProjectId)"/> prior to calling this method. 52Task<ImmutableArray<DiagnosticData>> GetLastComputedProjectDiagnosticsAsync(ProjectId projectId, CancellationToken cancellationToken);
Diagnostics\IDiagnosticAnalyzerService.cs (5)
49Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 58/// Note that for project case, this method returns diagnostics from all project documents as well. Use <see cref="GetProjectDiagnosticsForIdsAsync(Solution, ProjectId?, ImmutableHashSet{string}?, Func{DiagnosticAnalyzer, bool}?, bool, bool, CancellationToken)"/> 79Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocumentIds, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 98Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 167this IDiagnosticAnalyzerService service, Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
Diagnostics\IRemoteDiagnosticAnalyzerService.cs (1)
18ValueTask<ImmutableArray<DiagnosticData>> GetSourceGeneratorDiagnosticsAsync(Checksum solutionChecksum, ProjectId projectId, CancellationToken cancellationToken);
EditAndContinue\CommittedSolution.cs (2)
121public Project? GetProject(ProjectId id) 124public Project GetRequiredProject(ProjectId id)
EditAndContinue\DebuggingSession.cs (10)
48private readonly Dictionary<ProjectId, ImmutableList<ProjectBaseline>> _projectBaselines = []; 327ProjectId projectId, 481IImmutableSet<ProjectId> runningProjects, 583public void UpdateBaselines(Solution solution, ImmutableArray<ProjectId> rebuiltProjects) 597foreach (var projectId in rebuiltProjects) 618foreach (var projectId in rebuiltProjects) 641using var _1 = PooledDictionary<string, ArrayBuilder<(ProjectId, int)>>.GetInstance(out var documentIndicesByMappedPath); 642using var _2 = PooledHashSet<ProjectId>.GetInstance(out var projectIds); 878public ImmutableList<ProjectBaseline> GetProjectBaselines(ProjectId projectId) 886public bool HasProjectEmitBaseline(ProjectId projectId)
EditAndContinue\EditAndContinueService.cs (2)
224IImmutableSet<ProjectId> runningProjects, 253public void UpdateBaselines(DebuggingSessionId sessionId, Solution solution, ImmutableArray<ProjectId> rebuiltProjects)
EditAndContinue\IEditAndContinueService.cs (2)
23ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, IImmutableSet<ProjectId> runningProjects, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken); 27void UpdateBaselines(DebuggingSessionId sessionId, Solution solution, ImmutableArray<ProjectId> rebuiltProjects);
EditAndContinue\ProjectBaseline.cs (2)
10internal sealed class ProjectBaseline(Guid moduleId, ProjectId projectId, EmitBaseline emitBaseline, int generation) 13public ProjectId ProjectId { get; } = projectId;
EditAndContinue\ProjectDiagnostics.cs (1)
12internal readonly record struct ProjectDiagnostics(ProjectId ProjectId, ImmutableArray<Diagnostic> Diagnostics);
EditAndContinue\Remote\IRemoteEditAndContinueService.cs (2)
30ValueTask<EmitSolutionUpdateResults.Data> EmitSolutionUpdateAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DebuggingSessionId sessionId, IImmutableSet<ProjectId> runningProjects, CancellationToken cancellationToken); 37ValueTask UpdateBaselinesAsync(Checksum solutionInfo, DebuggingSessionId sessionId, ImmutableArray<ProjectId> rebuiltProjects, CancellationToken cancellationToken);
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (2)
59IImmutableSet<ProjectId> runningProjects, 142public async ValueTask UpdateBaselinesAsync(Solution solution, ImmutableArray<ProjectId> rebuiltProjects, CancellationToken cancellationToken)
EditAndContinue\TraceLog.cs (1)
89public static implicit operator Arg(ProjectId value) => new(value.DebugName);
Emit\ICompilationOutputsProviderService.cs (1)
11CompilationOutputs GetCompilationOutputs(ProjectId projectId);
EncapsulateField\AbstractEncapsulateFieldService.cs (3)
235var projectId = document.Project.Id; 237using var _ = PooledHashSet<ProjectId>.GetInstance(out var linkedProjectIds); 278HashSet<ProjectId> linkedProjectIds,
ExternalAccess\UnitTesting\IRemoteUnitTestingSearchService.cs (2)
16Checksum solutionChecksum, ProjectId projectId, UnitTestingSearchQuery query, CancellationToken cancellationToken); 18Checksum solutionChecksum, ProjectId projectId, UnitTestingSearchQuery query, 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)
151public static void LogWorkItemEnqueue(CountLogAggregator<object> logAggregator, ProjectId _)
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 (7)
248foreach (var projectId in solution.ProjectIds) 255private void EnqueueProjectChangedEvent(Solution oldSolution, Solution newSolution, ProjectId projectId) 267private void EnqueueFullProjectEvent(Solution solution, ProjectId projectId, UnitTestingInvocationReasons invocationReasons) 529public UnitTestingReanalyzeScope(IEnumerable<ProjectId>? projectIds = null, IEnumerable<DocumentId>? documentIds = null) 572case ProjectId projectId: 620case ProjectId projectId: 663case ProjectId projectId:
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncDocumentWorkItemQueue.cs (4)
18private readonly Dictionary<ProjectId, Dictionary<DocumentId, UnitTestingWorkItem>> _documentWorkQueue = []; 43ProjectId? preferableProjectId, 63ProjectId? preferableProjectId) 65var projectId = GetBestProjectId_NoLock(
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncProjectWorkItemQueue.cs (6)
17private sealed class UnitTestingAsyncProjectWorkItemQueue(UnitTestingSolutionCrawlerProgressReporter progressReporter) : UnitTestingAsyncWorkItemQueue<ProjectId>(progressReporter) 19private readonly Dictionary<ProjectId, UnitTestingWorkItem> _projectWorkQueue = []; 33protected override bool TryTake_NoLock(ProjectId key, out UnitTestingWorkItem workInfo) 45ProjectId? preferableProjectId, 55var projectId = GetBestProjectId_NoLock( 67var key = item.ProjectId;
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncWorkItemQueue.cs (5)
40ProjectId? preferableProjectId, 208ProjectId? preferableProjectId, 240protected static ProjectId GetBestProjectId_NoLock<T>( 241Dictionary<ProjectId, T> workQueue, 242ProjectId? projectId)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingLowPriorityProcessor.cs (2)
126var projectId = workItem.ProjectId; 197var uniqueIds = new HashSet<ProjectId>();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (2)
36private ProjectId? _currentProjectProcessing; 165private void SetProjectProcessing(ProjectId currentProject)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (10)
177var projectId = thisDocument.Id.ProjectId; 211var self = project.Id; 224foreach (var projectId in GetProjectsToAnalyze(solution, self)) 300private static IEnumerable<ProjectId> GetProjectsToAnalyze(Solution solution, ProjectId projectId) 323private static readonly Func<int, ProjectId, string> s_enqueueLogger = (t, i) => string.Format("[{0}] {1}", t, i.ToString()); 331private readonly Dictionary<ProjectId, UnitTestingData> _pendingWork = []; 361public void Enqueue(ProjectId projectId, bool needDependencyTracking = false) 439private readonly struct UnitTestingData(ProjectId projectId, bool needDependencyTracking, IAsyncToken asyncToken) 442public readonly ProjectId ProjectId = projectId;
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingWorkItem.cs (2)
23public readonly ProjectId ProjectId; 57ProjectId projectId,
ExternalAccess\VSTypeScript\Api\IVSTypeScriptDiagnosticAnalyzerService.cs (1)
17void Reanalyze(Workspace? workspace = null, IEnumerable<ProjectId>? projectIds = null, IEnumerable<DocumentId>? documentIds = null, bool highPriority = false);
ExternalAccess\VSTypeScript\VSTypeScriptDiagnosticAnalyzerService.cs (1)
22public void Reanalyze(Workspace? workspace, IEnumerable<ProjectId>? projectIds, IEnumerable<DocumentId>? documentIds, bool highPriority)
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
69var project = solution.GetProject(ProjectId.CreateFromSerialized(Guid.Parse(projectIdGuid), projectDebugName));
FindUsages\DefinitionItemFactory.cs (4)
122var metadataLocations = GetMetadataLocations(definition, solution, out var originatingProjectId); 147internal static ImmutableDictionary<string, string> WithMetadataSymbolProperties(this ImmutableDictionary<string, string> properties, ISymbol symbol, ProjectId originatingProjectId) 153internal static AssemblyLocation GetMetadataLocation(IAssemblySymbol assembly, Solution solution, out ProjectId originatingProjectId) 163internal static ImmutableArray<AssemblyLocation> GetMetadataLocations(ISymbol definition, Solution solution, out ProjectId? originatingProjectId)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
723var metadataLocation = DefinitionItemFactory.GetMetadataLocation(symbol.ContainingAssembly, solution, out var originatingProjectId);
LegacySolutionEvents\IRemoteLegacySolutionEventsAggregationService.cs (1)
24ValueTask OnWorkspaceChangedAsync(Checksum oldSolutionChecksum, Checksum newSolutionChecksum, WorkspaceChangeKind kind, ProjectId? projectId, DocumentId? documentId, CancellationToken cancellationToken);
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (3)
16public readonly ProjectId SourceProjectId; 60var projectId = ProjectId.CreateNewId();
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (2)
217ILookup<ProjectId, (ReferenceLocation location, bool isExtensionMethod)> projectToLocations, 346ProjectId projectId,
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (6)
54using var _ = ArrayBuilder<(TopLevelSyntaxTreeIndex, ProjectId)>.GetInstance(out var linkedIndices); 75ArrayBuilder<(TopLevelSyntaxTreeIndex, ProjectId)>? linkedIndices, 132ImmutableArray<ProjectId> additionalMatchingProjects) 163private static ImmutableArray<ProjectId> GetAdditionalProjectsWithMatch( 166ArrayBuilder<(TopLevelSyntaxTreeIndex, ProjectId)>? linkedIndices) 171using var result = TemporaryArray<ProjectId>.Empty;
NavigateTo\IRemoteNavigateToSearchService.cs (2)
21ValueTask SearchProjectsAsync(Checksum solutionChecksum, ImmutableArray<ProjectId> projectIds, ImmutableArray<DocumentId> priorityDocumentIds, string searchPattern, ImmutableArray<string> kinds, RemoteServiceCallbackId callbackId, CancellationToken cancellationToken); 23ValueTask SearchGeneratedDocumentsAsync(Checksum solutionChecksum, ImmutableArray<ProjectId> projectIds, string searchPattern, ImmutableArray<string> kinds, RemoteServiceCallbackId callbackId, CancellationToken cancellationToken);
NavigateTo\NavigateToSearcher.cs (1)
466using var _ = PooledHashSet<ProjectId>.GetInstance(out var allProjectIdSet);
NavigateTo\RoslynNavigateToItem.cs (2)
30ImmutableArray<ProjectId> additionalMatchingProjects, 45public readonly ImmutableArray<ProjectId> AdditionalMatchingProjects = additionalMatchingProjects;
Navigation\INavigableItem.cs (1)
90public record struct NavigableProject(string Name, ProjectId Id)
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (5)
58private readonly Dictionary<string, ProjectId> _assemblyToProjectMap = []; 65private readonly HashSet<ProjectId> _sourceLinkEnabledProjects = []; 323var projectId = ProjectId.CreateNewId(); 339SourceFileInfo?[] sourceFileInfos, Encoding encoding, ProjectId projectId, Workspace sourceWorkspace, Project sourceProject)
ProjectManagement\IProjectManagementService.cs (1)
18IList<string> GetFolders(ProjectId projectId, Workspace workspace);
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
121using var _ = ArrayBuilder<ProjectId>.GetInstance(out var invalidProjects);
SemanticSearch\SemanticSearchUtilities.cs (1)
69public static ProjectId GetQueryProjectId(Solution solution)
Shared\Utilities\ExtractTypeHelpers.cs (1)
54ProjectId projectId,
Shared\Utilities\SupportedPlatformData.cs (4)
13internal sealed class SupportedPlatformData(Solution solution, ImmutableArray<ProjectId> invalidProjects, ImmutableArray<ProjectId> candidateProjects) 18public readonly ImmutableArray<ProjectId> InvalidProjects = invalidProjects; 19public readonly ImmutableArray<ProjectId> CandidateProjects = candidateProjects;
SignatureHelp\AbstractSignatureHelpProvider.cs (1)
280using var _ = ArrayBuilder<ProjectId>.GetInstance(out var invalidProjectsForCurrentSymbol);
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
79foreach (var projectId in solution.Projects.Select(p => p.Id))
Workspace\MiscellaneousFileUtilities.cs (2)
45var projectId = ProjectId.CreateNewId(debugName: $"{workspace.GetType().Name} Files Project for {filePath}");
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
438id: ProjectId.CreateNewId(),
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
365internal static DocumentInfo CreateDesignTimeOnlyDocument(ProjectId projectId, string name = "design-time-only.cs", string path = "design-time-only.cs")
EditAndContinue\Extensions.cs (4)
58public static Project AddTestProject(this Solution solution, string projectName, out ProjectId id) 61public static Project AddTestProject(this Solution solution, string projectName, string language, out ProjectId id) 73public static Document AddTestDocument(this Solution solution, ProjectId projectId, string source, string path, out DocumentId id) 88ProjectId.CreateNewId(debugName: projectName),
EditAndContinue\MockEditAndContinueService.cs (4)
26public Func<Solution, IImmutableSet<ProjectId>, ActiveStatementSpanProvider, EmitSolutionUpdateResults>? EmitSolutionUpdateImpl; 29public Action<Solution, ImmutableArray<ProjectId>>? UpdateBaselinesImpl; 43public void UpdateBaselines(DebuggingSessionId sessionId, Solution solution, ImmutableArray<ProjectId> rebuiltProjects) 46public ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, IImmutableSet<ProjectId> runningProjects, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features.UnitTests (18)
EditAndContinue\CompileTimeSolutionProviderTests.cs (4)
28var projectId = ProjectId.CreateNewId(); 77var projectId = ProjectId.CreateNewId();
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
916var projectId = ProjectId.CreateNewId();
EditAndContinue\EditSessionActiveStatementsTests.cs (1)
174var projectId = solution.ProjectIds.Single();
EditAndContinue\EmitSolutionUpdateResultsTests.cs (3)
34private static ManagedHotReloadUpdate CreateMockUpdate(ProjectId projectId) 49private static EmitSolutionUpdateResults CreateMockResults(Solution solution, IEnumerable<ProjectId> updates, IEnumerable<ProjectId> rudeEdits)
EditAndContinue\RemoteEditAndContinueServiceTests.cs (4)
73var projectId = ProjectId.CreateNewId(); 75var inProcOnlyProjectId = ProjectId.CreateNewId();
EditAndContinue\TraceLogTests.cs (2)
19var projectId = ProjectId.CreateFromSerialized(Guid.Parse("5E40F37C-5AB3-495E-A3F2-4A244D177674"), debugName: "MyProject");
EditAndContinue\WatchHotReloadServiceTests.cs (2)
48var projectId = ProjectId.CreateNewId();
Microsoft.CodeAnalysis.LanguageServer (9)
HostWorkspace\Razor\RazorDynamicFileInfoProvider.cs (2)
54public async Task<DynamicFileInfo?> GetDynamicFileInfoAsync(ProjectId projectId, string? projectFilePath, string filePath, CancellationToken cancellationToken) 110public Task RemoveDynamicFileInfoAsync(ProjectId projectId, string? projectFilePath, string filePath, CancellationToken cancellationToken)
HostWorkspace\Razor\RazorWorkspaceListenerInitializer.cs (4)
21private HashSet<ProjectId> _projectIdWithDynamicFiles = []; 37HashSet<ProjectId> projectsToInitialize; 55foreach (var projectId in projectsToInitialize) 62internal void NotifyDynamicFile(ProjectId projectId)
LanguageServer\Handler\DebugConfiguration\ProjectTargetFrameworkManager.cs (3)
17private readonly ConcurrentDictionary<ProjectId, string?> _projectToTargetFrameworkIdentifer = new(); 25public void UpdateIdentifierForProject(ProjectId projectId, string? identifier) 30public bool IsDotnetCoreProject(ProjectId projectId)
Microsoft.CodeAnalysis.LanguageServer.Protocol (43)
Extensions\Extensions.cs (2)
123Func<T, ProjectId> projectIdGetter, 131var projectId = ProtocolConversions.ProjectContextToProjectId(vsDocumentIdentifier.ProjectContext);
Extensions\ProtocolConversions.cs (3)
799public static string ProjectIdToProjectContextId(ProjectId id) 804public static ProjectId ProjectContextToProjectId(LSP.VSProjectContext projectContext) 808return ProjectId.CreateFromSerialized(
Extensions\SourceGeneratedDocumentUri.cs (3)
58var projectIdGuidOnly = ProjectId.CreateFromSerialized(Guid.ParseExact(documentUri.Host, GuidFormat)); 59var projectId = solution.GetProject(projectIdGuidOnly)?.Id;
ExternalAccess\VSMac\AnalyzerHelper.cs (1)
11public static DiagnosticData CreateAnalyzerLoadFailureDiagnostic(AnalyzerLoadFailureEventArgs e, string fullPath, ProjectId? projectId, string? language)
Features\Diagnostics\DiagnosticAnalyzerService.cs (3)
101public Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 114Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 121Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds,
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (1)
75public static DiagnosticData CreateAnalyzerLoadFailureDiagnostic(AnalyzerLoadFailureEventArgs e, string fullPath, ProjectId? projectId, string? language)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisData.cs (3)
70public readonly ProjectId ProjectId; 87public ProjectAnalysisData(ProjectId projectId, VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 97ProjectId projectId,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (1)
72private static DiagnosticAnalysisResult GetResultOrEmpty(ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> map, DiagnosticAnalyzer analyzer, ProjectId projectId, VersionStamp version)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (2)
37public ProjectState(StateSet owner, ProjectId projectId) 300public bool OnProjectRemoved(ProjectId id)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (5)
36private ImmutableDictionary<ProjectId, ProjectAnalyzerStateSets> _projectAnalyzerStateMap; 55_projectAnalyzerStateMap = ImmutableDictionary<ProjectId, ProjectAnalyzerStateSets>.Empty; 62public IEnumerable<StateSet> GetStateSets(ProjectId projectId) 75/// Difference with <see cref="GetStateSets(ProjectId)"/> is that 114public bool OnProjectRemoved(IEnumerable<StateSet> stateSets, ProjectId projectId)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (9)
29private readonly ConcurrentDictionary<ProjectId, ProjectState> _projectStates; 38_projectStates = new ConcurrentDictionary<ProjectId, ProjectState>(concurrencyLevel: 2, capacity: 1); 41public IEnumerable<ProjectId> GetProjectsWithDiagnostics() 58return new HashSet<ProjectId>( 66public void CollectDocumentsWithDiagnostics(ProjectId projectId, HashSet<DocumentId> set) 89public bool FromBuild(ProjectId projectId) 95public bool TryGetProjectState(ProjectId projectId, [NotNullWhen(true)] out ProjectState? state) 101public ProjectState GetOrCreateProjectState(ProjectId projectId) 178public bool OnProjectRemoved(ProjectId id)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (6)
18public Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 21public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 24public Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 30ProjectId? projectId, 40protected readonly ProjectId? ProjectId = projectId ?? documentId?.ProjectId; 105ProjectId? projectId,
Handler\Diagnostics\ProjectOrDocumentId.cs (2)
25private readonly ProjectId? _projectId; 27public ProjectOrDocumentId(ProjectId projectId)
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (1)
30private readonly Dictionary<ProjectId, Checksum> _projectIdToLastComputedChecksum = [];
Handler\SourceGenerators\SourceGeneratorRefreshQueue.cs (1)
75var projectId = e.ProjectId ?? e.DocumentId?.ProjectId;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Hover\HoverTests.cs (1)
533ProjectId projectContext = null)
Microsoft.CodeAnalysis.Remote.ServiceHub (33)
Host\AssetProvider.cs (1)
184ArrayBuilder<ProjectStateChecksums> allProjectChecksums, ProjectId? projectId, bool freeArrayBuilder, CancellationToken cancellationToken)
Host\RemoteWorkspace.SolutionCreator.cs (8)
157using var _1 = PooledDictionary<ProjectId, Checksum>.GetInstance(out var oldProjectIdToChecksum); 158using var _2 = PooledDictionary<ProjectId, Checksum>.GetInstance(out var newProjectIdToChecksum); 199using var _3 = PooledDictionary<ProjectId, ProjectStateChecksums>.GetInstance(out var oldProjectIdToStateChecksums); 200using var _4 = PooledDictionary<ProjectId, ProjectStateChecksums>.GetInstance(out var newProjectIdToStateChecksums); 239Dictionary<ProjectId, ProjectStateChecksums> oldProjectIdToStateChecksums, 240Dictionary<ProjectId, ProjectStateChecksums> newProjectIdToStateChecksums, 304using var _4 = ArrayBuilder<ProjectId>.GetInstance(out var projectsToRemove); 605ProjectId? projectConeId,
Host\TestUtils.cs (4)
44ProjectId? projectConeId) 158public static async Task<Dictionary<Checksum, object>> GetAssetMapAsync(this Solution solution, ProjectId? projectConeId, CancellationToken cancellationToken) 186this Solution solution, Dictionary<Checksum, object> map, ProjectId? projectId, CancellationToken cancellationToken) 219foreach (var dep in solution.GetProjectDependencyGraph().GetProjectsThatThisProjectTransitivelyDependsOn(projectId))
Services\DependentTypeFinder\RemoteDependentTypeFinderService.cs (1)
32ImmutableArray<ProjectId> projectIdsOpt,
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (1)
77/// We use this checksum and the <see cref="ProjectId"/> of the diagnostic request as the key
Services\DiagnosticAnalyzer\RemoteDiagnosticAnalyzerService.cs (2)
55var projectId = arguments.ProjectId; 86public async ValueTask<ImmutableArray<DiagnosticData>> GetSourceGeneratorDiagnosticsAsync(Checksum solutionChecksum, ProjectId projectId, CancellationToken cancellationToken)
Services\EditAndContinue\RemoteEditAndContinueService.cs (2)
144Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DebuggingSessionId sessionId, IImmutableSet<ProjectId> runningProjects, CancellationToken cancellationToken) 203public ValueTask UpdateBaselinesAsync(Checksum solutionChecksum, DebuggingSessionId sessionId, ImmutableArray<ProjectId> rebuiltProjects, CancellationToken cancellationToken)
Services\ExtensionMethodImportCompletion\RemoteExtensionMethodImportCompletionService.cs (1)
72public ValueTask WarmUpCacheAsync(Checksum solutionChecksum, ProjectId projectId, CancellationToken cancellationToken)
Services\LegacySolutionEvents\RemoteLegacySolutionEventsAggregationService.cs (1)
44ProjectId? projectId,
Services\NavigateToSearch\RemoteNavigateToSearchService.cs (2)
67ImmutableArray<ProjectId> projectIds, 88ImmutableArray<ProjectId> projectIds,
Services\SourceGeneration\RemoteSourceGenerationService.cs (5)
35Checksum solutionChecksum, ProjectId projectId, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken) 55Checksum solutionChecksum, ProjectId projectId, ImmutableArray<DocumentId> documentIds, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken) 91ProjectId projectId, 141ProjectId projectId, 157ProjectId projectId,
Services\SymbolFinder\RemoteSymbolFinderService.cs (3)
96ProjectId projectId, 133ProjectId projectId, 163Checksum solutionChecksum, ProjectId projectId, string pattern, SymbolFilter criteria, CancellationToken cancellationToken)
Services\UnitTesting\RemoteUnitTestingSearchService.cs (2)
29ProjectId projectId, 51ProjectId projectId,
Microsoft.CodeAnalysis.Remote.Workspaces (15)
AbstractAssetProvider.cs (1)
81var projectId = projectChecksums.ProjectId;
BrokeredServiceConnection.cs (4)
198public override async ValueTask<bool> TryInvokeAsync(SolutionCompilationState compilationState, ProjectId projectId, Func<TService, Checksum, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 214public override async ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(SolutionCompilationState compilationState, ProjectId projectId, Func<TService, Checksum, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) 269public override async ValueTask<bool> TryInvokeAsync(SolutionCompilationState compilationState, ProjectId projectId, Func<TService, Checksum, RemoteServiceCallbackId, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 288public override async ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(SolutionCompilationState compilationState, ProjectId projectId, Func<TService, Checksum, RemoteServiceCallbackId, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
Serialization\MessagePackFormatters.cs (9)
44/// Specialized formatter used so we can cache and reuse <see cref="ProjectId"/> instances. This is valuable as 49internal sealed class ProjectIdFormatter : IMessagePackFormatter<ProjectId?> 58private readonly ConcurrentDictionary<Guid, ProjectId> _projectIds = new ConcurrentDictionary<Guid, ProjectId>(); 60public ProjectId? Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) 72ProjectId? projectId; 83projectId = ProjectId.CreateFromSerialized(id); 93projectId = ProjectId.CreateFromSerialized(id, debugName); 105public void Serialize(ref MessagePackWriter writer, ProjectId? value, MessagePackSerializerOptions options)
SolutionAssetStorage.cs (1)
65public async ValueTask<Scope> StoreAssetsAsync(SolutionCompilationState compilationState, ProjectId? projectId, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
26Dim pid = ProjectId.CreateNewId()
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
34ProjectId.CreateNewId(),
Microsoft.CodeAnalysis.Workspaces (687)
Diagnostics\DiagnosticAnalysisResult.cs (5)
24public readonly ProjectId ProjectId; 53private DiagnosticAnalysisResult(ProjectId projectId, VersionStamp version, ImmutableHashSet<DocumentId>? documentIds, bool isEmpty, bool fromBuild) 68ProjectId projectId, 95public static DiagnosticAnalysisResult CreateEmpty(ProjectId projectId, VersionStamp version) 108public static DiagnosticAnalysisResult CreateInitialResult(ProjectId projectId)
Diagnostics\DiagnosticData.cs (3)
30ProjectId? projectId, 67public readonly ProjectId? ProjectId = projectId; 222ProjectId? projectId,
Editing\SymbolEditor.cs (4)
117foreach (var projectId in this.GetProjectsForAssembly(symbol.ContainingAssembly)) 129private ImmutableDictionary<string, ImmutableArray<ProjectId>> _assemblyNameToProjectIdMap; 131private ImmutableArray<ProjectId> GetProjectsForAssembly(IAssemblySymbol assembly) 145private static async Task<ISymbol> GetSymbolAsync(Solution solution, ProjectId projectId, string symbolId, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Api\UnitTestingProjectExtensions.cs (1)
12public static string? GetDebugName(this ProjectId projectId)
FindSymbols\FindReferences\DependentProjectsFinder.cs (7)
198using var _1 = PooledDictionary<ProjectId, List<ProjectId>>.GetInstance(out var projectIdsToReferencingSubmissionIds); 201foreach (var projectId in solution.ProjectIds) 227using var _2 = ArrayBuilder<ProjectId>.GetInstance(out var projectIdsToProcess); 228foreach (var dependentProject in dependentProjects.Select(dp => dp.project.Id)) 231while (projectIdsToProcess.TryPop(out var toProcess)) 235foreach (var pId in submissionIds)
FindSymbols\FindReferences\DependentTypeFinder.cs (7)
398private static async Task<ISet<ProjectId>> GetProjectsThatCouldReferenceTypeAsync( 429return SpecializedCollections.EmptySet<ProjectId>(); 439private static IEnumerable<ProjectId> GetProjectsThatCouldReferenceType( 450IEnumerable<ProjectId> projectsThatCouldReferenceType) 464var order = new Dictionary<ProjectId, int>(capacity: solution.ProjectIds.Count); 469foreach (var projectId in dependencyGraph.GetTopologicallySortedProjects()) 481IEnumerable<ProjectId> projectsThatCouldReferenceType)
FindSymbols\FindReferences\IRemoteDependentTypeFinderService.cs (1)
17ImmutableArray<ProjectId> projectsOpt,
FindSymbols\IRemoteSymbolFinderService.cs (3)
36Checksum solutionChecksum, ProjectId projectId, string name, SearchKind searchKind, SymbolFilter criteria, CancellationToken cancellationToken); 42Checksum solutionChecksum, ProjectId projectId, string name, bool ignoreCase, SymbolFilter criteria, CancellationToken cancellationToken); 48Checksum solutionChecksum, ProjectId projectId, string pattern, SymbolFilter criteria, CancellationToken cancellationToken);
FindSymbols\SymbolFinder_Declarations_CustomQueries.cs (1)
59foreach (var projectId in solution.ProjectIds)
FindSymbols\SymbolTree\MetadataInfo.cs (2)
27public readonly HashSet<ProjectId> ReferencingProjects; 29public MetadataInfo(SymbolTreeInfo info, HashSet<ProjectId> referencingProjects)
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (10)
29private readonly ConcurrentDictionary<ProjectId, (VersionStamp semanticVersion, SymbolTreeInfo info)> _projectIdToInfo = []; 35private readonly AsyncBatchingWorkQueue<ProjectId> _workQueue; 46_workQueue = new AsyncBatchingWorkQueue<ProjectId>( 49EqualityComparer<ProjectId>.Default, 88var referencingProjects = new HashSet<ProjectId>(solution.Projects.Where(p => p.MetadataReferences.Contains(reference)).Select(p => p.Id)); 119ImmutableSegmentedList<ProjectId> projectIds, CancellationToken cancellationToken) 123foreach (var projectId in projectIds) 139foreach (var projectId in removedProjectIds) 215public void RemoveProject(ProjectId projectId) 221private void RemoveMetadataReferences(ProjectId projectId)
Packaging\IPackageInstallerService.cs (2)
17bool IsEnabled(ProjectId projectId); 19bool IsInstalled(ProjectId projectId, string packageName);
Remote\RemoteArguments.cs (3)
24internal sealed class SerializableSymbolAndProjectId(string symbolKeyData, ProjectId projectId) : IEquatable<SerializableSymbolAndProjectId> 30public readonly ProjectId ProjectId = projectId; 102var projectId = ProjectId;
Remote\RemoteHostClient.cs (1)
151ProjectId projectId,
Remote\RemoteServiceConnection.cs (4)
68ProjectId projectId, 74ProjectId projectId, 118ProjectId projectId, 124ProjectId projectId,
Rename\ConflictEngine\ConflictResolver.cs (1)
152private static bool IsIdentifierValid_Worker(Solution solution, string replacementText, IEnumerable<ProjectId> projectIds)
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
305ProjectId projectId,
Serialization\SerializerService_Asset.cs (2)
78var projectId = ProjectId.ReadFrom(reader);
Shared\Extensions\ISolutionExtensions.cs (1)
24foreach (var projectId in solution.ProjectIds)
SourceGeneration\IRemoteSourceGenerationService.cs (5)
35Checksum solutionChecksum, ProjectId projectId, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken); 46Checksum solutionChecksum, ProjectId projectId, ImmutableArray<DocumentId> documentIds, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken); 52Checksum solutionChecksum, ProjectId projectId, ImmutableArray<Checksum> analyzerReferenceChecksums, string language, CancellationToken cancellationToken); 59Checksum solutionChecksum, ProjectId projectId, string analyzerReferenceFullPath, CancellationToken cancellationToken); 66Checksum solutionChecksum, ProjectId projectId, string analyzerReferenceFullPath, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (4)
38public static Project GetRequiredProject(this Solution solution, ProjectId projectId) 86public static Solution WithUpToDateSourceGeneratorDocuments(this Solution solution, IEnumerable<ProjectId> projectIds) 93var projectIdToSourceGenerationVersion = ImmutableSortedDictionary.CreateBuilder<ProjectId, SourceGeneratorExecutionVersion>(); 95foreach (var projectId in projectIds)
Storage\SQLite\v2\SQLitePersistentStorage_ProjectIds.cs (1)
19private readonly ConcurrentDictionary<ProjectId, ProjectPrimaryKey> _projectIdToPrimaryKeyMap = [];
Workspace\AdhocWorkspace.cs (2)
65var info = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), name, name, language); 108public Document AddDocument(ProjectId projectId, string name, SourceText text)
Workspace\CommandLineProject.cs (2)
104var projectId = ProjectId.CreateNewId(debugName: projectName);
Workspace\Host\Metadata\FrameworkAssemblyPathResolverFactory.cs (1)
34public string? ResolveAssemblyPath(ProjectId projectId, string assemblyName, string? fullyQualifiedTypeName)
Workspace\Host\Metadata\IFrameworkAssemblyPathResolver.cs (1)
22string? ResolveAssemblyPath(ProjectId projectId, string assemblyName, string? fullyQualifiedName);
Workspace\Host\PersistentStorage\ProjectKey.cs (2)
17internal readonly struct ProjectKey(SolutionKey solution, ProjectId id, string? filePath, string name, Checksum parseOptionsChecksum) 23public readonly ProjectId Id = id;
Workspace\Host\SourceFiles\IDynamicFileInfoProvider.cs (5)
22/// <param name="projectId"><see cref="ProjectId"/> this file belongs to</param> 26Task<DynamicFileInfo?> GetDynamicFileInfoAsync(ProjectId projectId, string? projectFilePath, string filePath, CancellationToken cancellationToken); 31/// <param name="projectId"><see cref="ProjectId"/> this file belongs to</param> 34Task RemoveDynamicFileInfoAsync(ProjectId projectId, string? projectFilePath, string filePath, CancellationToken cancellationToken); 37/// indicate content of a file has updated. the event argument "string" should be same as "filepath" given to <see cref="GetDynamicFileInfoAsync(ProjectId, string, string, CancellationToken)"/>
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
560ProjectId projectId,
Workspace\ProjectSystem\ProjectSystemProject.cs (7)
155public ProjectId Id { get; } 161ProjectId id, 299Solution solution, ProjectId projectId) 669var projectId = projectBeforeMutation.Id; 728ProjectId projectId, 746ProjectId projectId, 767ProjectId projectId,
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (27)
61private ImmutableDictionary<ProjectId, string?> _projectToMaxSupportedLangVersionMap = ImmutableDictionary<ProjectId, string?>.Empty; 64private ImmutableDictionary<ProjectId, string> _projectToDependencyNodeTargetIdentifier = ImmutableDictionary<ProjectId, string>.Empty; 102var projectId = ProjectId.CreateNewId(projectSystemName); 191public string? TryGetDependencyNodeTargetIdentifier(ProjectId projectId) 198public string? TryGetMaxSupportedLanguageVersion(ProjectId projectId) 269public void ApplyChangeToWorkspace(ProjectId projectId, Func<CodeAnalysis.Solution, CodeAnalysis.Solution> solutionTransformation) 360private static ProjectUpdateState GetReferenceInformation(ProjectId projectId, ProjectUpdateState projectUpdateState, out ProjectReferenceInformation projectReference) 381internal void RemoveProjectFromTrackingMaps_NoLock(ProjectId projectId) 413ImmutableInterlocked.TryRemove<ProjectId, string?>(ref _projectToMaxSupportedLangVersionMap, projectId, out _); 473internal void SetMaxLanguageVersion(ProjectId projectId, string? maxLanguageVersion) 482internal void SetDependencyNodeTargetIdentifier(ProjectId projectId, string targetIdentifier) 492ProjectId projectId, 522foreach (var otherProjectId in projectsForOutputPath) 541/// <param name="projectIdToReference">The <see cref="ProjectId"/> of the project that could be referenced in place 548ProjectId projectIdToReference, 589private static bool CanConvertMetadataReferenceToProjectReference(Solution solution, ProjectId projectIdWithMetadataReference, ProjectId referencedProjectId) 633/// <param name="projectId">The <see cref="ProjectId"/> of the project being referenced.</param> 640ProjectId projectId, 693ProjectId referencingProject, 702var projectIdToReference = ids.First(); 732ProjectId referencingProject, 760ProjectId projectId, 867Func<Solution, ProjectId, ProjectUpdateState, TReference, TReference, (Solution newSolution, ProjectUpdateState newProjectUpdateState)> update,
Workspace\ProjectSystem\ProjectSystemProjectFactory.ProjectUpdateState.cs (13)
53ImmutableDictionary<string, ImmutableArray<ProjectId>> ProjectsByOutputPath, 54ImmutableDictionary<ProjectId, ProjectReferenceInformation> ProjectReferenceInfos, 61ImmutableDictionary<string, ImmutableArray<ProjectId>>.Empty.WithComparers(StringComparer.OrdinalIgnoreCase), 62ImmutableDictionary<ProjectId, ProjectReferenceInformation>.Empty, [], [], [], []); 64public ProjectUpdateState WithProjectReferenceInfo(ProjectId projectId, ProjectReferenceInformation projectReferenceInformation) 72public ProjectUpdateState WithProjectOutputPath(string projectOutputPath, ProjectId projectId) 79static ImmutableDictionary<string, ImmutableArray<ProjectId>> AddProject(string path, ProjectId projectId, ImmutableDictionary<string, ImmutableArray<ProjectId>> map) 92public ProjectUpdateState RemoveProjectOutputPath(string projectOutputPath, ProjectId projectId) 99static ImmutableDictionary<string, ImmutableArray<ProjectId>> RemoveProject(string path, ProjectId projectId, ImmutableDictionary<string, ImmutableArray<ProjectId>> map)
Workspace\ProjectSystem\SolutionChangeAccumulator.cs (2)
29public ProjectId? WorkspaceChangeProjectId { get; private set; } 89public void UpdateSolutionForProjectAction(ProjectId projectId, Solution newSolution)
Workspace\Solution\AssetPath.cs (6)
31public readonly ProjectId? ProjectId; 39public AssetPath(AssetPathKind kind, ProjectId? projectId = null, DocumentId? documentId = null) 46public AssetPath(AssetPathKind kind, ProjectId? projectId) 87public static implicit operator AssetPath(ProjectId projectId) => new(AssetPathKind.Projects, projectId); 98public static AssetPath SolutionAndProjectForTesting(ProjectId projectId) 105public static AssetPath DocumentsInProject(ProjectId projectId)
Workspace\Solution\ChecksumsAndIds.cs (5)
13/// A paired list of <see cref="ProjectId"/>s, and the checksums for their corresponding <see 19public readonly ImmutableArray<ProjectId> Ids; 21public ProjectChecksumsAndIds(ChecksumCollection checksums, ImmutableArray<ProjectId> ids) 42reader.ReadArray(static reader => ProjectId.ReadFrom(reader))); 56public readonly (Checksum checksum, ProjectId id) Current
Workspace\Solution\DocumentId.cs (7)
22public ProjectId ProjectId { get; } 30private DocumentId(ProjectId projectId, Guid guid, bool isSourceGenerated, string? debugName) 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) 99var projectId = ProjectId.ReadFrom(reader);
Workspace\Solution\Project.cs (1)
54public ProjectId Id => State.Id;
Workspace\Solution\ProjectChanges.cs (1)
18public ProjectId ProjectId => NewProject.Id;
Workspace\Solution\ProjectCone.cs (5)
17public readonly ProjectId RootProjectId; 18public readonly FrozenSet<ProjectId> ProjectIds; 20public ProjectCone(ProjectId rootProjectId, FrozenSet<ProjectId> projectIds) 27public bool Contains(ProjectId projectId)
Workspace\Solution\ProjectDependencyGraph.cs (110)
35private readonly ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> _referencesMap; 45private ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? _lazyReverseReferencesMap; 48private ImmutableArray<ProjectId> _lazyTopologicallySortedProjects; 53private ImmutableArray<IEnumerable<ProjectId>> _lazyDependencySets; 56private ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> _transitiveReferencesMap; 57private ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> _reverseTransitiveReferencesMap; 60private static readonly ObjectPool<ImmutableHashSet<ProjectId>.Builder> s_reverseReferencesBuilderPool = new(static () => ImmutableHashSet.CreateBuilder<ProjectId>(), size: 256); 69ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 71ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 72ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 77ImmutableHashSet<ProjectId> projectIds, 78ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> referencesMap) 83transitiveReferencesMap: ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 84reverseTransitiveReferencesMap: ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 92ImmutableHashSet<ProjectId> projectIds, 93ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> referencesMap, 94ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? reverseReferencesMap, 95ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> transitiveReferencesMap, 96ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> reverseTransitiveReferencesMap, 97ImmutableArray<ProjectId> topologicallySortedProjects, 98ImmutableArray<IEnumerable<ProjectId>> dependencySets) 115internal ImmutableHashSet<ProjectId> ProjectIds { get; } 117private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> RemoveItemsWithEmptyValues( 118ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> map) 120ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Builder? builder = null; 135internal ProjectDependencyGraph WithProjectReferences(ProjectId projectId, IReadOnlyList<ProjectReference> projectReferences) 169public IImmutableSet<ProjectId> GetProjectsThatThisProjectDirectlyDependsOn(ProjectId projectId) 182public IImmutableSet<ProjectId> GetProjectsThatDirectlyDependOnThisProject(ProjectId projectId) 203private ImmutableHashSet<ProjectId> GetProjectsThatDirectlyDependOnThisProject_NoLock(ProjectId projectId) 214private ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeReverseReferencesMap() 216using var _1 = PooledDictionary<ProjectId, ImmutableHashSet<ProjectId>.Builder>.GetInstance(out var reverseReferencesMapBuilders); 219foreach (var referencedId in references) 232var reverseReferencesBuilder = ImmutableDictionary.CreateBuilder<ProjectId, ImmutableHashSet<ProjectId>>(); 252internal ImmutableHashSet<ProjectId>? TryGetProjectsThatThisProjectTransitivelyDependsOn(ProjectId projectId) 266public IImmutableSet<ProjectId> GetProjectsThatThisProjectTransitivelyDependsOn(ProjectId projectId) 288private ImmutableHashSet<ProjectId> GetProjectsThatThisProjectTransitivelyDependsOn_NoLock(ProjectId projectId) 292using var pooledObject = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 302private void ComputeTransitiveReferences(ProjectId project, HashSet<ProjectId> result) 306foreach (var other in otherProjects) 318public IEnumerable<ProjectId> GetProjectsThatTransitivelyDependOnThisProject(ProjectId projectId) 340private ImmutableHashSet<ProjectId> GetProjectsThatTransitivelyDependOnThisProject_NoLock(ProjectId projectId) 344using var pooledObject = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 355private void ComputeReverseTransitiveReferences(ProjectId project, HashSet<ProjectId> results) 358foreach (var other in otherProjects) 372public IEnumerable<ProjectId> GetTopologicallySortedProjects(CancellationToken cancellationToken = default) 389using var seenProjects = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 390using var resultList = SharedPools.Default<List<ProjectId>>().GetPooledObject(); 397IEnumerable<ProjectId> projectIds, 398HashSet<ProjectId> seenProjects, 399List<ProjectId> resultList, 402foreach (var projectId in projectIds) 424public IEnumerable<IEnumerable<ProjectId>> GetDependencySets(CancellationToken cancellationToken = default) 437private ImmutableArray<IEnumerable<ProjectId>> GetDependencySets_NoLock(CancellationToken cancellationToken) 441using var seenProjects = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 442using var results = SharedPools.Default<List<IEnumerable<ProjectId>>>().GetPooledObject(); 450private void ComputeDependencySets(HashSet<ProjectId> seenProjects, List<IEnumerable<ProjectId>> results, CancellationToken cancellationToken) 452foreach (var project in ProjectIds) 458using var dependencySet = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 465using var topologicallySeenProjects = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 466using var sortedProjects = SharedPools.Default<List<ProjectId>>().GetPooledObject(); 473private void ComputedDependencySet(ProjectId project, HashSet<ProjectId> result) 480foreach (var other in otherProjects) 489ImmutableHashSet<ProjectId> projectIds, 490ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> referencesMap) 500foreach (var referencedProject in referencedProjects) 509ImmutableHashSet<ProjectId> projectIds, 510ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> forwardReferencesMap, 511ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? reverseReferencesMap) 521foreach (var referencedProject in referencedProjects) 531foreach (var referencingProject in referencingProjects) 549public ImmutableHashSet<ProjectId>? TryGetProjectsThatTransitivelyDependOnThisProject(ProjectId projectId) 564internal bool DoesProjectTransitivelyDependOnProject(ProjectId id, ProjectId potentialDependency)
Workspace\Solution\ProjectDependencyGraph_AddProject.cs (1)
11internal ProjectDependencyGraph WithAdditionalProject(ProjectId projectId)
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (30)
15internal ProjectDependencyGraph WithAdditionalProjectReferences(ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences) 58private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForAdditionalProjectReferences( 59ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReferencesMap, 60ProjectId projectId, 61IReadOnlyList<ProjectId> referencedProjectIds) 78private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForAdditionalProjectReferences( 79ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 80ProjectId projectId, 81IReadOnlyList<ProjectId> referencedProjectIds) 88foreach (var referencedProject in referencedProjectIds) 99private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForAdditionalProjectReferences( 100ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 101ProjectId projectId, 102IReadOnlyList<ProjectId> referencedProjectIds) 108var newTransitiveReferences = new HashSet<ProjectId>(referencedProjectIds); 110foreach (var referencedProjectId in referencedProjectIds) 126foreach (var projectIdToUpdate in existingTransitiveReferencesMap.Keys) 155private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForAdditionalProjectReferences( 156ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap, 157ProjectId projectId, 158IReadOnlyList<ProjectId> referencedProjectIds) 174foreach (var projectIdToUpdate in existingReverseTransitiveReferencesMap.Keys)
Workspace\Solution\ProjectDependencyGraph_RemoveAllProjectReferences.cs (24)
13internal ProjectDependencyGraph WithAllProjectReferencesRemoved(ProjectId projectId) 39private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForRemovedAllProjectReferences( 40ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 41ProjectId projectId) 57private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForRemovedAllProjectReferences( 58ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 59ProjectId projectId, 60ImmutableHashSet<ProjectId> referencedProjectIds) 68foreach (var referencedProjectId in referencedProjectIds) 76private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForRemovedAllProjectReferences( 77ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 78ProjectId projectId, 79ImmutableHashSet<ProjectId> referencedProjectIds) 103private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForRemovedAllProjectReferences( 104ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap, 105ProjectId projectId)
Workspace\Solution\ProjectDependencyGraph_RemoveProject.cs (27)
12internal ProjectDependencyGraph WithProjectRemoved(ProjectId projectId) 51private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForRemovedProject( 52ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 53ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 54ProjectId removedProjectId) 64foreach (var id in referencingProjects) 90private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForRemovedProject( 91ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 92ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 93ProjectId removedProjectId) 111foreach (var referencedProjectId in forwardReferences) 125private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForRemovedProject( 126ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 127ProjectId removedProjectId) 153private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForRemovedProject( 154ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap, 155ProjectId removedProjectId)
Workspace\Solution\ProjectDependencyGraph_RemoveProjectReference.cs (26)
13internal ProjectDependencyGraph WithProjectReferenceRemoved(ProjectId projectId, ProjectId referencedProjectId) 37private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForRemovedProjectReference( 38ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 39ProjectId projectId, 40ProjectId referencedProjectId) 54private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForRemovedProjectReference( 55ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 56ProjectId projectId, 57ProjectId referencedProjectId) 67private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForRemovedProjectReference( 68ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 69ProjectId projectId, 70ProjectId referencedProjectId) 94private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForRemovedProjectReference( 95ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap, 96ProjectId projectId, 97ProjectId referencedProjectId)
Workspace\Solution\ProjectDiagnostic.cs (2)
9public class ProjectDiagnostic(WorkspaceDiagnosticKind kind, string message, ProjectId projectId) : WorkspaceDiagnostic(kind, message) 11public ProjectId ProjectId { get; } = projectId;
Workspace\Solution\ProjectId.cs (15)
25public sealed class ProjectId : IEquatable<ProjectId>, IComparable<ProjectId> 56public static ProjectId CreateNewId(string? debugName = null) 59public static ProjectId CreateFromSerialized(Guid id, string? debugName = null) 78=> this.Equals(obj as ProjectId); 80public bool Equals(ProjectId? other) 84public static bool operator ==(ProjectId? left, ProjectId? right) 85=> EqualityComparer<ProjectId?>.Default.Equals(left, right); 87public static bool operator !=(ProjectId? left, ProjectId? right) 99internal static ProjectId ReadFrom(ObjectReader reader) 114writer.WriteString(nameof(ProjectId)); 118int IComparable<ProjectId>.CompareTo(ProjectId? other)
Workspace\Solution\ProjectInfo.cs (9)
26public ProjectId Id => Attributes.Id; 185ProjectId id, 213ProjectId id, 334public ProjectInfo WithId(ProjectId id) 412ProjectId id, 437public ProjectId Id { get; } = id; 533ProjectId? id = null, 631var projectId = ProjectId.ReadFrom(reader);
Workspace\Solution\ProjectReference.cs (2)
19public ProjectReference(ProjectId projectId, ImmutableArray<string> aliases = default, bool embedInteropTypes = false) 28public ProjectId ProjectId { get; }
Workspace\Solution\ProjectState.cs (2)
634public ProjectId Id => this.ProjectInfo.Id; 843public bool ContainsReferenceToProject(ProjectId projectId)
Workspace\Solution\Solution.cs (51)
32private ImmutableDictionary<ProjectId, Project> _projectIdToProjectMap; 49_projectIdToProjectMap = ImmutableDictionary<ProjectId, Project>.Empty; 86internal ProjectState? GetProjectState(ProjectId projectId) => this.SolutionState.GetProjectState(projectId); 120public IReadOnlyList<ProjectId> ProjectIds => this.SolutionState.ProjectIds; 135public bool ContainsProject([NotNullWhen(returnValue: true)] ProjectId? projectId) 143public Project? GetProject(ProjectId? projectId) 153private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject; 154private static Project CreateProject(ProjectId projectId, Solution solution) 174/// Given a <paramref name="symbol"/> returns the <see cref="ProjectId"/> of the <see cref="Project"/> it came 193internal ProjectId? GetOriginatingProjectId(ISymbol symbol) 231public DocumentId? GetDocumentId(SyntaxTree? syntaxTree, ProjectId? projectId) 316internal Document? GetDocument(SyntaxTree? syntaxTree, ProjectId? projectId) 349var id = ProjectId.CreateNewId(debugName: name); 356public Solution AddProject(ProjectId projectId, string name, string assemblyName, string language) 372public Solution RemoveProject(ProjectId projectId) 374using var _ = ArrayBuilder<ProjectId>.GetInstance(1, out var projectIds); 380internal Solution RemoveProjects(ArrayBuilder<ProjectId> projectIds) 387public Solution WithProjectAssemblyName(ProjectId projectId, string assemblyName) 402public Solution WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath) 412public Solution WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath) 422public Solution WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info) 432public Solution WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace) 442internal Solution WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm) 452public Solution WithProjectName(ProjectId projectId, string name) 467public Solution WithProjectFilePath(ProjectId projectId, string? filePath) 478public Solution WithProjectCompilationOptions(ProjectId projectId, CompilationOptions options) 494public Solution WithProjectParseOptions(ProjectId projectId, ParseOptions options) 517internal Solution WithHasAllInformation(ProjectId projectId, bool hasAllInformation) 529internal Solution WithRunAnalyzers(ProjectId projectId, bool runAnalyzers) 540internal Solution WithHasSdkCodeStyleAnalyzers(ProjectId projectId, bool hasSdkCodeStyleAnalyzers) 556public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds) 594public Solution AddProjectReference(ProjectId projectId, ProjectReference projectReference) 610public Solution AddProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences) 640public Solution RemoveProjectReference(ProjectId projectId, ProjectReference projectReference) 671public Solution WithProjectReferences(ProjectId projectId, IEnumerable<ProjectReference>? projectReferences) 692public Solution AddMetadataReference(ProjectId projectId, MetadataReference metadataReference) 707public Solution AddMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences) 734public Solution RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference) 756public Solution WithProjectMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences) 772public Solution AddAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 787public Solution AddAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences) 821public Solution RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 850public Solution WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences) 1115internal ProjectState GetRequiredProjectState(ProjectId projectId) 1571internal DocumentId? GetFirstRelatedDocumentId(DocumentId documentId, ProjectId? relatedProjectIdHint) 1651internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState) 1723private void CheckContainsProject(ProjectId projectId) 1818private void CheckCircularProjectReferences(ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences) 1843private void CheckSubmissionProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences, bool ignoreExistingReferences) 1871internal SourceGeneratorExecutionVersion GetSourceGeneratorExecutionVersion(ProjectId projectId)
Workspace\Solution\SolutionChanges.cs (3)
24foreach (var id in _newSolution.ProjectIds) 38foreach (var id in _newSolution.ProjectIds) 51foreach (var id in _oldSolution.ProjectIds)
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (6)
219ProjectId projectId, 220Dictionary<MetadataReference, ProjectId>? metadataReferenceToProjectId) 250private static void RecordAssemblySymbols(ProjectId projectId, Compilation compilation, Dictionary<MetadataReference, ProjectId>? metadataReferenceToProjectId) 264private static void RecordSourceOfAssemblySymbol(ISymbol? assemblyOrModuleSymbol, ProjectId projectId) 274if (!s_assemblyOrModuleSymbolToProjectMap.TryGetValue(assemblyOrModuleSymbol, out var tmp))
Workspace\Solution\SolutionCompilationState.cs (69)
32private static readonly ConditionalWeakTable<ISymbol, ProjectId> s_assemblyOrModuleSymbolToProjectMap = new(); 47private ImmutableSegmentedDictionary<ProjectId, ICompilationTracker> _projectIdToTrackerMap; 62ImmutableSegmentedDictionary<ProjectId, ICompilationTracker> projectIdToTrackerMap, 94projectIdToTrackerMap: ImmutableSegmentedDictionary<ProjectId, ICompilationTracker>.Empty, 117ImmutableSegmentedDictionary<ProjectId, ICompilationTracker>? projectIdToTrackerMap = null, 208/// Creates a mapping of <see cref="ProjectId"/> to <see cref="ICompilationTracker"/> 214private ImmutableSegmentedDictionary<ProjectId, ICompilationTracker> CreateCompilationTrackerMap<TArg>( 215ProjectId changedProjectId, 217Action<ImmutableSegmentedDictionary<ProjectId, ICompilationTracker>.Builder, TArg> modifyNewTrackerInfo, 224static bool CanReuse(ProjectId id, (ProjectId changedProjectId, ProjectDependencyGraph dependencyGraph) arg) 236/// Creates a mapping of <see cref="ProjectId"/> to <see cref="ICompilationTracker"/> 242private ImmutableSegmentedDictionary<ProjectId, ICompilationTracker> CreateCompilationTrackerMap<TArg>( 243ImmutableArray<ProjectId> changedProjectIds, 245Action<ImmutableSegmentedDictionary<ProjectId, ICompilationTracker>.Builder, TArg> modifyNewTrackerInfo, 252static bool CanReuse(ProjectId id, (ImmutableArray<ProjectId> changedProjectIds, ProjectDependencyGraph dependencyGraph) arg) 257foreach (var changedProjectId in arg.changedProjectIds) 268/// Creates a mapping of <see cref="ProjectId"/> to <see cref="ICompilationTracker"/> 274private ImmutableSegmentedDictionary<ProjectId, ICompilationTracker> CreateCompilationTrackerMap<TArgCanReuse, TArgModifyNewTrackerInfo>( 275Func<ProjectId, TArgCanReuse, bool> canReuse, 277Action<ImmutableSegmentedDictionary<ProjectId, ICompilationTracker>.Builder, TArgModifyNewTrackerInfo> modifyNewTrackerInfo, 330using var _ = PooledHashSet<ProjectId>.GetInstance(out var dependentProjects); 359public SolutionCompilationState RemoveProjects(ArrayBuilder<ProjectId> projectIds) 368using var _ = PooledHashSet<ProjectId>.GetInstance(out var dependentProjects); 371foreach (var projectId in projectIds) 373foreach (var dependentProject in originalDependencyGraph.GetProjectsThatTransitivelyDependOnThisProject(projectId)) 388foreach (var projectId in projectIds) 395foreach (var projectId in projectIds) 406ProjectId projectId, string assemblyName) 417public SolutionCompilationState WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath) 427ProjectId projectId, string? outputRefFilePath) 437ProjectId projectId, in CompilationOutputInfo info) 447ProjectId projectId, string? defaultNamespace) 457ProjectId projectId, SourceHashAlgorithm checksumAlgorithm) 468ProjectId projectId, string name) 478ProjectId projectId, string? filePath) 488ProjectId projectId, CompilationOptions? options) 498ProjectId projectId, ParseOptions? options) 523ProjectId projectId, bool hasAllInformation) 533ProjectId projectId, bool runAnalyzers) 543ProjectId projectId, bool hasSdkCodeStyleAnalyzers) 553ProjectId projectId, ImmutableList<DocumentId> documentIds) 660ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences) 669public SolutionCompilationState RemoveProjectReference(ProjectId projectId, ProjectReference projectReference) 679ProjectId projectId, IReadOnlyList<ProjectReference> projectReferences) 689ProjectId projectId, IReadOnlyCollection<MetadataReference> metadataReferences) 698public SolutionCompilationState RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference) 708ProjectId projectId, IReadOnlyList<MetadataReference> metadataReferences) 742ProjectId projectId, IReadOnlyList<AnalyzerReference> analyzerReferences) 806var projectId = g.Key; 831IEnumerable<(ProjectId projectId, ImmutableArray<TDocumentState> updatedDocumentState)> updatedDocumentStatesPerProject, 1075public static ProjectId? GetProjectId(IAssemblySymbol? assemblySymbol) 1084private bool TryGetCompilationTracker(ProjectId projectId, [NotNullWhen(returnValue: true)] out ICompilationTracker? tracker) 1087private static readonly Func<ProjectId, SolutionState, RegularCompilationTracker> s_createCompilationTrackerFunction = CreateCompilationTracker; 1089private static RegularCompilationTracker CreateCompilationTracker(ProjectId projectId, SolutionState solution) 1096private ICompilationTracker GetCompilationTracker(ProjectId projectId) 1106public Task<VersionStamp> GetDependentVersionAsync(ProjectId projectId, CancellationToken cancellationToken) 1109public Task<VersionStamp> GetDependentSemanticVersionAsync(ProjectId projectId, CancellationToken cancellationToken) 1112public Task<Checksum> GetDependentChecksumAsync(ProjectId projectId, CancellationToken cancellationToken) 1115public bool TryGetCompilation(ProjectId projectId, [NotNullWhen(returnValue: true)] out Compilation? compilation) 1125/// Returns the compilation for the specified <see cref="ProjectId"/>. Can return <see langword="null"/> when the project 1131private Task<Compilation?> GetCompilationAsync(ProjectId projectId, CancellationToken cancellationToken) 1474private (ImmutableDictionary<ProjectId, ProjectState>, ImmutableSegmentedDictionary<ProjectId, ICompilationTracker>) ComputeFrozenSnapshotMaps(CancellationToken cancellationToken) 1624using var _ = PooledDictionary<ProjectId, ArrayBuilder<DocumentState>>.GetInstance(out var missingDocumentStates); 1703private SolutionCompilationState RemoveDocumentsFromSingleProject<T>(ProjectId projectId, ImmutableArray<DocumentId> documentIds) 1750/// <inheritdoc cref="Solution.WithCachedSourceGeneratorState(ProjectId, Project)"/> 1751public SolutionCompilationState WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
490var metadataReferenceToProjectId = new Dictionary<MetadataReference, ProjectId>();
Workspace\Solution\SolutionCompilationState.RootedSymbolSet.cs (1)
36ProjectId ProjectId,
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (2)
15internal DocumentState? GetDocumentState(SyntaxTree? syntaxTree, ProjectId? projectId) 71var projectId = unrootedSymbolInfo?.ProjectId;
Workspace\Solution\SolutionCompilationState_Checksum.cs (5)
34private readonly Dictionary<ProjectId, AsyncLazy<(SolutionCompilationStateChecksums checksums, ProjectCone projectCone)>> _lazyProjectChecksums = []; 39public bool TryGetStateChecksums(ProjectId projectId, [NotNullWhen(true)] out SolutionCompilationStateChecksums? stateChecksums) 73ProjectId projectId, 99public async Task<Checksum> GetChecksumAsync(ProjectId projectId, CancellationToken cancellationToken) 106ProjectId? projectId,
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (1)
104public async Task<bool> HasSourceGeneratorsAsync(ProjectId projectId, CancellationToken cancellationToken)
Workspace\Solution\SolutionState.cs (50)
68IReadOnlyList<ProjectId> projectIds, 73ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap, 114projectIds: SpecializedCollections.EmptyBoxedImmutableArray<ProjectId>(), 119idToProjectStateMap: ImmutableDictionary<ProjectId, ProjectState>.Empty, 129public ImmutableDictionary<ProjectId, ProjectState> ProjectStates { get; } 149public IReadOnlyList<ProjectId> ProjectIds { get; } 168IReadOnlyList<ProjectId>? projectIds = null, 172ImmutableDictionary<ProjectId, ProjectState>? idToProjectStateMap = null, 265public bool ContainsProject([NotNullWhen(returnValue: true)] ProjectId? projectId) 310public ProjectState? GetProjectState(ProjectId projectId) 313public ProjectState GetRequiredProjectState(ProjectId projectId) 375using var _1 = ArrayBuilder<ProjectId>.GetInstance(ProjectIds.Count + projectStates.Count, out var newProjectIdsBuilder); 376using var _2 = PooledHashSet<ProjectId>.GetInstance(out var addedProjectIds); 424public SolutionState RemoveProjects(ArrayBuilder<ProjectId> projectIds) 431foreach (var projectId in projectIds) 437using var _ = PooledHashSet<ProjectId>.GetInstance(out var projectIdsSet); 443foreach (var projectId in projectIds) 449foreach (var projectId in projectIds) 453foreach (var projectId in projectIds) 509public StateChange WithProjectAssemblyName(ProjectId projectId, string assemblyName) 525public StateChange WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath) 541public StateChange WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath) 557public StateChange WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info) 573public StateChange WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace) 589public StateChange WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm) 605public StateChange WithProjectName(ProjectId projectId, string name) 621public StateChange WithProjectFilePath(ProjectId projectId, string? filePath) 638public StateChange WithProjectCompilationOptions(ProjectId projectId, CompilationOptions? options) 655public StateChange WithProjectParseOptions(ProjectId projectId, ParseOptions? options) 672public StateChange WithHasAllInformation(ProjectId projectId, bool hasAllInformation) 690public StateChange WithRunAnalyzers(ProjectId projectId, bool runAnalyzers) 708internal StateChange WithHasSdkCodeStyleAnalyzers(ProjectId projectId, bool hasSdkCodeStyleAnalyzers) 726public StateChange AddProjectReferences(ProjectId projectId, IReadOnlyCollection<ProjectReference> projectReferences) 747public StateChange RemoveProjectReference(ProjectId projectId, ProjectReference projectReference) 787public StateChange WithProjectReferences(ProjectId projectId, IReadOnlyList<ProjectReference> projectReferences) 804public StateChange WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds) 835public StateChange AddMetadataReferences(ProjectId projectId, IReadOnlyCollection<MetadataReference> metadataReferences) 853public StateChange RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference) 870public StateChange WithProjectMetadataReferences(ProjectId projectId, IReadOnlyList<MetadataReference> metadataReferences) 886public StateChange WithProjectAnalyzerReferences(ProjectId projectId, IReadOnlyList<AnalyzerReference> analyzerReferences) 1189IReadOnlyList<ProjectId> projectIds, 1190ImmutableDictionary<ProjectId, ProjectState> projectStates) 1237public DocumentId? GetFirstRelatedDocumentId(DocumentId documentId, ProjectId? relatedProjectIdHint) 1344private void CheckNotContainsProject(ProjectId projectId) 1352internal void CheckContainsProject(ProjectId projectId) 1360internal bool ContainsProjectReference(ProjectId projectId, ProjectReference projectReference) 1363internal bool ContainsMetadataReference(ProjectId projectId, MetadataReference metadataReference) 1366internal bool ContainsAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 1369internal bool ContainsTransitiveReference(ProjectId fromProjectId, ProjectId toProjectId)
Workspace\Solution\SolutionState_Checksum.cs (12)
25private static readonly ConditionalWeakTable<IReadOnlyList<ProjectId>, IReadOnlyList<ProjectId>> s_projectIdToSortedProjectsMap = new(); 37private readonly Dictionary<ProjectId, AsyncLazy<SolutionStateChecksums>> _lazyProjectChecksums = []; 39public static IReadOnlyList<ProjectId> GetOrCreateSortedProjectIds(IReadOnlyList<ProjectId> unorderedList) 45public bool TryGetStateChecksums(ProjectId projectId, [NotNullWhen(true)] out SolutionStateChecksums? stateChecksums) 72ProjectId projectId, 94public async Task<Checksum> GetChecksumAsync(ProjectId projectId, CancellationToken cancellationToken) 103ProjectId? projectConeId, 106using var projectCone = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 119foreach (var orderedProjectId in orderedProjectIds) 165void AddProjectCone(ProjectId? projectConeId)
Workspace\Solution\SourceGeneratedDocumentIdentity.cs (1)
35public static SourceGeneratedDocumentIdentity Generate(ProjectId projectId, string hintName, ISourceGenerator generator, string filePath, AnalyzerReference analyzerReference)
Workspace\Solution\SourceGeneratorExecutionVersion.cs (8)
52/// Helper construct to allow a mapping from <see cref="ProjectId"/>s to <see cref="SourceGeneratorExecutionVersion"/>. 55internal sealed class SourceGeneratorExecutionVersionMap(ImmutableSortedDictionary<ProjectId, SourceGeneratorExecutionVersion> map) 59public ImmutableSortedDictionary<ProjectId, SourceGeneratorExecutionVersion> Map { get; } = map; 62: this(ImmutableSortedDictionary<ProjectId, SourceGeneratorExecutionVersion>.Empty) 66public SourceGeneratorExecutionVersion this[ProjectId projectId] => Map[projectId]; 95var builder = ImmutableSortedDictionary.CreateBuilder<ProjectId, SourceGeneratorExecutionVersion>(); 98var projectId = ProjectId.ReadFrom(reader);
Workspace\Solution\StateChecksums.cs (4)
208/// <param name="projectConeId">The particular <see cref="ProjectId"/> if this was a checksum tree made for a particular 211ProjectId? projectConeId, 228public ProjectId? ProjectConeId { get; } = projectConeId; 269projectConeId: reader.ReadBoolean() ? ProjectId.ReadFrom(reader) : null,
Workspace\Workspace.cs (52)
98_updateSourceGeneratorsQueue = new AsyncBatchingWorkQueue<(ProjectId? projectId, bool forceRegeneration)>( 102EqualityComparer<(ProjectId? projectId, bool forceRegeneration)>.Default, 201/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/> 205ProjectId? projectId = null, 233Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 253Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 332ProjectId? relatedProjectIdHint = null; 675protected virtual void ClearProjectData(ProjectId projectId) 841protected internal virtual void OnProjectRemoved(ProjectId projectId) 864protected virtual void CheckProjectCanBeRemoved(ProjectId projectId) 871protected internal void OnAssemblyNameChanged(ProjectId projectId, string assemblyName) 877protected internal void OnOutputFilePathChanged(ProjectId projectId, string? outputFilePath) 883protected internal void OnOutputRefFilePathChanged(ProjectId projectId, string? outputFilePath) 893protected internal void OnProjectNameChanged(ProjectId projectId, string name, string? filePath) 899internal void OnDefaultNamespaceChanged(ProjectId projectId, string? defaultNamespace) 905protected internal void OnCompilationOptionsChanged(ProjectId projectId, CompilationOptions options) 911protected internal void OnParseOptionsChanged(ProjectId projectId, ParseOptions options) 917protected internal void OnProjectReferenceAdded(ProjectId projectId, ProjectReference projectReference) 934protected internal void OnProjectReferenceRemoved(ProjectId projectId, ProjectReference projectReference) 948protected internal void OnMetadataReferenceAdded(ProjectId projectId, MetadataReference metadataReference) 960protected internal void OnMetadataReferenceRemoved(ProjectId projectId, MetadataReference metadataReference) 972protected internal void OnAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 984protected internal void OnAnalyzerReferenceRemoved(ProjectId projectId, AnalyzerReference analyzerReference) 1028internal void OnHasAllInformationChanged(ProjectId projectId, bool hasAllInformation) 1034internal void OnRunAnalyzersChanged(ProjectId projectId, bool runAnalyzers) 1450var outputAssemblyToProjectIdMap = new Dictionary<string, ProjectId>(); 1465foreach (var pid in solution.ProjectIds) 1476if ((!RoslynString.IsNullOrEmpty(pemeta.Display) && outputAssemblyToProjectIdMap.TryGetValue(pemeta.Display, out var matchingProjectId)) || 1512internal virtual bool CanAddProjectReference(ProjectId referencingProject, ProjectId referencedProject) 2074protected virtual void ApplyProjectRemoved(ProjectId projectId) 2085protected virtual void ApplyCompilationOptionsChanged(ProjectId projectId, CompilationOptions options) 2103protected virtual void ApplyParseOptionsChanged(ProjectId projectId, ParseOptions options) 2120protected virtual void ApplyProjectReferenceAdded(ProjectId projectId, ProjectReference projectReference) 2131protected virtual void ApplyProjectReferenceRemoved(ProjectId projectId, ProjectReference projectReference) 2142protected virtual void ApplyMetadataReferenceAdded(ProjectId projectId, MetadataReference metadataReference) 2153protected virtual void ApplyMetadataReferenceRemoved(ProjectId projectId, MetadataReference metadataReference) 2164protected virtual void ApplyAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 2175protected virtual void ApplyAnalyzerReferenceRemoved(ProjectId projectId, AnalyzerReference analyzerReference) 2333protected void CheckProjectIsInCurrentSolution(ProjectId projectId) 2336private static void CheckProjectIsInSolution(Solution solution, ProjectId projectId) 2349protected void CheckProjectIsNotInCurrentSolution(ProjectId projectId) 2352private static void CheckProjectIsNotInSolution(Solution solution, ProjectId projectId) 2365protected void CheckProjectHasProjectReference(ProjectId fromProjectId, ProjectReference projectReference) 2378protected void CheckProjectDoesNotHaveProjectReference(ProjectId fromProjectId, ProjectReference projectReference) 2391protected void CheckProjectDoesNotHaveTransitiveProjectReference(ProjectId fromProjectId, ProjectId toProjectId) 2405protected void CheckProjectHasMetadataReference(ProjectId projectId, MetadataReference metadataReference) 2416protected void CheckProjectDoesNotHaveMetadataReference(ProjectId projectId, MetadataReference metadataReference) 2427protected void CheckProjectHasAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 2438protected void CheckProjectDoesNotHaveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 2564protected virtual string GetProjectName(ProjectId projectId)
Workspace\Workspace_Editor.cs (5)
23private readonly Dictionary<ProjectId, HashSet<DocumentId>> _projectToOpenDocumentsMap = []; 65private void ClearOpenDocuments(ProjectId projectId) 159protected void CheckProjectDoesNotContainOpenDocuments(ProjectId projectId) 167private bool ProjectHasOpenDocuments(ProjectId projectId) 190public virtual IEnumerable<DocumentId> GetOpenDocumentIds(ProjectId? projectId = null)
Workspace\Workspace_Events.cs (1)
45protected Task RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId projectId = null, DocumentId documentId = null)
Workspace\Workspace_SourceGeneration.cs (8)
19/// <see cref="ProjectId"/> represents the projects that have changed, and which need their source-generators 26private readonly AsyncBatchingWorkQueue<(ProjectId? projectId, bool forceRegeneration)> _updateSourceGeneratorsQueue; 30internal void EnqueueUpdateSourceGeneratorVersion(ProjectId? projectId, bool forceRegeneration) 34ImmutableSegmentedList<(ProjectId? projectId, bool forceRegeneration)> projectIds, CancellationToken cancellationToken) 70Solution solution, ImmutableSegmentedList<(ProjectId? projectId, bool forceRegeneration)> projectIds) 76var result = ImmutableSortedDictionary.CreateBuilder<ProjectId, SourceGeneratorExecutionVersion>(); 96foreach (var projectId in solution.ProjectIds) 126foreach (var transitiveProjectId in dependencyGraph.GetProjectsThatTransitivelyDependOnThisProject(projectId))
Workspace\WorkspaceChangeEventArgs.cs (2)
49public ProjectId? ProjectId { get; } 65public WorkspaceChangeEventArgs(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId? projectId = null, DocumentId? documentId = null)
Microsoft.CodeAnalysis.Workspaces.MSBuild (55)
MSBuild\MSBuildProjectLoader.Worker.cs (9)
45/// Map of <see cref="ProjectId"/>s, project paths, and output file paths. 69private readonly Dictionary<ProjectId, ProjectFileInfo> _projectIdToFileInfoMap; 70private readonly Dictionary<ProjectId, List<ProjectReference>> _projectIdToProjectReferencesMap; 232var idsAndFileInfos = new List<(ProjectId id, ProjectFileInfo fileInfo)>(); 236var projectId = _projectMap.GetOrCreateProjectId(projectFileInfo); 248projectId = ProjectId.CreateNewId(debugName: projectFileInfo.FilePath); 274private Task<ProjectInfo> CreateProjectInfoAsync(ProjectFileInfo projectFileInfo, ProjectId projectId, bool addDiscriminator, CancellationToken cancellationToken) 436private ImmutableArray<DocumentInfo> CreateDocumentInfos(IReadOnlyList<DocumentFileInfo> documentFileInfos, ProjectId projectId, Encoding? encoding) 479private void CheckForDuplicateDocuments(ImmutableArray<DocumentInfo> documents, string? projectFilePath, ProjectId projectId)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (10)
186private async Task<ResolvedReferences> ResolveReferencesAsync(ProjectId id, ProjectFileInfo projectFileInfo, CommandLineArguments commandLineArgs, CancellationToken cancellationToken) 246var unknownProjectId = _projectMap.GetOrCreateProjectId(projectFileReference.Path); 267private async Task<bool> TryLoadAndAddReferenceAsync(ProjectId id, string projectReferencePath, ImmutableArray<string> aliases, ResolvedReferencesBuilder builder, CancellationToken cancellationToken) 369private ProjectReference CreateProjectReference(ProjectId from, ProjectId to, ImmutableArray<string> aliases) 376private bool ProjectReferenceExists(ProjectId to, ProjectId from) 380private static bool ProjectReferenceExists(ProjectId to, ProjectInfo from) 384ProjectId id, 391foreach (var projectReferenceId in projectReferenceIds)
MSBuild\MSBuildWorkspace.cs (7)
570protected override void ApplyMetadataReferenceAdded(ProjectId projectId, MetadataReference metadataReference) 606protected override void ApplyMetadataReferenceRemoved(ProjectId projectId, MetadataReference metadataReference) 625private AssemblyIdentity? GetAssemblyIdentity(ProjectId projectId, MetadataReference metadataReference) 648protected override void ApplyProjectReferenceAdded(ProjectId projectId, ProjectReference projectReference) 663protected override void ApplyProjectReferenceRemoved(ProjectId projectId, ProjectReference projectReference) 676protected override void ApplyAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 688protected override void ApplyAnalyzerReferenceRemoved(ProjectId projectId, AnalyzerReference analyzerReference)
MSBuild\ProjectMap.cs (29)
21/// A map of project path to <see cref="ProjectId"/>s. Note that there can be multiple <see cref="ProjectId"/>s per project path 24private readonly Dictionary<string, HashSet<ProjectId>> _projectPathToProjectIdsMap; 27/// A map of project path to <see cref="ProjectInfo"/>s. Note that there can be multiple <see cref="ProjectId"/>s per project path 33/// A map of <see cref="ProjectId"/> to the output file of the project (if any). 35private readonly Dictionary<ProjectId, string> _projectIdToOutputFilePathMap; 38/// A map of <see cref="ProjectId"/> to the output ref file of the project (if any). 40private readonly Dictionary<ProjectId, string> _projectIdToOutputRefFilePathMap; 44_projectPathToProjectIdsMap = new Dictionary<string, HashSet<ProjectId>>(PathUtilities.Comparer); 81private void Add(ProjectId projectId, string? projectPath, string? outputFilePath, string? outputRefFilePath) 122private ProjectId CreateProjectId(string? projectPath, string? outputFilePath, string? outputRefFilePath) 124var newProjectId = ProjectId.CreateNewId(debugName: projectPath); 129internal ProjectId GetOrCreateProjectId(string projectPath) 142internal ProjectId GetOrCreateProjectId(ProjectFileInfo projectFileInfo) 150if (TryFindOutputFileRefPathInProjectIdSet(outputRefFilePath, projectIds, out var projectId) || 160private bool TryFindOutputFileRefPathInProjectIdSet(string? outputRefFilePath, HashSet<ProjectId> set, [NotNullWhen(true)] out ProjectId? result) 163private bool TryFindOutputFilePathInProjectIdSet(string? outputFilePath, HashSet<ProjectId> set, [NotNullWhen(true)] out ProjectId? result) 166private static bool TryFindPathInProjectIdSet(string? path, Func<ProjectId, string?> getPathById, HashSet<ProjectId> set, [NotNullWhen(true)] out ProjectId? result) 170foreach (var id in set) 186internal string? GetOutputRefFilePathById(ProjectId projectId) 191internal string? GetOutputFilePathById(ProjectId projectId) 196internal bool TryGetIdsByProjectPath(string projectPath, [NotNullWhen(true)] out HashSet<ProjectId>? ids) 199internal bool TryGetOutputFilePathById(ProjectId id, [NotNullWhen(true)] out string? outputFilePath) 202internal bool TryGetOutputRefFilePathById(ProjectId id, [NotNullWhen(true)] out string? outputRefFilePath)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (7)
NetCoreTests.cs (3)
128var projectRefId = projectReference.ProjectId; 175var projectRefId = projectReference.ProjectId; 519var projectRefId = projectReference.ProjectId;
VisualStudioMSBuildWorkspaceTests.cs (4)
420var pid2 = ProjectId.CreateNewId(); 2196var csProjectId = csProject.Id; 2200var vbProjectId = vbProject.Id;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (23)
SolutionUtilities.cs (3)
25var projectId = projectChanges.Single().ProjectId; 107var id = ProjectId.CreateNewId();
TestDynamicFileInfoProviderThatProducesFiles.cs (2)
30public Task<DynamicFileInfo> GetDynamicFileInfoAsync(ProjectId projectId, string projectFilePath, string filePath, CancellationToken cancellationToken) 52public Task RemoveDynamicFileInfoAsync(ProjectId projectId, string projectFilePath, string filePath, CancellationToken cancellationToken)
TestDynamicFileInfoProviderThatProducesNoFiles.cs (2)
30public Task<DynamicFileInfo> GetDynamicFileInfoAsync(ProjectId projectId, string projectFilePath, string filePath, CancellationToken cancellationToken) 33public Task RemoveDynamicFileInfoAsync(ProjectId projectId, string projectFilePath, string filePath, CancellationToken cancellationToken)
WorkspaceExtensions.cs (2)
15public static DocumentId AddDocument(this Workspace workspace, ProjectId projectId, IEnumerable<string> folders, string name, SourceText initialText, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular) 41public static DocumentId CreateDocumentId(this ProjectId projectId, string name, IEnumerable<string>? folders = null)
Workspaces\AbstractTestHostProject.cs (1)
16public abstract ProjectId Id { get; }
Workspaces\TestHostProject`1.cs (4)
24private readonly ProjectId _id; 57public override ProjectId Id 107_id = ProjectId.CreateNewId(debugName: this.AssemblyName); 141_id = ProjectId.CreateNewId(debugName: this.Name);
Workspaces\TestWorkspace`1.cs (9)
276public new void OnProjectRemoved(ProjectId projectId) 279public new void OnProjectReferenceAdded(ProjectId projectId, ProjectReference projectReference) 282public new void OnProjectReferenceRemoved(ProjectId projectId, ProjectReference projectReference) 288public new void OnParseOptionsChanged(ProjectId projectId, ParseOptions parseOptions) 291public new void OnAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 331public TestHostProject<TDocument>? GetTestProject(ProjectId projectId) 575public Task ChangeProjectAsync(ProjectId projectId, Solution solution) 595internal override bool CanAddProjectReference(ProjectId referencingProject, ProjectId referencedProject)
Microsoft.CodeAnalysis.Workspaces.UnitTests (513)
CodeCleanup\AddMissingTokensTests.cs (2)
2729var projectId = ProjectId.CreateNewId();
CodeCleanup\CodeCleanupTests.cs (2)
417var projectId = ProjectId.CreateNewId();
CodeCleanup\FixIncorrectTokenTests.cs (2)
754var projectId = ProjectId.CreateNewId();
CodeCleanup\NormalizeModifiersOrOperatorsTests.cs (2)
1030var projectId = ProjectId.CreateNewId();
CodeCleanup\ReduceTokenTests.cs (2)
2017var projectId = ProjectId.CreateNewId();
CodeCleanup\RemoveUnnecessaryLineContinuationTests.cs (2)
1453var projectId = ProjectId.CreateNewId();
FindAllDeclarationsTests.cs (10)
134var csharpId = ProjectId.CreateNewId(); 139var vbId = ProjectId.CreateNewId(); 158var submission0Id = ProjectId.CreateNewId(); 173var submission1Id = ProjectId.CreateNewId(); 697var pid = ProjectId.CreateNewId();
FindAllDeclarationsTests.TestSolutionsAndProject.cs (4)
93var pid = ProjectId.CreateNewId(); 114var pid = ProjectId.CreateNewId();
FindReferencesTests.cs (19)
27private static Solution AddProjectWithMetadataReferences(Solution solution, string projectName, string languageName, string code, IEnumerable<MetadataReference> metadataReference, params ProjectId[] projectReferences) 30var pid = ProjectId.CreateNewId(); 43private static Solution AddProjectWithMetadataReferences(Solution solution, string projectName, string languageName, string code, MetadataReference metadataReference, params ProjectId[] projectReferences) 46var pid = ProjectId.CreateNewId(); 61var pid = ProjectId.CreateNewId(); 71var pid = ProjectId.CreateNewId(); 120var pid = ProjectId.CreateNewId(); 169var prj1Id = ProjectId.CreateNewId(); 208var prj1Id = ProjectId.CreateNewId(); 272var prj1Id = ProjectId.CreateNewId(); 396var projectIds = new HashSet<ProjectId>();
GeneratedCodeRecognitionTests.cs (2)
100var projectId = ProjectId.CreateNewId(projectName);
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (2)
26var projectId = ProjectId.CreateNewId();
SemanticModelReuse\SemanticModelReuseTests.cs (2)
26var projectId = ProjectId.CreateNewId();
SolutionTests\DocumentInfoTests.cs (8)
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); 104var projectId = ProjectId.CreateNewId(); 106var instance = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc");
SolutionTests\ProjectDependencyGraphTests.cs (12)
226var projectAId = solution.GetProjectsByName("A").Single().Id; 227var projectBId = solution.GetProjectsByName("B").Single().Id; 243var projectAId = ProjectId.CreateNewId("A"); 244var projectBId = ProjectId.CreateNewId("B"); 280var projectId = solution.GetProjectsByName(project).Single().Id; 297var projectId = solution.GetProjectsByName(project).Single().Id; 648var projectId = solution.GetProjectsByName(project).Single().Id; 660var projectId = solution.GetProjectsByName(project).Single().Id; 712var projectId = ProjectId.CreateNewId(debugName: projectName);
SolutionTests\ProjectIdTests.cs (8)
18var id1 = ProjectId.CreateFromSerialized(guid1, "debug1"); 19var id2 = ProjectId.CreateFromSerialized(guid1, "debug2"); 31var id1 = ProjectId.CreateFromSerialized(Guid.NewGuid(), "debug1"); 32var id2 = ProjectId.CreateFromSerialized(Guid.NewGuid(), "debug1");
SolutionTests\ProjectInfoTests.cs (34)
24var pid = ProjectId.CreateNewId(); 37var pid = ProjectId.CreateNewId(); 52var projectReference = new ProjectReference(ProjectId.CreateNewId()); 75var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc"); 77var info1 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", documents: [documentInfo]); 80var info2 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#"); 83var info3 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", documents: []); 86var info4 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", documents: []); 94var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc"); 96var info1 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", additionalDocuments: [documentInfo]); 99var info2 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#"); 102var info3 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", additionalDocuments: []); 105var info4 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", additionalDocuments: []); 113var projectReference = new ProjectReference(ProjectId.CreateNewId()); 115var info1 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", projectReferences: [projectReference]); 118var info2 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#"); 121var info3 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", projectReferences: []); 124var info4 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", projectReferences: []); 134var info1 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", metadataReferences: [metadataReference]); 137var info2 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#"); 140var info3 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", metadataReferences: []); 143var info4 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", metadataReferences: []); 153var info1 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", analyzerReferences: [analyzerReference]); 156var info2 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#"); 159var info3 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", analyzerReferences: []); 162var info4 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", analyzerReferences: []); 169var projectInfo = ProjectInfo.Create(name: "Goo", filePath: @"C:\", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "Bar", language: "C#"); 176var projectInfo = ProjectInfo.Create(name: "Goo", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "Bar", language: "C#"); 183var projectId = ProjectId.CreateNewId(); 185var instance = ProjectInfo.Create(name: "Name", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "AssemblyName", language: "C#"); 187SolutionTestHelpers.TestProperty(instance, (old, value) => old.WithId(value), opt => opt.Id, ProjectId.CreateNewId(), defaultThrows: true);
SolutionTests\SolutionInfoTests.cs (2)
21var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#"); 32var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#");
SolutionTests\SolutionTests.cs (338)
50private static readonly DocumentId s_unrelatedDocumentId = DocumentId.CreateNewId(ProjectId.CreateNewId()); 54var projectId = ProjectId.CreateNewId(); 72var projectId1 = ProjectId.CreateNewId(); 73var projectId2 = ProjectId.CreateNewId(); 273var projectId = documentId.ProjectId; 328var projectId = ProjectId.CreateNewId(); 833var projectId1 = ProjectId.CreateNewId(); 834var projectId2 = ProjectId.CreateNewId(); 1075var projectId = ProjectId.CreateNewId(); 1076var projectId2 = ProjectId.CreateNewId(); 1295var projectId = ProjectId.CreateNewId(); 1330var projectId = ProjectId.CreateNewId(); 1365var projectId = ProjectId.CreateNewId(); 1400var projectId = ProjectId.CreateNewId(); 1435var projectId = ProjectId.CreateNewId(); 1451Assert.Throws<InvalidOperationException>(() => solution.WithProjectAssemblyName(ProjectId.CreateNewId(), "x.dll")); 1457var projectId = ProjectId.CreateNewId(); 1475Assert.Throws<InvalidOperationException>(() => solution.WithProjectOutputFilePath(ProjectId.CreateNewId(), "x.dll")); 1481var projectId = ProjectId.CreateNewId(); 1512var projectId = ProjectId.CreateNewId(); 1529Assert.Throws<InvalidOperationException>(() => solution.WithProjectOutputRefFilePath(ProjectId.CreateNewId(), "x.dll")); 1535var projectId = ProjectId.CreateNewId(); 1552Assert.Throws<InvalidOperationException>(() => solution.WithProjectCompilationOutputInfo(ProjectId.CreateNewId(), info)); 1558var projectId = ProjectId.CreateNewId(); 1575Assert.Throws<InvalidOperationException>(() => solution.WithProjectDefaultNamespace(ProjectId.CreateNewId(), "x")); 1581var projectId = ProjectId.CreateNewId(); 1598var projectId = ProjectId.CreateNewId(); 1672var projectId = ProjectId.CreateNewId(); 1689Assert.Throws<InvalidOperationException>(() => solution.WithProjectName(ProjectId.CreateNewId(), "x")); 1695var projectId = ProjectId.CreateNewId(); 1712Assert.Throws<InvalidOperationException>(() => solution.WithProjectFilePath(ProjectId.CreateNewId(), "x")); 1718var projectId = ProjectId.CreateNewId(); 1728Assert.Throws<InvalidOperationException>(() => solution.WithProjectCompilationOptions(ProjectId.CreateNewId(), options)); 1734var projectId = ProjectId.CreateNewId(); 1760var projectId = ProjectId.CreateNewId(); 1777Assert.Throws<InvalidOperationException>(() => solution.WithProjectParseOptions(ProjectId.CreateNewId(), options)); 1783var projectId = ProjectId.CreateNewId(); 1817var projectId = ProjectId.CreateNewId(); 1855var projectId = ProjectId.CreateNewId(); 1874var projectId = ProjectId.CreateNewId(); 1893var projectId = ProjectId.CreateNewId(); 1914var projectId = solution.Projects.Single().Id; 1916var projectId2 = ProjectId.CreateNewId(); 1935Assert.Throws<InvalidOperationException>(() => solution.WithProjectReferences(ProjectId.CreateNewId(), [projectRef])); 1947var projectId = solution.Projects.Single().Id; 1948var externalProjectRef = new ProjectReference(ProjectId.CreateNewId()); 1963var projectId = solution.Projects.Single().Id; 1964var projectId2 = ProjectId.CreateNewId(); 1965var projectId3 = ProjectId.CreateNewId(); 1973var externalProjectRef = new ProjectReference(ProjectId.CreateNewId()); 2005var projectId = solution.Projects.Single().Id; 2007var projectId2 = ProjectId.CreateNewId(); 2010var externalProjectRef = new ProjectReference(ProjectId.CreateNewId()); 2029Assert.Throws<ArgumentException>("projectReference", () => solution.RemoveProjectReference(projectId, new ProjectReference(ProjectId.CreateNewId()))); 2032Assert.Throws<InvalidOperationException>(() => solution.RemoveProjectReference(ProjectId.CreateNewId(), projectRef2)); 2041var projectId0 = ProjectId.CreateNewId(); 2042var submissionId1 = ProjectId.CreateNewId(); 2043var submissionId2 = ProjectId.CreateNewId(); 2044var submissionId3 = ProjectId.CreateNewId(); 2076var projectId = solution.Projects.Single().Id; 2086Assert.Throws<InvalidOperationException>(() => solution.WithProjectMetadataReferences(ProjectId.CreateNewId(), [metadataRef])); 2094var projectId = solution.Projects.Single().Id; 2119var projectId = solution.Projects.Single().Id; 2138Assert.Throws<InvalidOperationException>(() => solution.RemoveMetadataReference(ProjectId.CreateNewId(), metadataRef1)); 2146var projectId = solution.Projects.Single().Id; 2156Assert.Throws<InvalidOperationException>(() => solution.WithProjectAnalyzerReferences(ProjectId.CreateNewId(), [analyzerRef])); 2164var projectId = solution.Projects.Single().Id; 2192var projectId = solution.Projects.Single().Id; 2211Assert.Throws<InvalidOperationException>(() => solution.RemoveAnalyzerReference(ProjectId.CreateNewId(), analyzerRef1)); 2359var projectId = ProjectId.CreateNewId(); 2378Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", loader)); 2384var projectId = ProjectId.CreateNewId(); 2409Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", "text")); 2415var projectId = ProjectId.CreateNewId(); 2437Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", sourceText)); 2443var projectId = ProjectId.CreateNewId(); 2466Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", syntaxRoot: root)); 2472var projectId = ProjectId.CreateNewId(); 2503var projectId = ProjectId.CreateNewId(); 2530var pid = ProjectId.CreateNewId(); 2543var project1 = ProjectId.CreateNewId(); 2555var project1 = ProjectId.CreateNewId(); 2556var project2 = ProjectId.CreateNewId(); 2565var pid = ProjectId.CreateNewId(); 2590var pid2 = solution.Projects.Single().Id; 2609var projectId = ProjectId.CreateNewId(); 2632var projectId1 = ProjectId.CreateNewId(); 2633var projectId2 = ProjectId.CreateNewId(); 2659var projectId1 = ProjectId.CreateNewId(); 2660var projectId2 = ProjectId.CreateNewId(); 2685var projectId = ProjectId.CreateNewId(); 2705var projectId1 = ProjectId.CreateNewId(); 2706var projectId2 = ProjectId.CreateNewId(); 2727var projectId1 = ProjectId.CreateNewId(); 2728var projectId2 = ProjectId.CreateNewId(); 2746var projectId1 = ProjectId.CreateNewId(); 2747var projectId2 = ProjectId.CreateNewId(); 2765var projectId1 = ProjectId.CreateNewId(); 2766var projectId2 = ProjectId.CreateNewId(); 2800var pm1 = ProjectId.CreateNewId(); 2801var pm2 = ProjectId.CreateNewId(); 2818var pm1 = ProjectId.CreateNewId(); 2819var pm2 = ProjectId.CreateNewId(); 2924var projectIds = Enumerable.Range(0, 5).Select(i => ProjectId.CreateNewId()).ToArray(); 2944var project1 = ProjectId.CreateNewId(); 2982var project1 = ProjectId.CreateNewId(); 3040var project1 = ProjectId.CreateNewId(); 3059var pid = ProjectId.CreateNewId(); 3078var pid = ProjectId.CreateNewId(); 3079var pid2 = ProjectId.CreateNewId(); 3104var pid = ProjectId.CreateNewId(); 3105var pid2 = ProjectId.CreateNewId(); 3134var pid = ProjectId.CreateNewId(); 3156var projectId = ProjectId.CreateNewId(); 3178var pid = ProjectId.CreateNewId(); 3216var pid = ProjectId.CreateNewId(); 3257var projectId = ProjectId.CreateNewId(); 3297var pid = ProjectId.CreateNewId(); 3321var pid = ProjectId.CreateNewId(); 3341var pid = ProjectId.CreateNewId(); 3364var pid = ProjectId.CreateNewId(); 3388var pid = ProjectId.CreateNewId(); 3408var pid = ProjectId.CreateNewId(); 3429var pid = ProjectId.CreateNewId(); 3451var pid = ProjectId.CreateNewId(); 3471var pid = ProjectId.CreateNewId(); 3491var pid = ProjectId.CreateNewId(); 3510var pid = ProjectId.CreateNewId(); 3541var pid = ProjectId.CreateNewId(); 3572var pid = ProjectId.CreateNewId(); 3598var pid = ProjectId.CreateNewId(); 3625var pid = ProjectId.CreateNewId(); 3649var pid = ProjectId.CreateNewId(); 3714var pid = ProjectId.CreateNewId(); 3729private static ObjectReference<Compilation> GetObservedCompilationAsync(Solution solution, ProjectId projectId) 3739var pid = ProjectId.CreateNewId(); 3754private static ObjectReference<Compilation> GetObservedCompilation(Solution solution, ProjectId projectId) 3768var pid = ProjectId.CreateNewId(); 3907var pid = ProjectId.CreateNewId(); 3932var pid1 = ProjectId.CreateNewId("p1"); 3933var pid2 = ProjectId.CreateNewId("p2"); 3934var pid3 = ProjectId.CreateNewId("p3"); 4018ProjectId.CreateNewId(), 4026ProjectId.CreateNewId(), 4046ProjectId.CreateNewId(), 4056ProjectId.CreateNewId(), 4219ProjectId.CreateNewId(), 4228ProjectId.CreateNewId(), 4564var pid = ProjectId.CreateNewId(); 4635var pid = ProjectId.CreateNewId(); 4673var projectId = ProjectId.CreateNewId(); 4709var projectId = ProjectId.CreateNewId(); 4750var projectId = ProjectId.CreateNewId(); 4795var projectId = ProjectId.CreateNewId(); 4826var projectId = ProjectId.CreateNewId(); 4877var projectId = ProjectId.CreateNewId(); 4897var projectId = ProjectId.CreateNewId(); 4918var projectId = ProjectId.CreateNewId(); 4936var projectId = ProjectId.CreateNewId(); 4960var projectId1 = ProjectId.CreateNewId(); 4961var projectId2 = ProjectId.CreateNewId(); 4982var projectId1 = ProjectId.CreateNewId(); 4983var projectId2 = ProjectId.CreateNewId(); 5010var projectId1 = ProjectId.CreateNewId(); 5011var projectId2 = ProjectId.CreateNewId(); 5038var projectId1 = ProjectId.CreateNewId(); 5039var projectId2 = ProjectId.CreateNewId(); 5040var projectId3 = ProjectId.CreateNewId(); 5067var projectId1 = ProjectId.CreateNewId(); 5068var projectId2 = ProjectId.CreateNewId(); 5069var projectId3 = ProjectId.CreateNewId(); 5098var projectId1 = ProjectId.CreateNewId(); 5099var projectId2 = ProjectId.CreateNewId(); 5100var projectId3 = ProjectId.CreateNewId(); 5136var projectId1 = ProjectId.CreateNewId(); 5153var projectId1 = ProjectId.CreateNewId(); 5154var projectId2 = ProjectId.CreateNewId(); 5155var projectId3 = ProjectId.CreateNewId(); 5177using var _2 = ArrayBuilder<ProjectId>.GetInstance(out var projectsToRemove); 5199var projectId1 = ProjectId.CreateNewId(); 5200var projectId2 = ProjectId.CreateNewId(); 5201var projectId3 = ProjectId.CreateNewId(); 5221using var _2 = ArrayBuilder<ProjectId>.GetInstance(out var projectsToRemove); 5243var projectId1 = ProjectId.CreateNewId(); 5244var projectId2 = ProjectId.CreateNewId(); 5254using var _2 = ArrayBuilder<ProjectId>.GetInstance(out var projectsToRemove); 5267var csProjectId = ProjectId.CreateNewId(); 5268var vbProjectId = ProjectId.CreateNewId(); 5324ProjectId.CreateNewId(), 5333ProjectId.CreateNewId(), 5342ProjectId.CreateNewId(), 5352ProjectId.CreateNewId(), 5362ProjectId.CreateNewId(), 5372ProjectId.CreateNewId(), 5420var pid = ProjectId.CreateNewId(); 5503var projectId = ProjectId.CreateNewId();
SolutionTests\SolutionWithSourceGeneratorTests.cs (6)
423var projectIdWithGenerator = solution.ProjectIds.Single(); 424var projectIdWithReference = ProjectId.CreateNewId(); 662var projectIdWithGenerator = solution.ProjectIds.Single(); 905var projectId1 = solution.ProjectIds.Single(); 908var projectId2 = project2.Id;
SolutionTests\SourceGeneratorExecutionVersionMapTests.cs (6)
19var projectId1 = ProjectId.CreateNewId(); 20var projectId2 = ProjectId.CreateNewId(); 23var project1Kvp = new KeyValuePair<ProjectId, SourceGeneratorExecutionVersion>(projectId1, new(MajorVersion: 1, MinorVersion: 1)); 24var project2Kvp = new KeyValuePair<ProjectId, SourceGeneratorExecutionVersion>(projectId2, new(MajorVersion: 2, MinorVersion: 2));
SolutionTests\TryApplyChangesTests.cs (1)
39OnProjectAdded(ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Default, "TestProject", "TestProject", LanguageNames.CSharp));
SyntaxNodeTests.cs (2)
82var pid = ProjectId.CreateNewId();
SyntaxReferenceTests.cs (4)
27var pid = ProjectId.CreateNewId(); 37var pid = ProjectId.CreateNewId();
WorkspaceTests\AdhocWorkspaceTests.cs (25)
29ProjectId.CreateNewId(), 84ProjectId.CreateNewId(), 109var id1 = ProjectId.CreateNewId(); 117var id2 = ProjectId.CreateNewId(); 150var pid = ProjectId.CreateNewId(); 187var pid = ProjectId.CreateNewId(); 212var pid = ProjectId.CreateNewId(); 246var pid = ProjectId.CreateNewId(); 280var pid = ProjectId.CreateNewId(); 319var pid = ProjectId.CreateNewId(); 377var projid = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 406public void SetParseOptions(ProjectId id, ParseOptions options) 414var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 445var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 480var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 512var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 543var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id;
WorkspaceTests\WorkspaceReferenceTests.cs (8)
22ProjectId.CreateNewId(), 51ProjectId.CreateNewId(), 61ProjectId.CreateNewId(), 91ProjectId.CreateNewId(), 101ProjectId.CreateNewId(), 131ProjectId.CreateNewId(), 141ProjectId.CreateNewId(), 175ProjectId.CreateNewId(),
WorkspaceTests\WorkspaceTests.cs (8)
24var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 37var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 53var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 71var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 88var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 104var projectId = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 129var info = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), name, name, language); 147public Document AddDocument(ProjectId projectId, string name, SourceText text)
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.ML.CodeAnalyzer.Tests (1)
Code\RelaxTestNamingTest.cs (1)
22private static Solution WithoutSuppressedDiagnosticsTransform(Solution solution, ProjectId projectId)
Microsoft.VisualStudio.LanguageServices (194)
CallHierarchy\Finders\AbstractCallFinder.cs (2)
24private readonly ProjectId _projectId; 35ProjectId projectId,
CallHierarchy\Finders\BaseMemberFinder.cs (1)
21public BaseMemberFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider)
CallHierarchy\Finders\CallToOverrideFinder.cs (1)
18public CallToOverrideFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider)
CallHierarchy\Finders\FieldReferenceFinder.cs (1)
19public FieldReferenceFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider)
CallHierarchy\Finders\ImplementerFinder.cs (1)
22public ImplementerFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider)
CallHierarchy\Finders\InterfaceImplementationCallFinder.cs (1)
22public InterfaceImplementationCallFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider)
CallHierarchy\Finders\MethodCallFinder.cs (1)
20public MethodCallFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider)
CallHierarchy\Finders\OverridingMemberFinder.cs (1)
22public OverridingMemberFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider)
CodeCleanup\AbstractCodeCleanUpFixer.cs (1)
73ProjectId? projectId = null;
CodeLens\CodeLensCallbackListener.cs (2)
227var projectId = ProjectId.CreateFromSerialized(projectIdGuid);
CodeLens\RemoteCodeLensReferencesService.cs (2)
36public ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken) 145ProjectId.CreateFromSerialized(descriptor.ProjectGuid), descriptor.DocumentGuid);
CodeModel\IProjectCodeModelFactory.cs (2)
13IProjectCodeModel CreateProjectCodeModel(ProjectId id, ICodeModelInstanceFactory codeModelInstanceFactory); 14EnvDTE.FileCodeModel GetOrCreateFileCodeModel(ProjectId id, string filePath);
DesignerAttribute\VisualStudioDesignerAttributeService.cs (5)
49private readonly ConcurrentDictionary<ProjectId, IProjectItemDesignerTypeUpdateService?> _cpsProjects = []; 163ProjectId projectId, 177ProjectId projectId, 235ProjectId projectId, 275ProjectId projectId, CancellationToken cancellationToken)
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (1)
354if (projectMap.TryGetProjectId(projectHierarchyItem, targetFrameworkMoniker: null, out var projectId))
ExternalAccess\VSTypeScript\Api\VSTypeScriptContainedLanguageWrapper.cs (2)
62var projectId = ProjectId.CreateNewId();
ExternalAccess\VSTypeScript\Api\VSTypeScriptVisualStudioProjectWrapper.cs (1)
16public ProjectId Id => Project.Id;
Implementation\AbstractEditorFactory.cs (1)
299foreach (var projectId in solution.ProjectIds)
Implementation\HierarchyItemToProjectIdMap.cs (1)
26public bool TryGetProjectId(IVsHierarchyItem hierarchyItem, string? targetFrameworkMoniker, [NotNullWhen(true)] out ProjectId? projectId)
Implementation\IHierarchyItemToProjectIdMap.cs (3)
19/// returns the <see cref="ProjectId"/> of the equivalent Roslyn <see cref="Project"/>. 25/// <param name="projectId">The <see cref="ProjectId"/> of the found project, if any.</param> 27bool TryGetProjectId(IVsHierarchyItem hierarchyItem, string? targetFrameworkMoniker, [NotNullWhen(true)] out ProjectId? projectId);
LanguageService\AbstractCreateServicesOnTextViewConnection.cs (5)
32private readonly AsyncBatchingWorkQueue<ProjectId?> _workQueue; 52_workQueue = new AsyncBatchingWorkQueue<ProjectId?>( 55EqualityComparer<ProjectId?>.Default, 68_workQueue.AddWork((ProjectId?)null); 76private async ValueTask BatchProcessProjectsWithOpenedDocumentAsync(ImmutableSegmentedList<ProjectId?> projectIds, CancellationToken cancellationToken)
Library\ObjectBrowser\AbstractListItemFactory.cs (25)
69protected MemberListItem CreateFullyQualifiedMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden) 78protected MemberListItem CreateInheritedMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden) 81protected MemberListItem CreateSimpleMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden) 84private MemberListItem CreateMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden, bool isInherited) 98protected TypeListItem CreateSimpleTypeListItem(INamedTypeSymbol namedTypeSymbol, ProjectId projectId, bool hidden) 111protected TypeListItem CreateFullyQualifiedTypeListItem(INamedTypeSymbol namedTypeSymbol, ProjectId projectId, bool hidden) 124protected NamespaceListItem CreateNamespaceListItem(INamespaceSymbol namespaceSymbol, ProjectId projectId) 170ProjectId projectId, 171Func<TSymbol, ProjectId, bool, ObjectListItem> listItemCreator) 184ProjectId projectId, 185Func<TSymbol, ProjectId, bool, ObjectListItem> listItemCreator, 205private ImmutableArray<ObjectListItem> GetBaseTypeListItems(INamedTypeSymbol namedTypeSymbol, Compilation compilation, ProjectId projectId) 293ProjectId projectId, 405public void CollectNamespaceListItems(IAssemblySymbol assemblySymbol, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 456private class AssemblySymbolComparer : IEqualityComparer<(ProjectId, IAssemblySymbol)> 458public bool Equals((ProjectId, IAssemblySymbol) x, (ProjectId, IAssemblySymbol) y) 461public int GetHashCode((ProjectId, IAssemblySymbol) obj) 465public async Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync( 470foreach (var projectId in solution.ProjectIds) 507public async Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Project project, bool lookInReferences, CancellationToken cancellationToken) 597foreach (var projectId in projectIds) 690ProjectId projectId, 743public void CollectTypeListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 775public void CollectMemberListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (3)
184internal Project GetProject(ProjectId projectId) 189var projectId = listItem.ProjectId; 199ProjectId projectId, CancellationToken cancellationToken)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_ListItems.cs (5)
17internal void CollectMemberListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 20internal void CollectNamespaceListItems(IAssemblySymbol assemblySymbol, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 23internal void CollectTypeListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 26internal Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Solution solution, string languageName, CancellationToken cancellationToken) 29internal Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Project project, bool lookInReferences, CancellationToken cancellationToken)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_Search.cs (4)
41ImmutableHashSet<(ProjectId, IAssemblySymbol)> projectAndAssemblySet, 58var projectId = projectIdAndAssembly.Item1; 73var projectId = projectIdAndAssembly.Item1; 92var projectId = projectIdAndAssembly.Item1;
Library\ObjectBrowser\Lists\FolderListItem.cs (1)
16public FolderListItem(ProjectId projectId, string displayText)
Library\ObjectBrowser\Lists\MemberListItem.cs (1)
14internal MemberListItem(ProjectId projectId, ISymbol symbol, string displayText, string fullNameText, string searchText, bool isHidden, bool isInherited)
Library\ObjectBrowser\Lists\NamespaceListItem.cs (1)
13public NamespaceListItem(ProjectId projectId, INamespaceSymbol namespaceSymbol, string displayText, string fullNameText, string searchText)
Library\ObjectBrowser\Lists\ReferenceListItem.cs (1)
16public ReferenceListItem(ProjectId projectId, string name, MetadataReference reference)
Library\ObjectBrowser\Lists\SymbolListItem.cs (1)
23protected SymbolListItem(ProjectId projectId, ISymbol symbol, string displayText, string fullNameText, string searchText, bool isHidden)
Library\ObjectBrowser\Lists\SymbolListItem`1.cs (1)
14protected SymbolListItem(ProjectId projectId, TSymbol symbol, string displayText, string fullNameText, string searchText, bool isHidden)
Library\ObjectBrowser\Lists\TypeListItem.cs (1)
13internal TypeListItem(ProjectId projectId, INamedTypeSymbol typeSymbol, string displayText, string fullNameText, string searchText, bool isHidden)
Library\ObjectBrowser\ObjectListItem.cs (2)
20ProjectId projectId, 71public ProjectId ProjectId { get; }
Packaging\PackageInstallerServiceFactory.cs (14)
79private readonly AsyncBatchingWorkQueue<(bool solutionChanged, ProjectId? changedProject)> _workQueue; 81private readonly ConcurrentDictionary<ProjectId, ProjectState> _projectToInstalledPackageAndVersion = []; 130_workQueue = new AsyncBatchingWorkQueue<(bool solutionChanged, ProjectId? changedProject)>( 133equalityComparer: EqualityComparer<(bool solutionChanged, ProjectId? changedProject)>.Default, 197bool IPackageInstallerService.IsEnabled(ProjectId projectId) 274var projectId = documentId.ProjectId; 428ProjectId? changedProject = null; 456ImmutableSegmentedList<(bool solutionChanged, ProjectId? changedProject)> workQueue, CancellationToken cancellationToken) 471ImmutableSegmentedList<(bool solutionChanged, ProjectId? changedProject)> workQueue, CancellationToken cancellationToken) 478using var _ = PooledHashSet<ProjectId>.GetInstance(out var projectsToProcess); 520ImmutableSegmentedList<(bool solutionChanged, ProjectId? changedProject)> workQueue, Solution solution, HashSet<ProjectId> projectsToProcess) 541ProjectId projectId, 604public bool IsInstalled(ProjectId projectId, string packageName)
Preview\ReferenceChange.AnalyzerReferenceChange.cs (1)
18public AnalyzerReferenceChange(AnalyzerReference reference, ProjectId projectId, string projectName, bool isAdded, PreviewEngine engine)
Preview\ReferenceChange.cs (3)
18protected ReferenceChange(ProjectId projectId, string projectName, bool isAddedReference, PreviewEngine engine) 30var projectId = projectChanges.ProjectId; 70protected ProjectId ProjectId { get; }
Preview\ReferenceChange.MetadataReferenceChange.cs (1)
17public MetadataReferenceChange(MetadataReference reference, ProjectId projectId, string projectName, bool isAdded, PreviewEngine engine)
Preview\ReferenceChange.ProjectReferenceChange.cs (1)
18public ProjectReferenceChange(ProjectReference reference, string projectReferenceName, ProjectId projectId, string projectName, bool isAdded, PreviewEngine engine)
Progression\GraphBuilder.cs (3)
117var projectId = (ProjectId)inputNode[RoslynGraphProperties.ContextProjectId]; 160public ProjectId GetContextProjectId(Project project, ISymbol symbol)
Progression\GraphNavigatorExtension.cs (4)
41var projectId = graphNode.GetValue<ProjectId>(RoslynGraphProperties.ContextProjectId); 106var projectId = graphNode.GetValue<ProjectId>(RoslynGraphProperties.ContextProjectId);
Progression\GraphQueries\IsUsedByGraphQuery.cs (2)
32var projectId = graphBuilder.GetContextProject(node, cancellationToken).Id; 50private static GraphNode? GetLocationNode(Location location, IGraphContext context, ProjectId projectId, CancellationToken cancellationToken)
Progression\RoslynGraphProperties.cs (1)
110dataType: typeof(ProjectId),
ProjectSystem\CPS\IWorkspaceProjectContext.cs (1)
37ProjectId Id { get; }
ProjectSystem\Legacy\AbstractLegacyProject.cs (1)
97foreach (var projectId in Workspace.CurrentSolution.ProjectIds)
ProjectSystem\MetadataReferences\VisualStudioFrameworkAssemblyPathResolverFactory.cs (2)
45ProjectId projectId, 107private Assembly? ResolveAssembly(ProjectId projectId, string assemblyName)
ProjectSystem\MiscellaneousFilesWorkspace.cs (3)
48/// The mapping of all monikers in the RDT and the <see cref="ProjectId"/> of the project and <see cref="SourceTextContainer"/> of the open 51private readonly Dictionary<string, (ProjectId projectId, SourceTextContainer textContainer)> _monikersToProjectIdAndContainer = new Dictionary<string, (ProjectId, SourceTextContainer)>();
ProjectSystem\VisualStudioProjectManagementService.cs (1)
60public IList<string> GetFolders(ProjectId projectId, Workspace workspace)
ProjectSystem\VisualStudioWorkspace.cs (4)
41/// <param name="projectId">The <see cref="ProjectId"/> for the project.</param> 43public abstract IVsHierarchy? GetHierarchy(ProjectId projectId); 45internal abstract Guid GetProjectGuid(ProjectId projectId); 80internal abstract string? TryGetRuleSetPathForProject(ProjectId projectId);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddRemoveUndoUnit.cs (2)
15protected readonly ProjectId FromProjectId; 20ProjectId fromProjectId)
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
22ProjectId fromProjectId,
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (3)
15private readonly ProjectId _toProjectId; 19ProjectId fromProjectId, 20ProjectId toProjectId)
ProjectSystem\VisualStudioWorkspaceImpl.cs (32)
84private ImmutableDictionary<ProjectId, IVsHierarchy?> _projectToHierarchyMap = ImmutableDictionary<ProjectId, IVsHierarchy?>.Empty; 85private ImmutableDictionary<ProjectId, Guid> _projectToGuidMap = ImmutableDictionary<ProjectId, Guid>.Empty; 89/// <see cref="TryGetRuleSetPathForProject(ProjectId)"/> and any other use is extremely suspicious, since direct use of this is out of 93private ImmutableDictionary<ProjectId, Func<string?>> _projectToRuleSetFilePath = ImmutableDictionary<ProjectId, Func<string?>>.Empty; 276internal override string? TryGetRuleSetPathForProject(ProjectId projectId) 366internal bool IsCPSProject(ProjectId projectId) 378internal bool IsPrimaryProject(ProjectId projectId) 439private bool TryGetProjectData(ProjectId projectId, [NotNullWhen(returnValue: true)] out IVsHierarchy? hierarchy, [NotNullWhen(returnValue: true)] out EnvDTE.Project? project) 448internal void GetProjectData(ProjectId projectId, out IVsHierarchy hierarchy, out EnvDTE.Project project) 456internal EnvDTE.Project? TryGetDTEProject(ProjectId projectId) 459internal bool TryAddReferenceToProject(ProjectId projectId, string assemblyName) 482protected override void ApplyCompilationOptionsChanged(ProjectId projectId, CompilationOptions options) 500protected override void ApplyParseOptionsChanged(ProjectId projectId, ParseOptions options) 517protected override void ApplyAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 539protected override void ApplyAnalyzerReferenceRemoved(ProjectId projectId, AnalyzerReference analyzerReference) 572ProjectId projectId, MetadataReference metadataReference) 598ProjectId projectId, MetadataReference metadataReference) 655async Task<MultiDictionary<string, (TextChange TextChange, ProjectId ProjectId)>> GetMappedTextChangesAsync(SolutionChanges solutionChanges) 657var filePathToMappedTextChanges = new MultiDictionary<string, (TextChange TextChange, ProjectId ProjectId)>(); 691ProjectId projectId, ProjectReference projectReference) 731ProjectId projectId, ProjectReference projectReference) 1096internal void OpenDocumentFromPath(string? filePath, ProjectId projectId, bool activate = true) 1117private bool TryGetFrame(string? filePath, ProjectId projectId, [NotNullWhen(returnValue: true)] out IVsWindowFrame? frame) 1328public override IVsHierarchy? GetHierarchy(ProjectId projectId) 1334internal override Guid GetProjectGuid(ProjectId projectId) 1340internal string? TryGetDependencyNodeTargetIdentifier(ProjectId projectId) 1417internal bool TryGetHierarchy(ProjectId projectId, [NotNullWhen(returnValue: true)] out IVsHierarchy? hierarchy) 1469internal override bool CanAddProjectReference(ProjectId referencingProject, ProjectId referencedProject)
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (5)
145ProjectId activeContextProjectId; 186private ProjectId GetActiveContextProjectIdAndWatchHierarchies_NoLock(string moniker, IEnumerable<ProjectId> projectIds, IVsHierarchy? hierarchy) 246var matchingProjectId = projectIds.FirstOrDefault(id => projectToHierarchyMap.GetValueOrDefault(id, null) == hierarchy); 286var activeProjectId = GetActiveContextProjectIdAndWatchHierarchies_NoLock(moniker, documentIds.Select(d => d.ProjectId), hierarchy);
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
21ProjectId fromProjectId,
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (3)
15private readonly ProjectId _toProjectId; 19ProjectId fromProjectId, 20ProjectId toProjectId)
ProjectSystem\VisualStudioWorkspaceImpl_SourceGenerators.cs (1)
72foreach (var projectId in documentIds.Select(i => i.ProjectId).Distinct())
Snippets\SnippetExpansionClient.cs (1)
1086var projectId = originalProject.Id;
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (4)
132ProjectId? projectIdToMatch = null; 136if (projectMap.TryGetProjectId(projectHierarchyItem, targetFrameworkMoniker: null, out var projectId)) 477var projectId = group.Key; 546var builder = ImmutableDictionary.CreateBuilder<ProjectId, List<DiagnosticData>>();
TaskList\ExternalErrorDiagnosticUpdateSource.cs (11)
109public bool IsSupportedDiagnosticId(ProjectId projectId, string id) 112public void ClearErrors(ProjectId projectId) 142public void AddNewErrors(ProjectId projectId, Guid projectHierarchyGuid, ImmutableArray<DiagnosticData> diagnostics) 155private async Task ClearPreviousAsync(ProjectId? projectId, CancellationToken cancellationToken) 169private async ValueTask ProcessDiagnosticsReportAsync(ProjectId projectId, Guid projectHierarchyGuid, ImmutableArray<DiagnosticData> diagnostics, InProgressState state, CancellationToken cancellationToken) 198private static Microsoft.VisualStudio.RpcContracts.DiagnosticManagement.Diagnostic? CreateDiagnostic(ProjectId projectId, Guid projectHierarchyGuid, DiagnosticData diagnostic, Solution solution) 321private readonly Dictionary<ProjectId, ImmutableHashSet<string>> _allDiagnosticIdMap = []; 331public bool IsSupportedDiagnosticId(ProjectId projectId, string id) 335ProjectId projectId, 336Dictionary<ProjectId, ImmutableHashSet<string>> diagnosticIdMap, 356private ImmutableHashSet<string> GetOrCreateSupportedDiagnosticIds(ProjectId projectId)
TaskList\ProjectExternalErrorReporter.cs (3)
35private readonly ProjectId _projectId; 48public ProjectExternalErrorReporter(ProjectId projectId, Guid projectHierarchyGuid, string errorCodePrefix, string language, VisualStudioWorkspaceImpl workspace) 264ProjectId projectId,
Venus\ContainedLanguage.cs (1)
71ProjectId projectId,
Workspace\VisualStudioAddMetadataReferenceCodeActionOperationFactoryWorkspaceService.cs (3)
29public CodeActionOperation CreateAddMetadataReferenceOperation(ProjectId projectId, AssemblyIdentity assemblyIdentity) 47private readonly ProjectId _projectId; 49public AddMetadataReferenceOperation(ProjectId projectId, AssemblyIdentity assemblyIdentity)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
643public override EnvDTE.CodeTypeRef CreateCodeTypeRef(CodeModelState state, ProjectId projectId, object type)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (6)
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (2)
24var projectId = ProjectId.CreateNewId();
EditorConfigSettings\DataProvider\DataProviderTests.cs (2)
27var projectId = ProjectId.CreateNewId();
PersistentStorage\AbstractPersistentStorageTests.cs (1)
988solution = solution.AddProject(ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), "Project1", "Project1", LanguageNames.CSharp,
ProjectSystemShim\CPS\AnalyzersTests.cs (1)
76ProjectId projectId;
Microsoft.VisualStudio.LanguageServices.LiveShare (12)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (2)
89var projectId = ProjectId.CreateNewId();
Client\Razor\CSharpLspContainedLanguageProvider.cs (1)
42var projectId = _razorProjectFactory.GetProject(filePath);
Client\Razor\CSharpLspRazorProjectFactory.cs (4)
17private readonly Dictionary<string, ProjectId> _projects = []; 19public ProjectId GetProject(string projectName) 21if (_projects.TryGetValue(projectName, out var projectId)) 26var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(projectName), VersionStamp.Default, projectName, projectName, LanguageNames.CSharp);
Client\RemoteLanguageServiceWorkspace.cs (1)
322ProjectId.CreateNewId(),
Client\RemoteLanguageServiceWorkspaceHost.cs (4)
37private ImmutableDictionary<string, ProjectId> _loadedProjects = ImmutableDictionary.Create<string, ProjectId>(StringComparer.OrdinalIgnoreCase); 120if (!_loadedProjects.TryGetValue(projectName, out var projectId)) 152foreach (var projectId in _loadedProjects.Values)
Microsoft.VisualStudio.LanguageServices.UnitTests (6)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (4)
282Private Shared Function GetDiagnosticData(projectId As ProjectId, Optional id As String = "id") As DiagnosticData 323Public Function GetCachedDiagnosticsAsync(workspace As Workspace, projectId As ProjectId, documentId As DocumentId, includeSuppressedDiagnostics As Boolean, includeLocalDocumentDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetCachedDiagnosticsAsync 327Public Function GetDiagnosticsForIdsAsync(solution As Solution, projectId As ProjectId, documentId As DocumentId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), getDocuments As Func(Of Project, DocumentId, IReadOnlyList(Of DocumentId)), includeSuppressedDiagnostics As Boolean, includeLocalDocumentDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetDiagnosticsForIdsAsync 331Public Function GetProjectDiagnosticsForIdsAsync(solution As Solution, projectId As ProjectId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), includeSuppressedDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetProjectDiagnosticsForIdsAsync
GenerateType\GenerateTypeViewModelTests.vb (1)
883Public Function GetFolders(projectId As ProjectId, workspace As Microsoft.CodeAnalysis.Workspace) As IList(Of String) Implements IProjectManagementService.GetFolders
SolutionExplorer\SourceGeneratorItemTests.vb (1)
267Private Shared Function CreateItemSourceForAnalyzerReference(workspace As EditorTestWorkspace, projectId As ProjectId) As BaseDiagnosticAndGeneratorItemSource
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
709Public Overrides Function CreateCodeTypeRef(state As CodeModelState, projectId As ProjectId, type As Object) As EnvDTE.CodeTypeRef
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\Handler\Completion\CompletionResolveHandler.cs (1)
65var documentId = DocumentId.CreateFromSerialized(ProjectId.CreateFromSerialized(data.ProjectGuid), data.DocumentGuid);
Roslyn.VisualStudio.Next.UnitTests (66)
Services\ServiceHubServicesTests.cs (56)
285ProjectId projectId1 = null; 286ProjectId projectId2 = null; 350var p1 = ProjectId.CreateNewId(); 351var p2 = ProjectId.CreateNewId(); 427var projectId = ProjectId.CreateNewId(); 766var projectId = ProjectId.CreateNewId(); 906var projectId1 = ProjectId.CreateNewId(); 907var projectId2 = ProjectId.CreateNewId(); 957var projectId1 = ProjectId.CreateNewId(); 958var projectId2 = ProjectId.CreateNewId(); 998var projectId1 = ProjectId.CreateNewId(); 999var projectId2 = ProjectId.CreateNewId(); 1041var projectId1 = ProjectId.CreateNewId(); 1042var projectId2 = ProjectId.CreateNewId(); 1093var projectId1 = ProjectId.CreateNewId(); 1094var projectId2 = ProjectId.CreateNewId(); 1146var projectId1 = ProjectId.CreateNewId(); 1147var projectId2 = ProjectId.CreateNewId(); 1199var projectId1 = ProjectId.CreateNewId(); 1200var projectId2 = ProjectId.CreateNewId(); 1244var projectId1 = ProjectId.CreateNewId(); 1245var projectId2 = ProjectId.CreateNewId(); 1289var projectId1 = ProjectId.CreateNewId(); 1290var projectId2 = ProjectId.CreateNewId(); 1332var projectId1 = ProjectId.CreateNewId(); 1333var projectId2 = ProjectId.CreateNewId(); 1540var projectId1 = ProjectId.CreateNewId(); 1581var projectId = project.Id; 1587var currentProjectId = projectIds[i]; 1724private static Solution AddProject(Solution solution, string language, string[] documents, string[] additionalDocuments, ProjectId[] p2pReferences) 1731var projectId = project.Id;
Services\SolutionServiceTests.cs (9)
88ProjectId.CreateNewId(), VersionStamp.Create(), "test", "test.dll", LanguageNames.CSharp, 117ProjectId.CreateNewId(), VersionStamp.Create(), "test", "test.dll", LanguageNames.CSharp, 218foreach (var projectId in solution.ProjectIds) 253var projectId = solution.ProjectIds.Single(); 306var existingProjectId = s.ProjectIds.First(); 331var projectId = workspace.CurrentSolution.ProjectIds.First(); 362var projectId = workspace.CurrentSolution.ProjectIds.First(); 395var projectId = workspace.CurrentSolution.ProjectIds.First(); 924project1 = project1.AddProjectReference(new ProjectReference(ProjectId.CreateNewId()));
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
218private static async Task<DiagnosticAnalysisResult> AnalyzeAsync(TestWorkspace workspace, ProjectId projectId, Type analyzerType, bool isHostAnalyzer, CancellationToken cancellationToken = default)