781 references to Id
AnalyzerRunner (3)
CodeRefactoringRunner.cs (1)
106if (projectChanges.Length != 1 || projectChanges[0].ProjectId != document.Project.Id)
DiagnosticAnalyzerRunner.cs (2)
130projectPerformance[project.Id] = sumOfDocumentAverages / documentCount; 345projectDiagnosticTasks.Add(new KeyValuePair<ProjectId, Task<AnalysisResult>>(project.Id, resultTask));
Microsoft.Analyzers.Extra.Tests (2)
Resources\RoslynTestUtils.cs (2)
363var changedProj = solution.GetProject(proj.Id); 457var changedProj = solution.GetProject(proj.Id);
Microsoft.Analyzers.Local.Tests (2)
Resources\RoslynTestUtils.cs (2)
364var changedProj = solution.GetProject(proj.Id); 458var changedProj = solution.GetProject(proj.Id);
Microsoft.AspNetCore.Analyzer.Testing (1)
CodeFixRunner.cs (1)
36var updatedProject = updatedSolution.GetProject(document.Project.Id);
Microsoft.CodeAnalysis.Analyzers (1)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (1)
67var projectIds = diagnosticsToFix.SelectAsArray(d => d.Key.Id);
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
79foreach (var projectId in solution.Projects.Select(p => p.Id))
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
387var currentProject = currentSolution.GetRequiredProject(fieldDocument.Project.Id);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
42return project.Solution.WithProjectCompilationOptions(project.Id, compilationOptions.WithAllowUnsafe(true));
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
95return project.Solution.WithProjectParseOptions(project.Id, parseOptions.WithLanguageVersion(parsedNewVersion));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (30)
CodeActions\PreviewTests.cs (2)
73solution = solution.AddDocument(DocumentId.CreateNewId(_oldDocument.Project.Id, AddedDocumentName), AddedDocumentName, AddedDocumentText); 78solution = solution.RemoveMetadataReference(_oldDocument.Project.Id, removedReference);
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
164var additionalDocId = DocumentId.CreateNewId(workspace.CurrentSolution.Projects.Single().Id);
Formatting\CodeCleanupTests.cs (2)
830project = project.Solution.WithProjectFilePath(project.Id, @$"z:\\{project.FilePath}").GetRequiredProject(project.Id);
Formatting\CodeCleanupTests.TestFixers.cs (2)
116return solution.AddDocument(DocumentId.CreateNewId(project.Id), "new.cs", SourceText.From("")); 172return solution.AddDocument(DocumentId.CreateNewId(project.Id), "new.cs", SourceText.From(""));
Formatting\RazorLineFormattingOptionsTests.cs (1)
59DocumentId.CreateNewId(project.Id),
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
166Assert.Equal(project.Id, mappedProject!.Id);
SymbolKey\SymbolKeyTests.cs (3)
204Assert.True(bodyProject.Id == bodyLocalProjectId, $"Expected {bodyProject.Id} == {bodyLocalProjectId}. {i}"); 205Assert.Equal(referenceProject.Id, referenceAssemblyProjectId);
Workspaces\WorkspaceTests_EditorFeatures.cs (17)
285var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 286var id2 = snapshot.Projects.First(p => p.Name == project2.Name).Id; 324var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 325var id2 = snapshot.Projects.First(p => p.Name == project2.Name).Id; 411var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 433var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 434var id2 = snapshot.Projects.First(p => p.Name == project2.Name).Id; 461var id1 = snapshot.Projects.First(p => p.Name == project1.Name).Id; 462var id2 = snapshot.Projects.First(p => p.Name == project2.Name).Id; 498var id1 = solutionY.Projects.First(p => p.Name == project1.Name).Id; 499var id2 = solutionY.Projects.First(p => p.Name == project2.Name).Id; 556var id1 = solutionY.Projects.First(p => p.Name == project1.Name).Id; 557var id2 = solutionY.Projects.First(p => p.Name == project2.Name).Id; 628var id1 = solutionY.Projects.First(p => p.Name == project1.Name).Id; 629var id2 = solutionY.Projects.First(p => p.Name == project2.Name).Id; 1248var newDocId = DocumentId.CreateNewId(project.Id); 1284var newDocId = DocumentId.CreateNewId(project.Id);
Microsoft.CodeAnalysis.CSharp.Features (3)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
90solution = solution.WithProjectCompilationOptions(project.Id, compilationOptions.WithNullableContextOptions(NullableContextOptions.Enable));
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
42return project.Solution.WithProjectCompilationOptions(project.Id, compilationOptions.WithAllowUnsafe(true));
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
95return project.Solution.WithProjectParseOptions(project.Id, parseOptions.WithLanguageVersion(parsedNewVersion));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (3)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (3)
660var newDocId = DocumentId.CreateNewId(oldProject.Id); 706var newDocId = DocumentId.CreateNewId(oldProject.Id); 739var documentId = DocumentId.CreateNewId(oldProject.Id);
Microsoft.CodeAnalysis.EditorFeatures (15)
EditorConfigSettings\DataProvider\Analyzer\AnalyzerSettingsProvider.cs (2)
66var csharpDescriptors = await service.GetDiagnosticDescriptorsAsync(solution, someReferencingProject.Id, analyzerReference, LanguageNames.CSharp, cancellationToken).ConfigureAwait(false); 67var vbDescriptors = await service.GetDiagnosticDescriptorsAsync(solution, someReferencingProject.Id, analyzerReference, LanguageNames.VisualBasic, cancellationToken).ConfigureAwait(false);
Peek\PeekableItemFactory.cs (1)
90solution.Workspace, project.Id, symbolKey, peekResultFactory, _metadataAsSourceFileService, _globalOptions, _threadingContext));
Preview\AbstractPreviewFactoryService.cs (12)
110previewItems.Add(new SolutionPreviewItem(oldProject.Id, documentId, async c => 131previewItems.Add(new SolutionPreviewItem(oldProject.Id, documentId, async c => 152previewItems.Add(new SolutionPreviewItem(oldProject.Id, documentId, async c => 159previewItems.Add(new SolutionPreviewItem(oldProject.Id, documentId: null, 166previewItems.Add(new SolutionPreviewItem(oldProject.Id, documentId: null, 173previewItems.Add(new SolutionPreviewItem(oldProject.Id, documentId: null, 180previewItems.Add(new SolutionPreviewItem(oldProject.Id, documentId: null, 187previewItems.Add(new SolutionPreviewItem(oldProject.Id, documentId: null, 194previewItems.Add(new SolutionPreviewItem(oldProject.Id, documentId: null, 202previewItems.Add(new SolutionPreviewItem(project.Id, documentId: null, 209previewItems.Add(new SolutionPreviewItem(project.Id, documentId: null, 216previewItems.Add(new SolutionPreviewItem(projectChanges.OldProject.Id, documentId: null,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (27)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
981return workspace.AddDocument(project.Id, "Empty.cs", SourceText.From("class A { B B {get} }"));
Diagnostics\DiagnosticDataTests.cs (4)
131projectId: document.Project.Id, 164projectId: document.Project.Id, 199projectId: document.Project.Id, 297projectId: firstDocument.Project.Id,
EditAndContinue\EditAndContinueLanguageServiceTests.cs (2)
195project.Id, 271project.Id,
LanguageServer\VSTypeScriptHandlerTests.cs (2)
54var request = new TSRequest(document.GetURI(), ProtocolConversions.ProjectIdToProjectContextId(document.Project.Id)); 77TextDocument = CreateTextDocumentIdentifier(document.GetURI(), document.Project.Id)
Preview\PreviewWorkspaceTests.cs (1)
58var newSolution = previewWorkspace.CurrentSolution.RemoveProject(project.Id);
SymbolFinder\SymbolFinderTests.cs (16)
77""", Net461.References.mscorlib, portableProject.Id); 118""", Net461.References.mscorlib, portableProject.Id); 169""", Net461.References.mscorlib, portableProject.Id); 210""", SystemRuntimePP7Ref, portableProject.Id); 252""", Net461.References.mscorlib, portableProject.Id); 294""", Net40.References.mscorlib, portableProject.Id); 335""", Net461.References.mscorlib, portableProject.Id); 376""", Net461.References.mscorlib, portableProject.Id); 416""", Net40.References.mscorlib, portableProject.Id); 701""", Net40.References.mscorlib, normalProject1.Id); 703normalProject1 = solution.GetProject(normalProject1.Id); 757""", Net40.References.mscorlib, portableProject1.Id); 815var referencedProjectId = solution.Projects.Single(p => p.Name == "ReferencedProject").Id; 836Assert.Equal(referencedProjectId, document.Project.Id); 858var referencedProjectId = solution.Projects.Single(p => p.Name == "ReferencedProject").Id; 884Assert.Equal(referencedProjectId, document.Project.Id);
TextEditor\OpenDocumentTests.cs (1)
41var projectId = workspace.AddProject($"Project{i}", LanguageNames.CSharp).Id;
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
LanguageServices\FSharpVisualStudioWorkspaceExtensions.cs (2)
28projectId = projects[0].Id; 44return workspace.CurrentSolution.Projects.FirstOrDefault(p => p.FilePath == filePath)?.Id ?? ProjectId.CreateNewId("ProjectNotFound");
Microsoft.CodeAnalysis.Features (106)
AddImport\AbstractAddImportCodeFixProvider.cs (1)
66var packageSources = installerService?.IsEnabled(document.Project.Id) == true
AddImport\AbstractAddImportFeatureService.cs (1)
466var projectsThatTransitivelyDependOnThisProject = dependencyGraph.GetProjectsThatTransitivelyDependOnThisProject(project.Id);
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (1)
110_newProject.Id,
AddImport\CodeActions\ProjectSymbolReferenceCodeAction.cs (2)
38=> fixData.ProjectReferenceToAdd != null && fixData.ProjectReferenceToAdd != originalDocument.Project.Id; 52return Task.FromResult<CodeActionOperation?>(new AddProjectReferenceCodeActionOperation(OriginalDocument.Project.Id, FixData.ProjectReferenceToAdd, applyOperation));
AddImport\References\ProjectSymbolReference.cs (12)
36return document.Project.Id == _project.Id 51=> document.Project.Id != _project.Id; 60if (document.Project.Id == _project.Id) 79textChanges, description, tags, priority, _project.Id); 93description = project.Id == _project.Id 104_project.Id == reference._project.Id; 108=> Hash.Combine(_project.Id, base.GetHashCode());
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (1)
31_assemblyProject.Id,
AddMissingReference\AddMissingReferenceCodeAction.cs (2)
50foreach (var candidateProjectId in dependencyGraph.GetProjectsThatThisProjectTransitivelyDependsOn(project.Id)) 87var operation = factoryService.CreateAddMetadataReferenceOperation(_project.Id, _missingAssemblyIdentity);
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
39!installerService.IsEnabled(document.Project.Id))
AddPackage\ParentInstallPackageCodeAction.cs (1)
73return installerService?.IsInstalled(document.Project.Id, fixData.PackageName) == false
CodeFixes\Configuration\ConfigurationUpdater.cs (4)
243currentProject = solution.GetProject(project.Id)!; 255currentProject = solution.GetProject(project.Id)!; 330var id = DocumentId.CreateNewId(project.Id); 337return newSolution.GetProject(project.Id)?.GetAnalyzerConfigDocument(id);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (2)
77var currentProject = currentSolution.GetProject(oldProject.Id); 105var currentProject = currentSolution.GetProject(oldProject.Id);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
51var newDocumentId = DocumentId.CreateNewId(projectToBeUpdated.Id, FileName);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
41var newDocumentId = DocumentId.CreateNewId(document.Project.Id, document.Name);
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
154var projectGuid = project.Id.Id.ToString();
Completion\Providers\CompletionUtilities.cs (1)
40projectIds.Add(project.Id);
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (4)
94var referencedProjects = graph.GetProjectsThatThisProjectTransitivelyDependsOn(currentProject.Id).Select(solution.GetRequiredProject).Where(p => p.SupportsCompilation); 102var projectId = project.Id; 111else if (s_projectItemsCache.TryGetValue(project.Id, out var cacheEntry)) 184project.Id,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (2)
43solutionInfo, project.Id, cancellationToken), 236var projectId = project.Id;
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (3)
127var relevantProjectIds = graph.GetProjectsThatThisProjectTransitivelyDependsOn(project.Id).Concat(project.Id); 146else if (!s_projectItemsCache.TryGetValue(project.Id, out cacheEntry))
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
460var dependentProjects = graph.GetProjectsThatDirectlyDependOnThisProject(startingProject.Id);
Copilot\ICopilotChangeAnalysisService.cs (1)
122.GetProjectsThatThisProjectTransitivelyDependsOn(document.Project.Id).Count;
Diagnostics\CodeAnalysisDiagnosticAnalyzerService.cs (2)
96_analyzedProjectToDiagnostics[project.Id] = diagnostics; 99_clearedProjectIds.Remove(project.Id);
Diagnostics\DiagnosticAnalyzerExtensions.cs (1)
55project.Solution, project.Id, analyzerReference, project.Language, cancellationToken);
Diagnostics\Service\DiagnosticAnalyzerService.ProjectStates.cs (1)
44(project.Id, project.AnalyzerReferences),
Diagnostics\Service\DiagnosticAnalyzerService_ComputeDiagnosticAnalysisResults.cs (1)
51=> $"project: ({project.Id}), ({string.Join(Environment.NewLine, analyzers.Select(a => a.ToString()))})";
Diagnostics\Service\DiagnosticAnalyzerService_RemoteOrLocalDispatcher.cs (4)
29(service, solution, cancellationToken) => service.ForceAnalyzeProjectAsync(solution, project.Id, cancellationToken), 90(service, solution, cancellationToken) => service.GetDiagnosticDescriptorsPerReferenceAsync(solution, project.Id, cancellationToken), 113solution, project.Id, analyzerIds, cancellationToken), 141solution, project.Id, analyzerIds, diagnosticIds, documentIds,
Diagnostics\Service\DocumentAnalysisExecutor.cs (2)
102(r, d, a, k) => $"Driver: {r != null}, {d.Id}, {d.Project.Id}, {a}, {k}", _compilationWithAnalyzers, textDocument, analyzer, kind); 114Logger.Log(FunctionId.Diagnostics_SemanticDiagnostic, (a, d, e) => $"{a}, ({d.Id}, {d.Project.Id}), Enabled:{e}", analyzer, textDocument, isEnabled);
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
197if (documentId.ProjectId == project.Id)
EditAndContinue\CommittedSolution.cs (1)
231if (committedDocument == null && !solution.ContainsProject(document.Project.Id))
EditAndContinue\DebuggingSession.cs (5)
328if (!TryCreateInitialBaseline(baselineCompilation, outputs, baselineProject.Id, diagnostics, out var initialBaseline, out var debugInfoReaderProvider, out var metadataReaderProvider)) 356var newBaseline = new ProjectBaseline(moduleId, baselineProject.Id, initialBaseline, initiallyReferencedAssemblies.ToImmutableDictionary(), generation: 0); 359_projectBaselines[baselineProject.Id] = baselines; 366=> _projectBaselines.TryGetValue(baselineProject.Id, out baselines) && 859var oldProject = LastCommittedSolution.GetProject(newProject.Id);
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (2)
84var oldProject = oldDocument?.Project ?? oldSolution.GetRequiredProject(newDocument!.Project.Id); 85var newProject = newDocument?.Project ?? newSolution.GetRequiredProject(oldProject.Id);
EditAndContinue\EditSession.cs (12)
292var oldProject = oldSolution.GetProject(newProject.Id); 307var newProject = newSolution.GetProject(oldProject.Id); 569Debug.Assert(oldProject.Id == newProject.Id); 1020var oldProject = oldSolution.GetProject(newProject.Id); 1034if (staleProjects.TryGetValue(newProject.Id, out var staleModuleId)) 1046staleProjects = staleProjects.Remove(newProject.Id); 1064addedUnbuiltProjects.Add(newProject.Id); 1105staleProjects = staleProjects.Add(newProject.Id, mvid); 1211projectsToRedeploy.Add(newProject.Id); 1318newProject.Id, 1367diagnosticBuilders.Add(newProject.Id, projectDiagnostics);
EditAndContinue\RunningProjectOptions.cs (1)
56result.Add(project.Id, new RunningProjectOptions() { RestartWhenChangesHaveNoEffect = restartAutomatically });
EditAndContinue\Utilities\Extensions.cs (1)
79: $"'{project.Name}' ('{project.Id.DebugName}'";
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
236var projectId = document.Project.Id;
ExternalAccess\UnitTesting\API\UnitTestingSearchHelpers.cs (2)
37(service, solutionChecksum, cancellationToken) => service.GetSourceLocationAsync(solutionChecksum, project.Id, query, cancellationToken), 60(service, solutionChecksum, cancellationToken) => service.GetSourceLocationsAsync(solutionChecksum, project.Id, query, cancellationToken),
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (1)
211var self = project.Id;
ExtractClass\ExtractClassWithDialogCodeAction.cs (1)
108_document.Project.Id,
ExtractInterface\AbstractExtractInterfaceService.cs (1)
188refactoringResult.DocumentToExtractFrom.Project.Id,
GenerateType\AbstractGenerateTypeService.Editor.cs (5)
271var newDocumentId = DocumentId.CreateNewId(projectToBeUpdated.Id, debugName: documentName); 347var documentId = DocumentId.CreateNewId(projectToBeUpdated.Id, documentName); 376if (!triggeringProject.ProjectReferences.Any(pr => pr.ProjectId == projectToBeUpdated.Id)) 378updatedSolution = updatedSolution.AddProjectReference(triggeringProject.Id, new ProjectReference(projectToBeUpdated.Id));
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
448var compilation = await finalSolution.GetRequiredProject(documentWithMemberAdded.Project.Id).GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
26this.SourceProjectId = sourceProject.Id;
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (4)
106sourceDoc.Project.Id, 118var memberReferenceLocations = await FindMemberReferencesAsync(newDoc.Project.Solution, newDoc.Project.Id, moveOptions.SelectedMembers, cancellationToken).ConfigureAwait(false); 119var projectToLocations = memberReferenceLocations.ToLookup(loc => loc.location.Document.Project.Id); 194var projectToLocations = memberReferenceLocations.ToLookup(loc => loc.location.Document.Project.Id);
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (1)
50service.SearchGeneratedDocumentsAsync(solutionInfo, projects.SelectAsArray(p => p.Id), searchPattern, [.. kinds], callbackId, cancellationToken),
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
176service.SearchProjectsAsync(solutionInfo, projects.SelectAsArray(p => p.Id), priorityDocumentIds, searchPattern, [.. kinds], callbackId, cancellationToken),
NavigateTo\NavigateToSearcher.cs (1)
468allProjectIdSet.AddRange(orderedProjects.SelectMany(x => x).Select(p => p.Id));
Navigation\INavigableItem.cs (1)
93=> new(project.Name, project.Id);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
363_fileToDocumentInfoMap[info.FilePath] = new(documentId, encoding, info.ChecksumAlgorithm, sourceProject.Id, sourceWorkspace, documentInfo);
Rename\SymbolicRenameInfo.cs (1)
234var projectIdOfLocation = sourceDocument.Project.Id;
Shared\Utilities\SupportedPlatformData.cs (1)
33var text = string.Format(FeaturesResources._0_1, project.Name, Supported(!InvalidProjects.Contains(project.Id)));
SignatureHelp\AbstractSignatureHelpProvider.cs (2)
258var totalProjects = relatedDocuments.Concat(document).SelectAsArray(d => d.Project.Id); 289invalidProjectsForCurrentSymbol.Add(relatedDocument.Project.Id);
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
79foreach (var projectId in solution.Projects.Select(p => p.Id))
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
387var currentProject = currentSolution.GetRequiredProject(fieldDocument.Project.Id);
Workspace\CompileTimeSolutionProvider.cs (1)
194var sourceGeneratedDocuments = await compileTimeSolution.GetRequiredProject(designTimeDocument.Project.Id).GetSourceGeneratedDocumentsAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Features.Test.Utilities (8)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (6)
116solution = solution.AddAnalyzerReference(project.Id, new TestGeneratorReference(generator)); 121solution = solution.AddAdditionalDocument(DocumentId.CreateNewId(project.Id), "additional", CreateText(additionalFileText)); 131DocumentId.CreateNewId(project.Id), 144document = solution.GetRequiredProject(project.Id). 163accessor.SetOutputProvider(project => _mockCompilationOutputs.GetValueOrDefault(project.Id, null) ?? new MockCompilationOutputs(Guid.Empty)); 298project.Id,
EditAndContinue\Extensions.cs (2)
66id = project.Id; 85=> project.Solution.AddTestDocument(project.Id, source, path, out id);
Microsoft.CodeAnalysis.Features.UnitTests (108)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (79)
130id: DocumentId.CreateNewId(projectQ.Id, debugName: "D"), 205solution = solution.WithProjectOutputFilePath(document.Project.Id, moduleFile.Path); 206_mockCompilationOutputs.Add(document.Project.Id, new CompilationOutputFiles(moduleFile.Path)); 320solution = solution.WithProjectCompilationOutputInfo(document.Project.Id, new CompilationOutputInfo(assemblyPath: null, generatedFilesOutputDirectory: null)); 833var projectId = document1.Project.Id; 870DocumentId.CreateNewId(document.Project.Id), 1021var projectId = document1.Project.Id; 1100var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path); 1102_mockCompilationOutputs[project.Id] = new MockCompilationOutputs(moduleId) 1155var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path, checksumAlgorithm: SourceHashAlgorithms.Default); 1217EmitAndLoadLibraryToDebuggee(project.Id, sourceA, sourceFilePath: sourceFileA.Path); 1368var moduleId = EmitLibrary(project.Id, source1, sourceFilePath: sourceFile.Path); 1414_mockCompilationOutputs.Add(document.Project.Id, new MockCompilationOutputs(moduleId)); 1453_mockCompilationOutputs.Add(document.Project.Id, new MockCompilationOutputs(moduleId)); 1563_mockCompilationOutputs.Add(document.Project.Id, new MockCompilationOutputs(moduleId)); 1631var moduleId = EmitAndLoadLibraryToDebuggee(document.Project.Id, source1); 1705_mockCompilationOutputs.Add(document.Project.Id, new MockCompilationOutputs(Guid.NewGuid())); 1749var projectId = project.Id; 1846var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path); 1890var moduleId = EmitLibrary(project.Id, source1, sourceFilePath: sourceFile.Path); 1943var projectId = document.Project.Id; 2052_mockCompilationOutputs.Add(document.Project.Id, new MockCompilationOutputs(moduleId)); 2092var moduleId = EmitAndLoadLibraryToDebuggee(document.Project.Id, sourceV1); 2191Assert.True(await EditSession.HasChangesAsync(solution, solution.RemoveProject(projectD.Id), CancellationToken.None)); 2248var projectId = project.Id; 2418var projectId = project.Id; 2800var moduleId = EmitLibrary(document1.Project.Id, sourceV1, generatorProject: document1.Project); 2844solution = solution.WithProjectParseOptions(project.Id, new CSharpParseOptions(LanguageVersion.CSharp10)); 2847EmitAndLoadLibraryToDebuggee(project.Id, source1); 2882EmitAndLoadLibraryToDebuggee(document.Project.Id, sourceV1); 3047var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path); 3116var moduleId = EmitAndLoadLibraryToDebuggee(project.Id, source1, sourceFilePath: sourceFile.Path); 3179var moduleId = EmitLibrary(project.Id, sourceOnDisk, sourceFilePath: sourceFile.Path); 3220var moduleId = EmitAndLoadLibraryToDebuggee(document1.Project.Id, sourceV1); 3260Assert.Equal(document2.Project.Id, newBaseline.ProjectId); 3284Assert.Same(newBaseline.EmitBaseline, debuggingSession.GetTestAccessor().GetProjectBaselines(document2.Project.Id).Single().EmitBaseline); 3356_mockCompilationOutputs.Add(document1.Project.Id, new CompilationOutputFiles(moduleFile.Path, pdbFile.Path)); 3400Assert.Equal(document2.Project.Id, newBaseline.ProjectId); 3412Assert.Same(newBaseline.EmitBaseline, debuggingSession.GetTestAccessor().GetProjectBaselines(document2.Project.Id).Single().EmitBaseline); 3467LoadLibraryToDebuggee(EmitLibrary(project.Id, [(sourceA1, "test1.cs"), (sourceB1, "test2.cs")])); 3695var moduleId = EmitLibrary(document1.Project.Id, sourceV1, generatorProject: document1.Project); 3750var projectId = document1.Project.Id; 3810var moduleId = EmitLibrary(document1.Project.Id, sourceV1, generatorProject: document1.Project); 3867var moduleId = EmitLibrary(document1.Project.Id, sourceV1, generatorProject: document1.Project); 3920var moduleId = EmitLibrary(document.Project.Id, source, generatorProject: document.Project, additionalFileText: additionalSourceV1); 3970var moduleId = EmitLibrary(document.Project.Id, source, generatorProject: document.Project, analyzerOptions: configV1); 4012var moduleId = EmitLibrary(document1.Project.Id, source1, generatorProject: document1.Project); 4049var moduleId = EmitAndLoadLibraryToDebuggee(document1.Project.Id, source1); 4066var text = await debuggingSession.LastCommittedSolution.GetRequiredProject(document1.Project.Id).GetRequiredDocument(document1.Id).GetTextAsync(); 4085solution = solution.WithProjectParseOptions(project.Id, new CSharpParseOptions(LanguageVersion.CSharp10)); 4088EmitAndLoadLibraryToDebuggee(project.Id, source1); 4151_mockCompilationOutputs.Add(projectA.Id, new CompilationOutputFiles(moduleFileA.Path, pdbFileA.Path)); 4152_mockCompilationOutputs.Add(projectB.Id, new CompilationOutputFiles(moduleFileB.Path, pdbFileB.Path)); 4179var newBaselineA1 = pendingUpdate.ProjectBaselines.Single(b => b.ProjectId == projectA.Id).EmitBaseline; 4180var newBaselineB1 = pendingUpdate.ProjectBaselines.Single(b => b.ProjectId == projectB.Id).EmitBaseline; 4199Assert.Same(newBaselineA1, debuggingSession.GetTestAccessor().GetProjectBaselines(projectA.Id).Single().EmitBaseline); 4200Assert.Same(newBaselineB1, debuggingSession.GetTestAccessor().GetProjectBaselines(projectB.Id).Single().EmitBaseline); 4227var newBaselineA2 = pendingUpdate.ProjectBaselines.Single(b => b.ProjectId == projectA.Id).EmitBaseline; 4228var newBaselineB2 = pendingUpdate.ProjectBaselines.Single(b => b.ProjectId == projectB.Id).EmitBaseline; 4252Assert.Same(newBaselineA2, debuggingSession.GetTestAccessor().GetProjectBaselines(projectA.Id).Single().EmitBaseline); 4253Assert.Same(newBaselineB2, debuggingSession.GetTestAccessor().GetProjectBaselines(projectB.Id).Single().EmitBaseline); 4294var projectAId = documentA.Project.Id; 4295var projectBId = documentB.Project.Id; 4394var projectAId = documentA.Project.Id; 4395var projectBId = documentB.Project.Id; 4430_mockCompilationOutputs.Add(document1.Project.Id, new MockCompilationOutputs(Guid.NewGuid()) 4465_mockCompilationOutputs.Add(document.Project.Id, new MockCompilationOutputs(Guid.NewGuid()) 4652DocumentId.CreateNewId(project.Id, "test"), 4728var linkedDocId = DocumentId.CreateNewId(p.Id, projectName + "->" + doc.Name); 4925var moduleId = EmitLibrary(document1.Project.Id, source1, generatorProject: document1.Project, additionalFileText: additionalFileSourceV1); 5101var moduleId = EmitAndLoadLibraryToDebuggee(document.Project.Id, SourceMarkers.Clear(markedSourceV1)); 5220var moduleId = EmitAndLoadLibraryToDebuggee(document.Project.Id, SourceMarkers.Clear(markedSource1)); 5339var moduleId = EmitAndLoadLibraryToDebuggee(document.Project.Id, SourceMarkers.Clear(markedSource1)); 5425var moduleId = EmitAndLoadLibraryToDebuggee(document.Project.Id, source); 5460var newProject = modifiedSolution.GetProject(oldProject.Id); 5488var moduleId = EmitLibrary(projectP.Id, source1, sourceFileA.Path, assemblyName: "Proj"); 5490var documentIdA = DocumentId.CreateNewId(projectP.Id, debugName: "A"); 5586var libMvid1 = EmitAndLoadLibraryToDebuggee(oldProject.Id, libSource1); 5605var libMvid2 = EmitAndLoadLibraryToDebuggee(oldProject.Id, libSource2);
EditAndContinue\EditSessionActiveStatementsTests.cs (5)
82var id = DocumentId.CreateNewId(project.Id, name); 183solution = dummyProject.Solution.AddDocument(DocumentId.CreateNewId(dummyProject.Id, NoCompilationConstants.LanguageName), "a.dummy", ""); 367var analyzer = solution.GetProject(project.Id).Services.GetRequiredService<IEditAndContinueAnalyzer>(); 550var analyzer = solution.GetProject(project.Id).Services.GetRequiredService<IEditAndContinueAnalyzer>(); 702var analyzer = solution.GetProject(project.Id).Services.GetRequiredService<IEditAndContinueAnalyzer>();
EditAndContinue\EmitSolutionUpdateResultsTests.cs (4)
92document.Project.Id, 108document.Project.Id, 125document.Project.Id, 132var rudeEdits = ImmutableArray.Create(new ProjectDiagnostics(document.Project.Id,
EditAndContinue\RemoteEditAndContinueServiceTests.cs (3)
181{ project.Id, new RunningProjectOptions() { RestartWhenChangesHaveNoEffect = true } } 211var diagnostics = ImmutableArray.Create(new ProjectDiagnostics(project.Id, [documentDiagnostic, projectDiagnostic])); 212var documentsWithRudeEdits = ImmutableArray.Create(new ProjectDiagnostics(project.Id, []));
EditAndContinue\UnitTestingHotReloadServiceTests.cs (2)
35var moduleId = EmitLibrary(projectP.Id, source1, sourceFileA.Path, assemblyName: "Proj"); 39var documentIdA = DocumentId.CreateNewId(projectP.Id, debugName: "A");
EditAndContinue\WatchHotReloadServiceTests.cs (2)
56var moduleId = EmitLibrary(projectP.Id, source1, sourceFileA.Path, assemblyName: "Proj"); 190var projectId = project.Id;
FindUsages\DefinitionItemFactoryTests.cs (13)
96expressionMap.Add(project.Id.Id.ToString(), $"project.{nameof(Project.Id)}.{nameof(Project.Id.Id)}.{nameof(Project.Id.Id.ToString)}()"); 200("MetadataSymbolOriginatingProjectIdGuid", project.Id.Id.ToString()), 278("MetadataSymbolOriginatingProjectIdGuid", project.Id.Id.ToString()), 368("MetadataSymbolOriginatingProjectIdGuid", project.Id.Id.ToString()), 426("MetadataSymbolOriginatingProjectIdGuid", project.Id.Id.ToString()), 594("MetadataSymbolOriginatingProjectIdGuid", project.Id.Id.ToString()), 652("MetadataSymbolOriginatingProjectIdGuid", project.Id.Id.ToString()), 753("MetadataSymbolOriginatingProjectIdGuid", project.Id.Id.ToString()) 809("MetadataSymbolOriginatingProjectIdGuid", project.Id.Id.ToString()) 916("MetadataSymbolOriginatingProjectIdGuid", project.Id.Id.ToString()),
Microsoft.CodeAnalysis.LanguageServer (4)
FileBasedPrograms\FileBasedProgramsProjectSystem.cs (1)
84await BeginLoadingProjectWithPrimordialAsync(primordialDoc.FilePath, _workspaceFactory.MiscellaneousFilesWorkspaceProjectFactory, primordialProjectId: primordialDoc.Project.Id, doDesignTimeBuild);
FileBasedPrograms\VirtualProjectXmlDiagnosticSourceProvider.cs (1)
64projectId: document.Project.Id,
LanguageServer\Handler\DebugConfiguration\WorkspaceDebugConfigurationHandler.cs (1)
50var targetsDotnetCore = _targetFrameworkManager.IsDotnetCoreProject(project.Id);
LanguageServer\Handler\Restore\RestorableProjectsHandler.cs (1)
40if (project.FilePath != null && projectTargetFrameworkManager.IsDotnetCoreProject(project.Id))
Microsoft.CodeAnalysis.LanguageServer.Protocol (16)
Extensions\Extensions.cs (2)
172return FindItemInProjectContext(documents, documentIdentifier, projectIdGetter: (item) => item.Project.Id, defaultGetter: () => 195: FindItemInProjectContext(projects, projectIdentifier, projectIdGetter: (item) => item.Id, defaultGetter: () => projects[0]);
Extensions\ProtocolConversions.cs (1)
835Id = ProjectIdToProjectContextId(project.Id),
Extensions\SourceGeneratedDocumentUri.cs (1)
58var projectId = solution.GetProject(projectIdGuidOnly)?.Id;
ExternalAccess\Razor\FormatNewFileHandler.cs (1)
54var documentId = DocumentId.CreateNewId(project.Id);
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (1)
257return new ProjectOrDocumentId(project.Id);
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDocumentsAndProjectDiagnosticSourceProvider.cs (1)
67if (!fullSolutionAnalysisEnabled && !codeAnalysisService.HasProjectBeenAnalyzed(project.Id))
Handler\Diagnostics\DiagnosticSources\AbstractProjectDiagnosticSource.cs (2)
29public ProjectOrDocumentId GetId() => new(Project.Id); 65var diagnostics = codeAnalysisService.GetLastComputedProjectDiagnostics(Project.Id);
Handler\Diagnostics\DiagnosticSources\TaskListDiagnosticSource.cs (1)
56projectId: this.Document.Project.Id,
Handler\Diagnostics\IDiagnosticProjectInformationService.cs (1)
38ProjectIdentifier = project.Id.Id.ToString(),
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (3)
43var projectChecksum = await project.Solution.CompilationState.GetChecksumAsync(project.Id, cancellationToken).ConfigureAwait(false); 49if (_projectIdToLastComputedChecksum.TryGetValue(project.Id, out var lastChecksum) && lastChecksum == projectChecksum) 55_projectIdToLastComputedChecksum[project.Id] = projectChecksum;
Handler\SourceGenerators\SourceGeneratedDocumentCache.cs (1)
23var executionVersion = state.Document.Project.Solution.GetSourceGeneratorExecutionVersion(state.Document.Project.Id);
Workspaces\LspMiscellaneousFilesWorkspaceProvider.cs (1)
104OnProjectRemoved(project.Id);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (21)
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
179testLspServer.GetCurrentSolution().Projects.Single().Id,
Diagnostics\DiagnosticsPullCacheTests.cs (1)
125isEnabledByDefault: true, warningLevel: 0, [], ImmutableDictionary<string, string?>.Empty,context.Document!.Project.Id,
Diagnostics\PullDiagnosticTests.cs (10)
52await testLspServer.RunCodeAnalysisAsync(document.Project.Id); 482Id = ProtocolConversions.ProjectIdToProjectContextId(document.Project.Id), 675document.Project.Id, 721testLspServer.TestWorkspace.EnqueueUpdateSourceGeneratorVersion(document.Project.Id, forceRegeneration: false); 747document.Project.Id, 1015var projectId = scopeRunCodeAnalysisToProject ? testLspServer.GetCurrentSolution().Projects.Single().Id : null; 1055var projectId = scopeRunCodeAnalysisToProject ? testLspServer.GetCurrentSolution().Projects.Single().Id : null; 1369projectId: project.Id, 1408document.Project.Id, 1430testLspServer.GetCurrentSolution().Projects.Single().Id,
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
54var newSolution = initialSolution.RemoveProject(initialSolution.Projects.First().Id);
Hover\HoverTests.cs (2)
188var result = await RunGetHoverAsync(testLspServer, location, project.Id); 548var result = await RunGetHoverAsync(testLspServer, location, project.Id);
Ordering\RequestOrderingTests.cs (1)
211testLspServer.TestWorkspace.SetCurrentSolution(s => s.WithProjectName(s.Projects.First().Id, "NewName"), WorkspaceChangeKind.ProjectChanged);
ProjectContext\GetTextDocumentWithContextHandlerTests.cs (1)
101Assert.Equal(ProtocolConversions.ProjectIdToProjectContextId(project.Id), result!.ProjectContexts[result.DefaultIndex].Id);
Workspaces\LspWorkspaceManagerTests.cs (4)
157await testLspServer.TestWorkspace.ChangeProjectAsync(newProject.Id, newProject.Solution); 190await testLspServer.TestWorkspace.ChangeProjectAsync(newProject.Id, newProject.Solution); 405await testWorkspaceTwo.ChangeProjectAsync(newProjectWorkspaceTwo.Id, newProjectWorkspaceTwo.Solution); 460await testWorkspace.ChangeProjectAsync(newProject.Id, newProject.Solution);
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (1)
DeclarePublicApiFix.cs (1)
319addedPublicSurfaceAreaText.Add(new KeyValuePair<ProjectId, SourceText>(project.Id, newSourceText));
Microsoft.CodeAnalysis.Remote.ServiceHub (11)
Host\RemoteWorkspace.SolutionCreator.cs (9)
348assetPath: project.Id, newProjectChecksums.CompilationOptions, cancellationToken).ConfigureAwait(false))); 355assetPath: project.Id, newProjectChecksums.ParseOptions, cancellationToken).ConfigureAwait(false)); 362assetPath: project.Id, newProjectChecksums.ProjectReferences, cancellationToken).ConfigureAwait(false)); 369assetPath: project.Id, newProjectChecksums.MetadataReferences, cancellationToken).ConfigureAwait(false)); 378assetPath: project.Id, newProjectChecksums.AnalyzerReferences, cancellationToken).ConfigureAwait(false); 461assetPath: new(AssetPathKind.DocumentAttributes, project.Id), newChecksumsToSync, cancellationToken).ConfigureAwait(false); 467assetPath: new(AssetPathKind.DocumentText, project.Id), newChecksumsToSync, cancellationToken).ConfigureAwait(false); 497project = addDocuments(project.Solution, lazyDocumentsToAdd.ToImmutable()).GetProject(project.Id)!; 514project = removeDocuments(project.Solution, lazyDocumentsToRemove.ToImmutable()).GetProject(project.Id)!;
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (2)
107s_compilationWithAnalyzersCache.Project.Id == project.Id &&
Microsoft.CodeAnalysis.Remote.Workspaces (1)
SolutionAssetStorage.cs (1)
56=> StoreAssetsAsync(project.Solution.CompilationState, project.Id, cancellationToken);
Microsoft.CodeAnalysis.Workspaces (111)
Classification\SemanticClassificationCacheUtilities.cs (1)
23var projectKey = new ProjectKey(SolutionKey.ToSolutionKey(project.Solution), project.Id, project.FilePath, project.Name, Checksum.Null);
Diagnostics\DiagnosticAnalysisResult.cs (1)
88project.Id,
Diagnostics\DiagnosticData.cs (2)
206=> Create(diagnostic, project.Id, project.Language, 229project.Id,
Diagnostics\Extensions.cs (2)
493if (solution.CompilationState.SourceGeneratorExecutionVersionMap.Map.TryGetValue(project.Id, out var executionVersion)) 525invocation: (service, solutionInfo, cancellationToken) => service.GetSourceGeneratorDiagnosticsAsync(solutionInfo, project.Id, cancellationToken),
Editing\SymbolEditor.cs (3)
106return await GetSymbolAsync(ChangedSolution, project.Id, symbolId, cancellationToken).ConfigureAwait(false); 113return await GetSymbolAsync(ChangedSolution, project.Id, symbolId, cancellationToken).ConfigureAwait(false); 134.ToLookup(p => p.AssemblyName, p => p.Id)
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (1)
44(service, solutionInfo, cancellationToken) => service.FindAllDeclarationsWithNormalQueryAsync(solutionInfo, project.Id, query.Name, query.Kind, criteria, cancellationToken),
FindSymbols\Declarations\DeclarationFinder_SourceDeclarations.cs (2)
86(service, solutionInfo, cancellationToken) => service.FindProjectSourceDeclarationsWithNormalQueryAsync(solutionInfo, project.Id, name, ignoreCase, criteria, cancellationToken), 152(service, solutionInfo, cancellationToken) => service.FindProjectSourceDeclarationsWithPatternAsync(solutionInfo, project.Id, pattern, criteria, cancellationToken),
FindSymbols\FindReferences\DependentProjectsFinder.cs (5)
217projectIdsToReferencingSubmissionIds.MultiAdd(referencedProject.Id, project.Id); 228foreach (var dependentProject in dependentProjects.Select(dp => dp.project.Id)) 237if (!dependentProjects.Any(dp => dp.project.Id == pId)) 317return project.ProjectReferences.Any(p => p.ProjectId == symbolOrigination.sourceProject.Id);
FindSymbols\FindReferences\DependentTypeFinder.cs (6)
444return dependencyGraph.GetProjectsThatTransitivelyDependOnThisProject(project.Id) 445.Concat(project.Id); 476return [.. projectsToExamine.OrderBy((p1, p2) => order[p1.Id] - order[p2.Id])]; 496.SelectMany(p => dependencyGraph.GetProjectsThatThisProjectTransitivelyDependsOn(p.Id)) 497.Concat(projects.Select(p => p.Id)).ToSet();
FindSymbols\FindReferences\DependentTypeFinder_Remote.cs (1)
31var projectIds = projects?.Where(p => RemoteSupportedLanguages.IsSupported(p.Language)).SelectAsArray(p => p.Id) ?? default;
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (8)
77_workQueue.AddWork(project.Id); 89var referencingProjects = new HashSet<ProjectId>(solution.Projects.Where(p => p.MetadataReferences.Contains(reference)).Select(p => p.Id)); 102_workQueue.AddWork(project.Id); 105if (_projectIdToInfo.TryGetValue(project.Id, out var projectInfo)) 116return _projectIdToInfo.GetOrAdd(project.Id, (semanticVersion: default, info)).info; 168if (!_projectIdToInfo.TryGetValue(project.Id, out var projectInfo) || 185_projectIdToInfo[project.Id] = (semanticVersion, info); 212metadataInfo.ReferencingProjects.Add(project.Id);
Remote\RemoteArguments.cs (2)
69=> new(symbol.GetSymbolKey(cancellationToken).ToString(), project.Id); 95result = new SerializableSymbolAndProjectId(SymbolKey.CreateString(symbol, cancellationToken), project.Id);
Remote\RemoteServiceConnection.cs (4)
82=> TryInvokeAsync(project.Solution.CompilationState, project.Id, invocation, cancellationToken); 88=> TryInvokeAsync(project.Solution.CompilationState, project.Id, invocation, cancellationToken); 132=> TryInvokeAsync(project.Solution.CompilationState, project.Id, invocation, cancellationToken); 138=> TryInvokeAsync(project.Solution.CompilationState, project.Id, invocation, cancellationToken);
Shared\Extensions\ProjectExtensions.cs (2)
17=> project.Solution.WithOptions(options).GetProject(project.Id)!; 32=> project.Solution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(id => id.ProjectId == project.Id);
Workspace\ProjectSystem\ProjectSystemProject.cs (2)
679var projectId = projectBeforeMutation.Id; 840var newSolution = solution.WithProjectAnalyzerReferences(project.Id, isolatedReferences);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (2)
895newSolution, project.Id, projectUpdateState, oldReference, createNewReference(solutionServices, oldReference)); 897solutionChanges.UpdateSolutionForProjectAction(project.Id, newSolution);
Workspace\Solution\Project.cs (59)
232=> Solution.GetDocumentId(syntaxTree, this.Id); 238=> Solution.GetDocument(syntaxTree, this.Id); 342if (this.Id != documentId.ProjectId) 376if (this.Id != documentId.ProjectId) 514=> Solution.CompilationState.TryGetCompilation(this.Id, out compilation); 562=> Solution.CompilationState.GetDependentVersionAsync(this.Id, cancellationToken); 569=> Solution.CompilationState.GetDependentSemanticVersionAsync(this.Id, cancellationToken); 582=> this.Solution.WithProjectAssemblyName(this.Id, assemblyName).GetRequiredProject(Id); 588=> this.Solution.WithProjectDefaultNamespace(this.Id, defaultNamespace).GetRequiredProject(Id); 591=> Solution.WithProjectOutputFilePath(Id, path).GetRequiredProject(Id); 594=> Solution.WithProjectOutputRefFilePath(Id, path).GetRequiredProject(Id); 597=> Solution.WithProjectCompilationOutputInfo(Id, info).GetRequiredProject(Id); 603=> this.Solution.WithProjectCompilationOptions(this.Id, options).GetRequiredProject(Id); 609=> this.Solution.WithProjectParseOptions(this.Id, options).GetRequiredProject(Id); 616=> this.Solution.AddProjectReference(this.Id, projectReference).GetRequiredProject(Id); 623=> this.Solution.AddProjectReferences(this.Id, projectReferences).GetRequiredProject(Id); 629=> this.Solution.RemoveProjectReference(this.Id, projectReference).GetRequiredProject(Id); 636=> this.Solution.WithProjectReferences(this.Id, projectReferences).GetRequiredProject(Id); 643=> this.Solution.AddMetadataReference(this.Id, metadataReference).GetRequiredProject(Id); 650=> this.Solution.AddMetadataReferences(this.Id, metadataReferences).GetRequiredProject(Id); 656=> this.Solution.RemoveMetadataReference(this.Id, metadataReference).GetRequiredProject(Id); 663=> this.Solution.WithProjectMetadataReferences(this.Id, metadataReferences).GetRequiredProject(Id); 670=> this.Solution.AddAnalyzerReference(this.Id, analyzerReference).GetRequiredProject(Id); 677=> this.Solution.AddAnalyzerReferences(this.Id, analyzerReferences).GetRequiredProject(Id); 683=> this.Solution.RemoveAnalyzerReference(this.Id, analyzerReference).GetRequiredProject(Id); 690=> this.Solution.WithProjectAnalyzerReferences(this.Id, analyzerReferencs).GetRequiredProject(Id); 697=> Solution.WithProjectAttributes(attributes).GetRequiredProject(Id); 704var id = DocumentId.CreateNewId(this.Id); 716var id = DocumentId.CreateNewId(this.Id); 725var id = DocumentId.CreateNewId(this.Id, debugName: name); 734var id = DocumentId.CreateNewId(this.Id); 743var id = DocumentId.CreateNewId(this.Id); 752var id = DocumentId.CreateNewId(this.Id); 763return this.Solution.RemoveDocument(documentId).GetRequiredProject(Id); 773return this.Solution.RemoveDocuments(documentIds).GetRequiredProject(this.Id); 782=> this.Solution.RemoveAdditionalDocument(documentId).GetRequiredProject(Id); 791return this.Solution.RemoveAdditionalDocuments(documentIds).GetRequiredProject(this.Id); 800=> this.Solution.RemoveAnalyzerConfigDocument(documentId).GetRequiredProject(Id); 809return this.Solution.RemoveAnalyzerConfigDocuments(documentIds).GetRequiredProject(this.Id); 817if (documentId?.ProjectId != this.Id)
Workspace\Solution\ProjectChanges.cs (1)
18public ProjectId ProjectId => NewProject.Id;
Workspace\Solution\SolutionCompilationState.cs (2)
1851if (!projectWithCachedGeneratorState.Solution.CompilationState.TryGetCompilationTracker(projectWithCachedGeneratorState.Id, out var tracker) || 1914=> project.SupportsCompilation ? compilationState.GetCompilationTracker(project.Id).GeneratorDriver : null;
Workspace\Workspace.cs (3)
1483outputAssemblyToProjectIdMap[p.OutputFilePath!] = p.Id; 1488outputAssemblyToProjectIdMap[p.OutputRefFilePath!] = p.Id; 1616this.ApplyProjectRemoved(proj.Id);
Workspace\Workspace_Editor.cs (2)
886foreach (var docId in this.GetOpenDocumentIds(oldProject.Id)) 895return newSolution.GetRequiredProject(oldProject.Id);
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\ProjectMap.cs (1)
77Add(project.Id, project.FilePath, project.OutputFilePath, project.OutputRefFilePath);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (14)
NetCoreTests.cs (1)
152Assert.Equal(libraryProject.Id, projectRefId);
VisualStudioMSBuildWorkspaceTests.cs (13)
230Assert.True(projects[0].ProjectReferences.Any(r => r.ProjectId == projects[1].Id) || 231projects[1].ProjectReferences.Any(r => r.ProjectId == projects[0].Id)); 419var solution2 = solution1.WithProjectCompilationOptions(project.Id, project.CompilationOptions.WithOutputKind(OutputKind.NetModule)); 1433vbProject = workspace.CurrentSolution.GetProject(vbProject.Id); 2000workspace.AddDocument(project.Id, ["NewFolder"], "Bar.cs", newText); 2154var newDocId = DocumentId.CreateNewId(project.Id); 2181var csProjectId = csProject.Id; 2185var vbProjectId = vbProject.Id; 2934workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).RemoveAnalyzerReference(aref).Solution); 2955workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).RemoveProjectReference(pref).Solution); 2956Assert.Empty(workspace.CurrentSolution.GetProject(project.Id).ProjectReferences); 2962workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).AddProjectReference(pref).Solution); 2963Assert.Single(workspace.CurrentSolution.GetProject(project.Id).ProjectReferences);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Workspaces\TestWorkspace`1.cs (2)
454var hostProject = this.GetTestProject(projectChanges.NewProject.Id); 458base.OnProjectNameChanged(projectChanges.NewProject.Id, projectChanges.NewProject.Name, projectChanges.NewProject.FilePath);
Microsoft.CodeAnalysis.Workspaces.UnitTests (136)
FindReferencesTests.cs (3)
402""", NetCoreApp.References, solution.Projects.Single(pid => pid.Name == "NetStandardProject").Id); 416Assert.True(projectIds.Contains(netCoreProject.Id)); 502""", Net40.References.mscorlib, solution.Projects.Single(pid => pid.Name == "PortableProject").Id);
Formatter\FormatterTests.cs (4)
52var document = workspace.AddDocument(project.Id, "File.dummy", SourceText.From("dummy")); 70var document = workspace.AddDocument(project.Id, "File.dummy", SourceText.From("dummy")); 115var csDocument = workspace.AddDocument(csProject.Id, "File.cs", SourceText.From("class C { }")); 116var vbDocument = workspace.AddDocument(vbProject.Id, "File.vb", SourceText.From("Class C : End Class"));
Simplifier\SimplifierTests.cs (3)
29return workspace.AddDocument(project.Id, "CSharpFile.cs", SourceText.From("class C { }")); 78var csDocument = workspace.AddDocument(csProject.Id, "File.cs", SourceText.From("class C { }")); 79var vbDocument = workspace.AddDocument(vbProject.Id, "File.vb", SourceText.From("Class C : End Class"));
SolutionTests\ProjectDependencyGraphTests.cs (32)
216solution = solution.WithProjectReferences(solution.GetProjectsByName("C").Single().Id, []); 226var projectAId = solution.GetProjectsByName("A").Single().Id; 227var projectBId = solution.GetProjectsByName("B").Single().Id; 280var projectId = solution.GetProjectsByName(project).Single().Id; 297var projectId = solution.GetProjectsByName(project).Single().Id; 315solution = solution.WithProjectReferences(solution.GetProjectsByName("A").Single().Id, 395solution = solution.WithProjectReferences(solution.GetProjectsByName("C").Single().Id, []); 415solution = solution.RemoveProject(solution.GetProjectsByName("B").Single().Id); 437solution = solution.RemoveProject(solution.GetProjectsByName("B").Single().Id); 459solution = solution.RemoveProject(solution.GetProjectsByName("B").Single().Id); 481solution = solution.RemoveProject(solution.GetProjectsByName("B").Single().Id); 506var expected = solution.SolutionState.GetProjectDependencyGraph().GetProjectsThatTransitivelyDependOnThisProject(d.Id); 508var aToB = a.ProjectReferences.Single(reference => reference.ProjectId == b.Id); 509solution = solution.RemoveProjectReference(a.Id, aToB); 514Assert.Same(expected, solution.SolutionState.GetProjectDependencyGraph().GetTestAccessor().TryGetProjectsThatTransitivelyDependOnThisProject(d.Id)); 534var expected = solution.SolutionState.GetProjectDependencyGraph().GetProjectsThatTransitivelyDependOnThisProject(e.Id); 536var aToB = a.ProjectReferences.Single(reference => reference.ProjectId == b.Id); 537solution = solution.RemoveProjectReference(a.Id, aToB); 542Assert.Same(expected, solution.SolutionState.GetProjectDependencyGraph().GetTestAccessor().TryGetProjectsThatTransitivelyDependOnThisProject(e.Id)); 563var notExpected = solution.SolutionState.GetProjectDependencyGraph().GetProjectsThatTransitivelyDependOnThisProject(c.Id); 566var aToB = a.ProjectReferences.Single(reference => reference.ProjectId == b.Id); 567solution = solution.RemoveProjectReference(a.Id, aToB); 571Assert.Null(solution.SolutionState.GetProjectDependencyGraph().GetTestAccessor().TryGetProjectsThatTransitivelyDependOnThisProject(c.Id)); 615var firstBToC = b.ProjectReferences.First(reference => reference.ProjectId == c.Id); 616solution = solution.RemoveProjectReference(b.Id, firstBToC); 620var remainingBToC = b.ProjectReferences.Single(reference => reference.ProjectId == c.Id); 621solution = solution.RemoveProjectReference(b.Id, remainingBToC); 648var projectId = solution.GetProjectsByName(project).Single().Id; 660var projectId = solution.GetProjectsByName(project).Single().Id; 724references.Add(new ProjectReference(solution.GetProjectsByName(targetProject).Single().Id)); 728references.Add(new ProjectReference(solution.GetProjectsByName(targetProject).Single().Id, [$"alias{references.Count}"])); 733solution.GetProjectsByName(projectName).Single().Id,
SolutionTests\SolutionTests.cs (55)
1915var projectId = solution.Projects.Single().Id; 1948var projectId = solution.Projects.Single().Id; 1964var projectId = solution.Projects.Single().Id; 2006var projectId = solution.Projects.Single().Id; 2077var projectId = solution.Projects.Single().Id; 2095var projectId = solution.Projects.Single().Id; 2120var projectId = solution.Projects.Single().Id; 2147var projectId = solution.Projects.Single().Id; 2165var projectId = solution.Projects.Single().Id; 2193var projectId = solution.Projects.Single().Id; 2311var editorConfigId = DocumentId.CreateNewId(solution3.Projects.Single().Id); 2449var newDocumentId = DocumentId.CreateNewId(project.Id); 2617var pid2 = solution.Projects.Single().Id; 2868Assert.True(solution.ContainsProject(project.Id), "Solution was expected to have project " + project.Id); 2869Assert.Equal(project, solution.GetProject(project.Id)); 2892referenced, solution.GetProjectState(project.Id), includeCrossLanguage: true, CancellationToken.None); 4016Assert.Equal(pid2, projectForBaseType.Id); 4024Assert.Equal(pid1, projectForBaseType.Id); 4032var doc = ws.AddDocument(proj.Id, "a.cs", SourceText.From("public class c { }", Encoding.UTF32)); 4077projectReferences: [new ProjectReference(project1.Id)])); 4097workspace.AddDocument(project1.Id, "Broken.cs", SourceText.From("class ")); 4107projectReferences: [new ProjectReference(project1.Id)])); 4283projectReferences: [new ProjectReference(project1.Id)])); 4285var document = workspace.AddDocument(project2.Id, "Test.cs", SourceText.From("")); 4290Assert.True(await frozenSolution.GetProject(project1.Id).HasSuccessfullyLoadedAsync(CancellationToken.None)); 4291Assert.True(await frozenSolution.GetProject(project2.Id).HasSuccessfullyLoadedAsync(CancellationToken.None)); 4466currentSolution = currentSolution.WithProjectParseOptions(document1.Project.Id, options.WithPreprocessorSymbols("X")); 5331solution = solution.RemoveProject(solution.Projects.Single(p => p.Name == "CS2").Id); 5337solution = solution.RemoveProject(solution.Projects.Single(p => p.Name == "NC1").Id); 5386projectReferences: [new ProjectReference(csBrokenProject.Id), new ProjectReference(vbNormalProject.Id)], 5400projectReferences: [new ProjectReference(vbNormalProject.Id)], 5414projectReferences: [new ProjectReference(dependsOnBrokenProject.Id)])); 5424projectReferences: [new ProjectReference(dependsOnVbNormalProject.Id)])); 5450var s4 = s2.RemoveProject(s2.Projects.Single(p => p.Name == "P1").Id); 5662project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project; 5663project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project; 5664project1 = project2.Solution.GetProject(project1.Id); 5670var frozenProject1 = frozenSolution.GetProject(project1.Id); 5673var frozenProject2 = frozenSolution.GetProject(project2.Id); 5690project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project; 5691project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project; 5693project2 = project2.AddProjectReference(new(project1.Id)); 5694project1 = project2.Solution.GetProject(project1.Id); 5700var frozenProject1 = frozenSolution.GetProject(project1.Id); 5707var frozenProject2 = frozenSolution.GetProject(project2.Id); 5720project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project; 5721project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project; 5723project2 = project2.AddProjectReference(new(project1.Id)); 5724project1 = project2.Solution.GetProject(project1.Id); 5730var frozenProject1 = frozenSolution.GetProject(project1.Id); 5737var frozenProject2 = frozenSolution.GetProject(project2.Id); 5761var forkedProject1 = frozenSolution.WithDocumentText(project1.Documents.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id); 5800var forkedProject1 = frozenSolution.WithDocumentText(project1.Documents.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id);
SolutionTests\SolutionWithSourceGeneratorTests.cs (13)
677var projectWithReference = generatedDocument.Project.Solution.Projects.Single(p => p.Id != projectIdWithGenerator); 847DocumentId.CreateNewId(project.Id), 906var projectId2 = project2.Id; 1000generatedDocuments = await solution.GetRequiredProject(project.Id).GetSourceGeneratedDocumentsAsync(); 1217sourceGeneratedDocument1 = await solution.GetRequiredProject(project.Id).GetSourceGeneratedDocumentAsync(sourceGeneratedDocument1.Id); 1222sourceGeneratedDocument2 = await solution.GetRequiredProject(project.Id).GetSourceGeneratedDocumentAsync(sourceGeneratedDocument2.Id); 1226sourceGeneratedDocument1 = await solution.GetRequiredProject(project.Id).GetSourceGeneratedDocumentAsync(sourceGeneratedDocument1.Id); 1231sourceGeneratedDocument2 = await solution.GetRequiredProject(project.Id).GetSourceGeneratedDocumentAsync(sourceGeneratedDocument2.Id); 1238sourceGeneratedDocument1 = await solution.GetRequiredProject(project.Id).GetSourceGeneratedDocumentAsync(sourceGeneratedDocument1.Id); 1243sourceGeneratedDocument2 = await solution.GetRequiredProject(project.Id).GetSourceGeneratedDocumentAsync(sourceGeneratedDocument2.Id); 1466workspace.EnqueueUpdateSourceGeneratorVersion(project1.Id, forceRegeneration: true); 1471project1 = workspace.CurrentSolution.GetRequiredProject(project1.Id); 1502var projectId1 = initialSolution.Projects.Single().Id;
SymbolKeyTests.cs (2)
853var document = workspace.AddDocument(project.Id, "testdocument", sourceText); 900var document = workspace.AddDocument(project.Id, "testdocument", sourceText);
WorkspaceTests\AdhocWorkspaceTests.cs (13)
39Assert.Equal(info.Id, project.Id); 59var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 73var doc = ws.AddDocument(project.Id, name, SourceText.From(source)); 101Assert.Equal(pinfo.Id, project.Id); 133Assert.Equal(info1.Id, project1.Id); 139Assert.Equal(info2.Id, project2.Id); 377var projid = ws.AddProject("TestProject", LanguageNames.CSharp).Id; 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; 603.AddProjectReference(new ProjectReference(csProj.Id));
WorkspaceTests\WorkspaceReferenceTests.cs (5)
35var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 75var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 115var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs"); 155var referenceDocumentInfo = DocumentInfo.Create(DocumentId.CreateNewId(referenceProject.Id), "code.cs"); 159var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs");
WorkspaceTests\WorkspaceTests.cs (6)
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;
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
498var changedProj = solution.GetProject(proj.Id);
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
498var changedProj = solution.GetProject(proj.Id);
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
498var changedProj = solution.GetProject(proj.Id);
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
498var changedProj = solution.GetProject(proj.Id);
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
498var changedProj = solution.GetProject(proj.Id);
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
498var changedProj = solution.GetProject(proj.Id);
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
229return solution.WithProjectCompilationOptions(project.Id, ((CSharpCompilationOptions)project.CompilationOptions).WithAllowUnsafe(true));
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
229return solution.WithProjectCompilationOptions(project.Id, ((CSharpCompilationOptions)project.CompilationOptions).WithAllowUnsafe(true));
Microsoft.ML.CodeAnalyzer.Tests (1)
Code\BestFriendTest.cs (1)
74solution = solution.AddProjectReference(projectId, new ProjectReference(projectA.Id));
Microsoft.VisualStudio.LanguageServices (42)
CallHierarchy\CallHierarchyProvider.cs (7)
107new MethodCallFinder(symbol, project.Id, AsyncListener, this) 112finders.Add(new OverridingMemberFinder(symbol, project.Id, AsyncListener, this)); 118finders.Add(new CallToOverrideFinder(symbol, project.Id, AsyncListener, this)); 123finders.Add(new BaseMemberFinder(overridenMember, project.Id, AsyncListener, this)); 129finders.Add(new InterfaceImplementationCallFinder(implementedInterfaceMember, project.Id, AsyncListener, this)); 134finders.Add(new ImplementerFinder(symbol, project.Id, AsyncListener, this)); 141return [new FieldReferenceFinder(symbol, project.Id, AsyncListener, this)];
CodeLens\CodeLensCallbackListener.cs (3)
76var projectGuid = _workspace.GetProjectGuid(project.Id); 80var projectVersion = await service.GetProjectCodeLensVersionAsync(solution, project.Id, cancellationToken).ConfigureAwait(false); 108var currentProjectVersion = await service.GetProjectCodeLensVersionAsync(solution, document.Project.Id, cancellationToken).ConfigureAwait(false);
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (1)
85.Where(p => _workspace.GetHierarchy(p.Id) == hierarchy);
FindReferences\StreamingFindUsagesPresenter.cs (1)
284var guid = vsWorkspace?.GetProjectGuid(document.Project.Id) ?? Guid.Empty;
GenerateType\GenerateTypeDialogViewModel.cs (4)
416this.ProjectFolders = _projectManagementService.GetFolders(this.SelectedProject.Id, this.SelectedProject.Solution.Workspace); 698.Where(p => p != document.Project && !dependencyGraph.GetProjectsThatThisProjectTransitivelyDependsOn(p.Id).Contains(document.Project.Id)) 735this.ProjectFolders = _projectManagementService.GetFolders(this.SelectedProject.Id, this.SelectedProject.Solution.Workspace);
Implementation\AbstractEditorFactory.cs (1)
323var documentId = DocumentId.CreateNewId(projectToAddTo.Id);
Implementation\IHierarchyItemToProjectIdMap.cs (1)
42projectId = project.Id;
Interactive\VsResetInteractive.cs (1)
164=> _workspace.CurrentSolution.Projects.FirstOrDefault(proj => _workspace.GetHierarchy(proj.Id) == hierarchy);
LanguageServer\Handler\Diagnostics\VisualStudioDiagnosticProjectInformationService.cs (1)
23var guid = workspace.GetProjectGuid(project.Id);
LanguageService\AbstractCreateServicesOnTextViewConnection.cs (1)
106_workQueue.AddWork(e.Document.Project.Id);
Library\ObjectBrowser\AbstractListItemFactory.cs (2)
516set.Add((project.Id, compilation.Assembly)); 526set.Add((project.Id, referenceAssembly));
Library\ObjectBrowser\Extensions.cs (4)
69&& workspace.GetHierarchy(project.Id) is { } hierarchy 85if (other.Id == project.Id) 131var hierarchy = workspace.GetHierarchy(project.Id);
Library\ObjectBrowser\Lists\ProjectListItem.cs (1)
16: base(project.Id, GetProjectGlyph(project))
Library\VsNavInfo\NavInfoFactory.cs (1)
183var hierarchy = workspace.GetHierarchy(project.Id);
ProjectSystem\VisualStudioProjectManagementService.cs (1)
42vsWorkspace.GetProjectData(project.Id,
ProjectSystem\VisualStudioWorkspaceImpl.cs (7)
310=> IsCPSProject(project.Id); 346var maxSupportLangVersion = ProjectSystemProjectFactory.TryGetMaxSupportedLanguageVersion(project.Id); 1057OpenDocumentFromPath(document.FilePath, document.Project.Id, activate); 1564if (projects.RemoveAll(p => p.Id == project.Id) > 0) 1575_projectToHierarchyMap = _projectToHierarchyMap.Remove(project.Id); 1576_projectToGuidMap = _projectToGuidMap.Remove(project.Id); 1578ImmutableInterlocked.TryRemove(ref _projectToRuleSetFilePath, project.Id, out _);
Snippets\SnippetExpansionClient.cs (1)
1086var projectId = originalProject.Id;
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
287projectId: project.Id);
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (1)
138return p => projectHierarchy == null || p.Id == projectIdToMatch;
TaskList\ProjectExternalErrorReporter.cs (1)
288projectId: project.Id,
Workspace\VisualStudioDocumentNavigationService.cs (1)
300vsWorkspace.OpenDocumentFromPath(mappedSpanResult.FilePath, generatedDocument.Project.Id);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
PersistentStorage\AbstractPersistentStorageTests.cs (3)
872var id = DocumentId.CreateNewId(solution.Projects.Single().Id); 892var id = DocumentId.CreateNewId(solution.Projects.Single().Id); 991solution = solution.AddDocument(DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "Document1",
Microsoft.VisualStudio.LanguageServices.Implementation (11)
CodeModel\FileCodeModel.cs (1)
167documentId = project.Solution.GetDocumentIdsWithFilePath(_incomingFilePath).FirstOrDefault(d => d.ProjectId == project.Id);
CodeModel\FileCodeModel_Events.cs (1)
58var projectCodeModel = this.State.ProjectCodeModelFactory.GetProjectCodeModel(document.Project.Id);
CodeModel\ProjectCodeModelFactory.cs (1)
276=> GetProjectCodeModel(sourceGeneratedDocument.Project.Id).CreateFileCodeModel(sourceGeneratedDocument);
CodeModel\TextManagerAdapter.cs (1)
22var hierarchyOpt = fileCodeModel.Workspace.GetHierarchy(document.Project.Id);
RoslynVisualStudioWorkspace.cs (1)
97var currentProject = project.Solution.Workspace.CurrentSolution.GetProject(project.Id);
SolutionExplorer\AnalyzerItem\AnalyzerItemSource.cs (1)
164solutionChecksum, project.Id, analyzerFileReference.FullPath, cancellationToken),
SolutionExplorer\DiagnosticItem\BaseDiagnosticAndGeneratorItemSource.cs (4)
171return (BaseItem)new DiagnosticItem(project.Id, analyzerReference, selectedDiagnostic, effectiveSeverity, CommandHandler); 185solutionChecksum, project.Id, analyzerFileReference.FullPath, project.Language, cancellationToken), 203identity => (BaseItem)new SourceGeneratorItem(project.Id, identity, analyzerReference.FullPath)); 216solutionChecksum, project.Id, analyzerFileReference.FullPath, cancellationToken),
SolutionExplorer\SymbolTree\RootSymbolTreeItemCollectionSource.cs (1)
105return documentIds.FirstOrDefault(static (d, projectId) => d.ProjectId == projectId, project.Id);
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Client\RemoteLanguageServiceWorkspace.cs (1)
335DocumentId.CreateNewId(project.Id),
Microsoft.VisualStudio.LanguageServices.Xaml (2)
Implementation\LanguageServer\Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (1)
142ProjectIdentifier = project.Id.Id.ToString(),
Implementation\XamlProjectService.cs (1)
207var project = _xamlProjects.Values.SingleOrDefault(p => p.Id == document.Project.Id);
Roslyn.VisualStudio.Next.UnitTests (80)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
48var document = workspace.AddDocument(project.Id, "doc.cs", SourceText.From("code"));
Remote\SnapshotSerializationTests.cs (4)
56solution = document2.Project.Solution.GetRequiredProject(project1.Id) 57.AddProjectReference(new ProjectReference(project2.Id, ["test"])) 65DocumentId.CreateNewId(project1.Id), 494AssertEx.Equal([file1.Path, file2.Path], recovered.GetProject(project.Id).AnalyzerReferences.Select(r => r.FullPath));
Services\ServiceHubServicesTests.cs (8)
311projectId1 = solution.Projects.Single(p => p.Name == "Project0").Id; 312projectId2 = solution.Projects.Single(p => p.Name == "Project1").Id; 1820Assert.True(initialExecutionMap.ContainsKey(noCompilationProject.Id)); 1830Assert.True(finalExecutionMap.ContainsKey(noCompilationProject.Id)); 1834Assert.NotEqual(initialExecutionMap[noCompilationProject.Id], finalExecutionMap[noCompilationProject.Id]); 1938var projectId = project.Id; 2094var projectId = project.Id;
Services\SolutionServiceTests.cs (63)
560var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); 561await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); 566var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); 567await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); 592await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); 593var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); 599await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); 600var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); 627solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 633await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); 634var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); 640await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None); 641var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None); 660solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 667await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None); 668var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None); 673await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); 674var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); 680await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); 681var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); 701solution = project3.Solution.AddProjectReference(project3.Id, new(project2.Id)) 702.AddProjectReference(project2.Id, new(project1.Id)); 709await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None); 710var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None); 715await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); 716var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); 721await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); 722var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); 741solution = project3.Solution.AddProjectReference(project3.Id, new(project2.Id)) 742.AddProjectReference(project3.Id, new(project1.Id)); 749await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None); 750var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None); 755await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); 756var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); 761await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); 762var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); 787await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); 788var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); 794await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); 795var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); 826solution = solution.GetProject(project1.Id).AddDocument("X.cs", SourceText.From("// X")).Project.Solution; 827solution = solution.GetProject(project2.Id).AddDocument("Y.vb", SourceText.From("' Y")).Project.Solution; 832await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); 833var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); 844await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); 845var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); 881solution = solution.GetProject(project1.Id).AddDocument("X.cs", SourceText.From("// X")).Project.Solution; 882solution = solution.GetProject(project2.Id).AddDocument("Y.cs", SourceText.From("// Y")).Project.Solution; 883solution = solution.GetProject(project1.Id).AddProjectReference(new ProjectReference(project2.Id)).Solution; 888await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); 889var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); 892var project1Synced = project1SyncedSolution.GetRequiredProject(project1.Id); 893var project2Synced = project1SyncedSolution.GetRequiredProject(project2.Id); 921var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); 957await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); 958var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (4)
52var analyzerResult = await AnalyzeAsync(workspace, project.Id, analyzerType, isHostAnalyzer); 60analyzerResult = await AnalyzeAsync(workspace, project.Id, analyzerType, isHostAnalyzer); 85var analyzerResult = await AnalyzeAsync(workspace, project.Id, analyzerType, isHostAnalyzer); 93analyzerResult = await AnalyzeAsync(workspace, project.Id, analyzerType, isHostAnalyzer);