1 instantiation of Project
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Solution.cs (1)
158return new Project(solution, state);
2218 references to Project
Analyzer.Utilities.UnitTests (4)
FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisTests.cs (3)
64Project project = CreateProject(new string[] { source, TestTypeToTrackSource }); 1286protected static Project CreateProject(string[] sources) 1299Project project = new AdhocWorkspace().CurrentSolution
Options\SymbolNamesWithValueOptionTests.cs (1)
423var project = new AdhocWorkspace().CurrentSolution
AnalyzerRunner (10)
CodeRefactoringRunner.cs (1)
55foreach (var project in solution.Projects)
DiagnosticAnalyzerRunner.cs (7)
45var project = solution.GetProject(projectId)!; 95foreach (var project in solution.Projects) 107var project = solution.GetProject(projectId); 153var project = solution.GetProject(projectId); 178private static async Task<DocumentAnalyzerPerformance> TestDocumentPerformanceAsync(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, Project project, DocumentId documentId, Options analyzerOptionsInternal, CancellationToken cancellationToken) 327foreach (var project in solution.Projects) 381Project project,
Program.cs (2)
148foreach (var project in projects) 188private static Statistic GetSolutionStatistics(IEnumerable<Project> projects, CancellationToken cancellationToken)
IdeBenchmarks (1)
InheritanceMargin\BenchmarksHelpers.cs (1)
23foreach (var project in solution.Projects)
IdeCoreBenchmarks (14)
ClassificationBenchmarks.cs (1)
96var project = _solution.Projects.First(p => p.AssemblyName == "Microsoft.CodeAnalysis");
FindReferencesBenchmarks.cs (1)
93var project = _solution.Projects.First(p => p.AssemblyName == "Microsoft.CodeAnalysis");
IncrementalSourceGeneratorBenchmarks.cs (1)
145var project = _workspace.CurrentSolution.Projects.Single(p => p.Name == "Microsoft.CodeAnalysis.Workspaces(netstandard2.0)");
NavigateToBenchmarks.cs (4)
111foreach (var project in _workspace.CurrentSolution.Projects) 145foreach (var project in _workspace.CurrentSolution.Projects) 164foreach (var project in _workspace.CurrentSolution.Projects) 226private async Task<int> SearchAsync(Solution solution, IGrouping<INavigateToSearchService, Project> grouping, ImmutableArray<Document> priorityDocuments)
ProjectOperationBenchmarks.cs (5)
23private Project _emptyProject; 24private Project _hundredProject; 25private Project _thousandsProject; 39private Project Project 63static Project CreateProject(ref Solution solution, string name, int documentCount)
RenameBenchmarks.cs (1)
47var project = _solution.Projects.First();
SwitchStatementBenchmarks.cs (1)
74var project = solution.Projects.First();
Metrics (2)
Program.cs (2)
305var project = await workspace.OpenProjectAsync(projectFile, cancellationToken: CancellationToken.None).ConfigureAwait(false); 338foreach (var project in solution.Projects)
Metrics.Legacy (2)
src\RoslynAnalyzers\Tools\Metrics\Program.cs (2)
305var project = await workspace.OpenProjectAsync(projectFile, cancellationToken: CancellationToken.None).ConfigureAwait(false); 338foreach (var project in solution.Projects)
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
264GetOrMakeTargetClassAsync(Project proj, FixDetails details, CancellationToken cancellationToken)
Microsoft.Analyzers.Extra.Tests (19)
CallAnalysis\LegacyLoggingTests.cs (1)
815var proj = RoslynTestUtils
Resources\RoslynTestUtils.cs (18)
30public static Project CreateTestProject(IEnumerable<Assembly>? references, bool includeBaseReferences = true, 64public static void CommitChanges(this Project proj) 69public static Project WithDocument(this Project proj, string name, string text) 74public static Document FindDocument(this Project proj, string name) 182var proj = CreateTestProject(references, includeBaseReferences); 210var proj = CreateTestProject(references, includeBaseReferences); 242var proj = CreateTestProject(references, testAssemblyName: testAssemblyName); 298var proj = CreateTestProject(references, testAssemblyName: testAssemblyName); 363var changedProj = solution.GetProject(proj.Id); 413var proj = CreateTestProject(references); 457var changedProj = solution.GetProject(proj.Id); 492private static async Task<Project> RecreateProjectDocumentsAsync(Project project) 513Project project, 522public override async Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 533public override async Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken) 549private Project _project;
Microsoft.Analyzers.Local.Tests (18)
Resources\RoslynTestUtils.cs (18)
30public static Project CreateTestProject(IEnumerable<Assembly>? references, bool includeBaseReferences = true, 64public static void CommitChanges(this Project proj) 69public static Project WithDocument(this Project proj, string name, string text) 74public static Document FindDocument(this Project proj, string name) 182var proj = CreateTestProject(references, includeBaseReferences); 210var proj = CreateTestProject(references, includeBaseReferences); 242var proj = CreateTestProject(references, testAssemblyName: testAssemblyName); 299var proj = CreateTestProject(references, testAssemblyName: testAssemblyName); 364var changedProj = solution.GetProject(proj.Id); 414var proj = CreateTestProject(references); 458var changedProj = solution.GetProject(proj.Id); 493private static async Task<Project> RecreateProjectDocumentsAsync(Project project) 514Project project, 523public override async Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 534public override async Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken) 550private Project _project;
Microsoft.AspNetCore.Analyzer.Testing (10)
CodeFixRunner.cs (2)
36var updatedProject = updatedSolution.GetProject(document.Project.Id); 44private async Task EnsureCompilable(Project project)
DiagnosticAnalyzerRunner.cs (3)
37var project = DiagnosticProject.Create(GetType().Assembly, sources); 54IEnumerable<Project> projects, 60foreach (var project in projects)
DiagnosticProject.cs (1)
31public static Project Create(Assembly testAssembly, string[] sources, Func<Workspace> workspaceFactory = null, Type[] analyzerReferences = null)
DiagnosticVerifier.cs (4)
73var projects = new HashSet<Project>(); 80foreach (var project in projects) 141var project = CreateProject(sources); 154protected Project CreateProject(params string[] sources)
Microsoft.AspNetCore.App.Analyzers.Test (8)
Infrastructure\WellKnownTypesTests.cs (1)
63var project = TestDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, source.Source);
TestDiagnosticAnalyzer.cs (7)
31var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, sources); 48var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, sources); 70var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, sources); 109var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, sources); 146public static Project CreateProjectWithReferencesInBinDir(Assembly testAssembly, params string[] source) 154var project = DiagnosticProject.Create(testAssembly, source, createWorkspace, [typeof(RoutePatternClassifier), typeof(ExtensionMethodsCompletionProvider)]); 166public Task<Diagnostic[]> GetDiagnosticsAsync(Project project)
Microsoft.AspNetCore.Components.Analyzers.Tests (6)
AnalyzerTestBase.cs (1)
31public Project CreateProject(string source)
ComponentAnalyzerDiagnosticAnalyzerRunner.cs (1)
24public Task<Diagnostic[]> GetDiagnosticsAsync(Project project)
Helpers\DiagnosticVerifier.Helper.cs (4)
53var projects = new HashSet<Project>(); 60foreach (var project in projects) 116var project = CreateProject(sources, language); 144private static Project CreateProject(string[] sources, string language = LanguageNames.CSharp)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (6)
AnalyzerTestBase.cs (1)
31public Project CreateProject(string source)
ComponentAnalyzerDiagnosticAnalyzerRunner.cs (1)
24public Task<Diagnostic[]> GetDiagnosticsAsync(Project project)
Helpers\DiagnosticVerifier.Helper.cs (4)
53var projects = new HashSet<Project>(); 60foreach (var project in projects) 116var project = CreateProject(sources, language); 144private static Project CreateProject(string[] sources, string language = LanguageNames.CSharp)
Microsoft.AspNetCore.Http.Extensions.Tests (12)
RequestDelegateGenerator\CompileTimeCreationTests.cs (8)
53var project = CreateProject(); 79var project = CreateProject(); 158var project = CreateProject(modifyCompilationOptions: 231var project = CreateProject(); 285var project = CreateProject(); 332var project = CreateProject(); 668var project = CreateProject(); 725var project = CreateProject();
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (4)
39private static readonly Project _baseProject = CreateProject(); 306var project = _baseProject.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8)).Project; 311internal static Project CreateProject(Func<CSharpCompilationOptions, CSharpCompilationOptions> modifyCompilationOptions = null) 320var project = new AdhocWorkspace().CurrentSolution
Microsoft.AspNetCore.Http.Microbenchmarks (5)
RequestDelegateGeneratorBenchmarks.cs (1)
25var project = CreateProject();
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (4)
39private static readonly Project _baseProject = CreateProject(); 306var project = _baseProject.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8)).Project; 311internal static Project CreateProject(Func<CSharpCompilationOptions, CSharpCompilationOptions> modifyCompilationOptions = null) 320var project = new AdhocWorkspace().CurrentSolution
Microsoft.CodeAnalysis.Analyzers (24)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (5)
104private static Task<Solution> AddAnalyzerReleaseTrackingFilesAsync(Project project) 111static Project AddAdditionalDocument(Project project, string name, string fileContent) 168private static async Task<Solution> AddEntryToUnshippedFileAsync(Project project, string entryToAdd, CancellationToken cancellationToken) 186private static async Task<Solution> UpdateEntryInUnshippedFileAsync(Project project, string ruleId, string entryToUpdate, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (10)
27var diagnosticsToFix = new List<KeyValuePair<Project, ImmutableArray<Diagnostic>>>(); 33diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(fixAllContext.Project, diagnostics)); 39Project project = fixAllContext.Project; 41diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(fixAllContext.Project, diagnostics)); 47foreach (Project project in fixAllContext.Solution.Projects) 50diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(project, diagnostics)); 75private readonly List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> _diagnosticsToFix; 78public FixAllAdditionalDocumentChangeAction(FixAllScope fixAllScope, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix, string? equivalenceKey) 93foreach (KeyValuePair<Project, ImmutableArray<Diagnostic>> pair in _diagnosticsToFix) 95Project project = pair.Key;
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (9)
40var diagnosticsToFix = new List<KeyValuePair<Project, ImmutableArray<Diagnostic>>>(); 46diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(fixAllContext.Project, diagnostics)); 52Project project = fixAllContext.Project; 54diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(fixAllContext.Project, diagnostics)); 60foreach (Project project in fixAllContext.Solution.Projects) 63diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(project, diagnostics)); 82private readonly List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> _diagnosticsToFix; 85public FixAllAdditionalDocumentChangeAction(FixAllScope fixAllScope, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix, string equivalenceKey) 102var project = kvp.Key;
Microsoft.CodeAnalysis.CodeStyle.Fixes (26)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (4)
20Project project, 34Compilation compilation, ISet<string> availableTypeParameterNames, Project project, CancellationToken cancellationToken) : AsyncSymbolVisitor 40private readonly Project _project = project; 124INamedTypeSymbol constraintType, IImmutableSet<Project> projects)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
55foreach (var project in fixAllContext.Solution.Projects)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (5)
22public abstract Solution UpgradeProject(Project project, string version); 23public abstract bool IsUpgrade(Project project, string newVersion); 43var project = context.Document.Project; 82var currentProject = currentSolution.GetRequiredProject(projectId); 93private bool CanUpgrade(Project project, string language, string version)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
15Project triggerProject)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (2)
38public static Project GetRequiredProject(this Solution solution, ProjectId projectId) 40var project = solution.GetProject(projectId);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (9)
17public static TLanguageService? GetLanguageService<TLanguageService>(this Project? project) where TLanguageService : class, ILanguageService 24public static TLanguageService GetRequiredLanguageService<TLanguageService>(this Project project) where TLanguageService : class, ILanguageService 33/// Gets extended host language services, which includes language services from <see cref="Project.LanguageServices"/>. 35public static HostLanguageServices GetExtendedLanguageServices(this Project project) 44public static string? TryGetAnalyzerConfigPathForProjectConfiguration(this Project project) 47public static string? TryGetAnalyzerConfigPathForDiagnosticConfiguration(this Project project, Diagnostic diagnostic) 53private static string? TryGetAnalyzerConfigPathForProjectOrDiagnosticConfiguration(Project project, Diagnostic? diagnostic) 101public static AnalyzerConfigDocument? TryGetExistingAnalyzerConfigDocumentAtPath(this Project project, string analyzerConfigPath) 109public static async Task<Compilation> GetRequiredCompilationAsync(this Project project, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
58foreach (var sourceProject in solution.Projects) 76var project = solution.GetProject(symbol.ContainingAssembly, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
25public Project Project => Document.Project;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
12public static bool CanApplyParseOptionChange(this Project project, ParseOptions oldOptions, ParseOptions newOptions)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
38private static Solution AllowUnsafeOnProject(Project project)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (2)
87public override Solution UpgradeProject(Project project, string newVersion) 103public override bool IsUpgrade(Project project, string newVersion)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
39var project = document.Project;
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
RawStringLiteral\RawStringLiteralCommandHandler_Return.cs (1)
176var project = document.Project;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (68)
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
46internal override CompletionService GetCompletionService(Project project)
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (4)
3984var p1 = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 3985var updatedP1 = p1.AddMetadataReference(reference); 4042var project = workspace.CurrentSolution.Projects.Single(); 4043var updatedProject = project.AddMetadataReference(libRef);
Completion\CompletionServiceTests.cs (1)
206var project = SolutionUtilities.AddEmptyProject(workspace.CurrentSolution)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
764var project = workspace.CurrentSolution.Projects.Single();
EditAndContinue\ActiveStatementTrackingServiceTests.cs (1)
67var project = solution.Projects.Single();
Formatting\CodeCleanupTests.cs (1)
787var project = workspace.CurrentSolution.Projects.Single();
Formatting\CodeCleanupTests.TestFixers.cs (2)
93Project? project = null; 149Project? project = null;
Formatting\RazorLineFormattingOptionsTests.cs (1)
46var project = workspace.AddProject("Test", LanguageNames.CSharp);
NavigateTo\NavigateToSearcherTests.cs (19)
42It.IsAny<ImmutableArray<Project>>(), 51ImmutableArray<Project> projects, 66It.IsAny<ImmutableArray<Project>>(), 74ImmutableArray<Project> projects, 92It.IsAny<ImmutableArray<Project>>(), 101ImmutableArray<Project> projects, 134hostMock.Setup(h => h.GetNavigateToSearchService(It.IsAny<Project>())).Returns(searchService.Object); 173hostMock.Setup(h => h.GetNavigateToSearchService(It.IsAny<Project>())).Returns(searchService.Object); 212hostMock.Setup(h => h.GetNavigateToSearchService(It.IsAny<Project>())).Returns(searchService.Object); 248hostMock.Setup(h => h.GetNavigateToSearchService(It.IsAny<Project>())).Returns(searchService.Object); 280hostMock.Setup(h => h.GetNavigateToSearchService(It.IsAny<Project>())).Returns(() => null); 338hostMock.Setup(h => h.GetNavigateToSearchService(It.IsAny<Project>())).Returns(() => searchService); 391var project = workspace.CurrentSolution.Projects.Single(); 394hostMock.Setup(h => h.GetNavigateToSearchService(It.IsAny<Project>())).Returns(() => searchService); 451var project = workspace.CurrentSolution.Projects.Single(); 454hostMock.Setup(h => h.GetNavigateToSearchService(It.IsAny<Project>())).Returns(() => searchService); 515public Task SearchCachedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 527public Task SearchGeneratedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 533public Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (9)
101Project project, 121Project project, 172var mappedProject = provider.MapDocument(document); 187protected static Task<(Project, ISymbol)> CompileAndFindSymbolAsync( 202protected static async Task<(Project, ISymbol)> CompileAndFindSymbolAsync( 223var project = workspace.CurrentSolution.Projects.First(); 248protected static void CompileTestSource(string path, SourceText source, Project project, Location pdbLocation, Location sourceLocation, bool buildReferenceAssembly, bool windowsPdb, Encoding? fallbackEncoding = null) 258protected static void CompileTestSource(string dllFilePath, string sourceCodePath, string? pdbFilePath, string assemblyName, SourceText source, Project project, Location pdbLocation, Location sourceLocation, bool buildReferenceAssembly, bool windowsPdb, Encoding? fallbackEncoding = null) 263protected static void CompileTestSource(string dllFilePath, string[] sourceCodePaths, string? pdbFilePath, string assemblyName, SourceText[] sources, Project project, Location pdbLocation, Location sourceLocation, bool buildReferenceAssembly, bool windowsPdb, Encoding? fallbackEncoding = null)
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (7)
170var implProject = workspace.CurrentSolution.Projects.First(); 237var implProject = workspace.CurrentSolution.Projects.First(); 298var implProject = workspace.CurrentSolution.Projects.First(); 353var implProject = workspace.CurrentSolution.Projects.First(); 404var implProject = workspace.CurrentSolution.Projects.First(); 469var implProject = workspace.CurrentSolution.Projects.First(); 527var implProject = workspace.CurrentSolution.Projects.First();
PdbSourceDocument\NullResultMetadataAsSourceFileProvider.cs (2)
40public Task<MetadataAsSourceFile?> GetGeneratedFileAsync(MetadataAsSourceWorkspace metadataWorkspace, Workspace sourceWorkspace, Project sourceProject, ISymbol symbol, bool signaturesOnly, MetadataAsSourceOptions options, string tempPath, TelemetryMessage? telemetry, CancellationToken cancellationToken) 45public Project? MapDocument(Document document)
PdbSourceDocument\PdbSourceDocumentTests.cs (3)
484var implProject = workspace.CurrentSolution.Projects.First(); 531var implProject = workspace.CurrentSolution.Projects.First(); 936var project = workspace.CurrentSolution.Projects.First();
SymbolKey\SymbolKeyTests.cs (8)
44var project = solution.Projects.Single(); 79var project = solution.Projects.Single(); 118var project = solution.Projects.Single(); 164var project = solution.Projects.Single(); 196var bodyProject = solution.Projects.Single(p => p.AssemblyName == "BodyProject"); 197var referenceProject = solution.Projects.Single(p => p.AssemblyName == "ReferenceProject"); 254async Task<(Compilation bodyCompilation, Compilation referenceCompilation)> GetCompilationsAsync(Project bodyProject, Project referenceProject)
Workspaces\WorkspaceTests_EditorFeatures.cs (8)
1064var project = workspace.CurrentSolution.Projects.Single(); 1088var project = workspace.CurrentSolution.Projects.Single(); 1120var project = workspace.CurrentSolution.Projects.Single(); 1153var project = workspace.CurrentSolution.Projects.Single(); 1243var project = workspace.CurrentSolution.Projects.Single(); 1279var project = workspace.CurrentSolution.Projects.Single(); 1317var project = workspace.CurrentSolution.Projects.Single(); 1345var project = workspace.CurrentSolution.Projects.Single();
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
63var project = solution.AddProject("test", "test", LanguageNames.CSharp);
Microsoft.CodeAnalysis.CSharp.Features (13)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
61private static bool ShouldOfferRefactoring(Project project) 69Project project, CodeActionPurpose purpose, CancellationToken cancellationToken)
GenerateType\CSharpGenerateTypeService.cs (1)
657internal override bool IsPublicOnlyAccessibility(ExpressionSyntax expression, Project project)
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
25protected override Task<ISymbol> FindRelatedExplicitlyDeclaredSymbolAsync(Project project, ISymbol symbol, CancellationToken cancellationToken)
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (2)
44protected abstract Task UpdateReferencesAsync(Project project, SolutionEditor solutionEditor, ISymbol implMember, INamedTypeSymbol containingType, CancellationToken cancellationToken); 210Project project, MemberImplementationMap implMemberToInterfaceMembers, CancellationToken cancellationToken)
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
40Project project, SolutionEditor solutionEditor,
ImplementInterface\CSharpImplementImplicitlyCodeRefactoringProvider.cs (1)
44protected override Task UpdateReferencesAsync(Project project, SolutionEditor solutionEditor, ISymbol implMember, INamedTypeSymbol containingType, CancellationToken cancellationToken)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (1)
79var project = document.Project;
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
38private static Solution AllowUnsafeOnProject(Project project)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (2)
87public override Solution UpgradeProject(Project project, string newVersion) 103public override bool IsUpgrade(Project project, string newVersion)
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
91var project = propertyDocument.Project;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (17)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (17)
119Project oldProject, 303var oldProject = oldSolution.Projects.Single(); 370var oldProject = oldSolution.Projects.Single(); 397var oldProject = oldSolution.Projects.Single(); 431var oldProject = oldSolution.Projects.Single(); 467var oldProject = oldSolution.Projects.Single(); 513var oldProject = oldSolution.Projects.Single(); 545var oldProject = oldSolution.Projects.Single(); 582var oldProject = oldSolution.Projects.Single(); 621var oldProject = oldSolution.Projects.Single(); 664var oldProject = oldSolution.Projects.Single(); 668var newProject = newSolution.Projects.Single(); 710var oldProject = oldSolution.Projects.Single(); 714var newProject = newSolution.Projects.Single(); 743var oldProject = oldSolution.Projects.Single(); 746var newProject = newSolution.Projects.Single(); 800var oldProject = oldSolution.Projects.Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
39var project = document.Project;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (7)
CodeGeneration\AddAttributesTests.cs (1)
27var emptyProject = ws.AddProject(
CodeGeneration\AddImportsTests.cs (2)
31var emptyProject = ws.AddProject( 777var emptyProject = ws.AddProject(
Formatting\FormattingMultipleSpanTests.cs (1)
164var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp);
Formatting\FormattingTreeEditTests.cs (1)
24var project = ws.AddProject("project", LanguageNames.CSharp);
OrganizeImports\OrganizeUsingsTests.cs (2)
29var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp); 90var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp);
Microsoft.CodeAnalysis.EditorFeatures (20)
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (2)
295var oldProject = args.OldSolution.GetProject(args.ProjectId); 296var newProject = args.NewSolution.GetProject(args.ProjectId);
EditorConfigSettings\DataProvider\Analyzer\AnalyzerSettingsProvider.cs (1)
35protected override void UpdateOptions(TieredAnalyzerConfigOptions options, ImmutableArray<Project> projectsInScope)
EditorConfigSettings\DataProvider\NamingStyles\NamingStyleSettingsProvider.cs (1)
26protected override void UpdateOptions(TieredAnalyzerConfigOptions options, ImmutableArray<Project> projectsInScope)
EditorConfigSettings\DataProvider\SettingsProviderBase.cs (2)
36protected abstract void UpdateOptions(TieredAnalyzerConfigOptions options, ImmutableArray<Project> projectsInScope); 56var project = projects.FirstOrDefault();
EditorConfigSettings\Extensions\SolutionExtensions.cs (4)
14public static ImmutableArray<Project> GetProjectsUnderEditorConfigFile(this Solution solution, string pathToEditorConfigFile) 24var builder = ArrayBuilder<Project>.GetInstance(); 25foreach (var project in solution.Projects) 41static bool TryGetFolderContainingProject(Project project, [NotNullWhen(true)] out DirectoryInfo? directoryInfo)
Interactive\InteractiveSession.cs (3)
247var initProject = CreateSubmissionProjectNoLock(solution, initializationScriptProjectId, previousSubmissionProjectId: null, languageName, initializationScriptImports, initializationScriptReferences); 254var newSubmissionProject = CreateSubmissionProjectNoLock(solution, _currentSubmissionProjectId, _lastSuccessfulSubmissionProjectId, languageName, imports, references); 271private Project CreateSubmissionProjectNoLock(Solution solution, ProjectId newSubmissionProjectId, ProjectId? previousSubmissionProjectId, string languageName, ImmutableArray<string> imports, ImmutableArray<MetadataReference> references)
Navigation\AbstractDefinitionLocationService.cs (1)
129Project project, int position, ISymbol symbol, Document originalDocument, CancellationToken cancellationToken)
Preview\AbstractPreviewFactoryService.cs (4)
89var oldProject = projectChanges.OldProject; 90var newProject = projectChanges.NewProject; 199foreach (var project in solutionChanges.GetAddedProjects()) 206foreach (var project in solutionChanges.GetRemovedProjects())
Preview\SolutionPreviewItem.cs (1)
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>
SolutionEvents\HostLegacySolutionEventsWorkspaceEventListener.cs (1)
75var project = e.OldSolution.GetProject(projectId) ?? e.NewSolution.GetProject(projectId);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (8)
Completion\AbstractCompletionProviderTests.cs (1)
103internal virtual CompletionService GetCompletionService(Project project)
Diagnostics\GenerateType\GenerateTypeTestState.cs (2)
23public Project ProjectToBeModified { get; } 24public Project TriggeredProject { get; }
Diagnostics\GenerateType\TestGenerateTypeOptionsService.cs (2)
24public Project Project = null; 76Project project = null,
Diagnostics\GenerateType\TestProjectManagementService.cs (1)
29public string GetDefaultNamespace(Project project, Workspace workspace)
ObsoleteSymbol\AbstractObsoleteSymbolTests.cs (1)
27var project = workspace.CurrentSolution.Projects.Single();
ReassignedVariable\AbstractReassignedVariableTests.cs (1)
26var project = workspace.CurrentSolution.Projects.Single();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (6)
Utilities\GoToHelpers\MockSymbolNavigationService.vb (2)
19Public Function GetNavigableLocationAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements ISymbolNavigationService.GetNavigableLocationAsync 24Public Function TrySymbolNavigationNotifyAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of Boolean) Implements ISymbolNavigationService.TrySymbolNavigationNotifyAsync
Utilities\MockSymbolNavigationServiceProvider.vb (4)
37Public TryNavigateToSymbolProvidedProject As Project 40Public TrySymbolNavigationNotifyProvidedProject As Project 48Public Function GetNavigableLocationAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements ISymbolNavigationService.GetNavigableLocationAsync 56project As Project,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (56)
CodeFixes\CodeFixServiceTests.cs (4)
56var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference); 293var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference); 385var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference); 769var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference);
CodeRefactorings\CodeRefactoringServiceTest.cs (4)
48var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference); 106var project = workspace.CurrentSolution.Projects.Single(); 165var project = workspace.CurrentSolution.Projects.Single() 204var project = workspace.CurrentSolution.Projects.Single()
Completion\CompletionServiceTests.cs (1)
43var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (15)
154var project = workspace.AddProject( 250var project = workspace.AddProject( 276var project = workspace.CurrentSolution.Projects.Single(); 287var project = workspace.CurrentSolution.Projects.Single(); 298var project = workspace.CurrentSolution.Projects.Single(); 347private static async Task TestFullSolutionAnalysisForProjectAsync(AdhocWorkspace workspace, Project project, bool expectAnalyzerExecuted) 372var project = workspace.AddProject(projectInfo); 457var project = workspace.CurrentSolution.Projects.Single(); 569var project = workspace.CurrentSolution.Projects.Single(); 644var project = workspace.CurrentSolution.Projects.Single(); 682var project = workspace.CurrentSolution.Projects.Single(); 761var project = workspace.CurrentSolution.Projects.Single(); 804var project = workspace.CurrentSolution.Projects.Single(); 825var project = workspace.AddProject( 920public override Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken) => SpecializedTasks.Default<ImmutableArray<Diagnostic>>();
FindSymbols\SymbolTreeInfoTests.cs (4)
22var project = solution.Projects.Single(); 43var project = solution.Projects.Single(); 66var project = solution.Projects.Single(); 88var project = solution.Projects.Single();
MetadataAsSource\AbstractMetadataAsSourceTests.cs (2)
91var metadataProject = context.CurrentSolution 106var project = context.DefaultProject.AddMetadataReference(references[0]);
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (4)
80public Project DefaultProject 85public Task<MetadataAsSourceFile> GenerateSourceAsync(ISymbol symbol, Project? project = null, bool signaturesOnly = true) 96Project? project = null, 150public async Task GenerateAndVerifySourceAsync(string symbolMetadataName, string expected, Project? project = null, bool signaturesOnly = true)
Preview\PreviewWorkspaceTests.cs (4)
55var project = solution.AddProject("project", "project.dll", LanguageNames.CSharp); 69var project = solution.AddProject("project", "project.dll", LanguageNames.CSharp); 98var project = solution.AddProject("project", "project.dll", LanguageNames.CSharp); 166var project = previewWorkspace.CurrentSolution.Projects.Single();
SymbolFinder\DependentTypeFinderTests.cs (17)
68var portableProject = GetPortableProject(solution); 109var portableProject = GetPortableProject(solution); 136private static Project GetPortableProject(Solution solution) 139private static Project GetNormalProject(Solution solution) 156var portableProject = GetPortableProject(solution); 201var portableProject = GetPortableProject(solution); 242var portableProject = GetPortableProject(solution); 284var portableProject = GetPortableProject(solution); 326var portableProject = GetPortableProject(solution); 366var portableProject = GetPortableProject(solution); 407var portableProject = GetPortableProject(solution); 645var csProject = solution.Projects.Single(p => p.Language == LanguageNames.CSharp); 646var otherProject = solution.Projects.Single(p => p != csProject); 690var normalProject1 = solution.Projects.Single(); 703var normalProject2 = solution.Projects.Single(p => p != normalProject1); 745var portableProject1 = solution.Projects.Single(p => p.Name == "PortableProject1"); 789var portableProject1 = GetPortableProject(solution);
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
49var vbProject = solution.Projects.Single(p => p.Language == LanguageNames.VisualBasic);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (9)
InlineDiagnostics\AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs (1)
106var project = document.Project;
InlineDiagnostics\InlineDiagnosticsTaggerProvider.cs (1)
67var project = workspace.CurrentSolution.GetProject(diagnostic.DocumentId.ProjectId);
NavigateTo\NavigateToItemProvider.cs (1)
53foreach (var project in _workspace.CurrentSolution.Projects)
Peek\DefinitionPeekableItem.cs (1)
71var project = solution.GetProject(_peekableItem._projectId);
Peek\IPeekableItemFactory.cs (1)
16Task<IEnumerable<IPeekableItem>> GetPeekableItemsAsync(ISymbol symbol, Project project, IPeekResultFactory peekResultFactory, CancellationToken cancellationToken);
Peek\PeekableItemFactory.cs (2)
48Project project, 68var originatingProject = solution.GetProject(symbol.ContainingAssembly, cancellationToken);
Peek\PeekableItemSource.cs (1)
121IEnumerable<INavigableItem>? navigableItems, Project project,
Suggestions\FixAll\FixMultipleOccurrencesService.cs (1)
45ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (8)
Compilation\CompilationTests.vb (1)
12Private Shared Function GetProject(snapshot As Solution, assemblyName As String) As Project
Diagnostics\DiagnosticServiceTests.vb (2)
1426project As Project, 2222Dim project = solution.Projects.Single(Function(p As Project) p.Name = "MainAssembly")
IntelliSense\CSharpCompletionCommandHandlerTests_DefaultsSource.vb (1)
686Friend Overrides Function ShouldTriggerCompletion(project As Project,
SyncNamespaces\SyncNamespacesServiceTests.vb (3)
184Dim project = projects.Single(Function(proj As Project) 245Dim project = projects.Single(Function(proj As Project) 250Dim project2 = projects.Single(Function(proj As Project)
Workspaces\TryFindSourceDefinitionTests.vb (1)
17Private Shared Function GetProject(snapshot As Solution, assemblyName As String) As Project
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (1)
Internal\EmbeddedLanguages\AspNetCoreEmbeddedLanguageBraceMatcher.cs (1)
28Project project,
Microsoft.CodeAnalysis.ExternalAccess.Debugger (1)
DebuggerFindReferencesService.cs (1)
27public async Task FindSymbolReferencesAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (3)
Internal\NavigateTo\FSharpNavigateToSearchService.cs (2)
49ImmutableArray<Project> projects, 61foreach (var project in projects)
NavigateTo\IFSharpNavigateToSearchService.cs (1)
17Task<ImmutableArray<FSharpNavigateToSearchResult>> SearchProjectAsync(Project project, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
CodeActions\OmniSharpCodeFixContextFactory.cs (1)
35Project project,
NavigateTo\OmniSharpNavigateToSearchService.cs (1)
17public delegate Task OmniSharpNavigateToCallback(Project project, in OmniSharpNavigateToSearchResult result, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.CSharp (1)
DocumentationComments\OmniSharpDocCommentConverter.cs (1)
14public static SyntaxNode ConvertToRegularComments(SyntaxNode node, Project project, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.Razor (5)
Cohost\Handlers\Diagnostics.cs (1)
26var project = document.Project;
Cohost\IRazorSemanticTokensRefreshQueue.cs (1)
22Task TryEnqueueRefreshComputationAsync(Project project, CancellationToken cancellationToken);
Cohost\RazorSemanticTokensRefreshQueueWrapper.cs (1)
40public Task TryEnqueueRefreshComputationAsync(Project project, CancellationToken cancellationToken)
RazorProjectExtensions.cs (2)
15internal static ValueTask<GeneratorDriverRunResult?> GetSourceGeneratorRunResultAsync(this Project project, CancellationToken cancellationToken) 20internal static async ValueTask<IEnumerable<SourceGeneratedDocument>> GetSourceGeneratedDocumentsForGeneratorAsync(this Project project, string assemblyName, string assemblyPath, Version assemblyVersion, string typeName, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.Xaml (5)
External\IDescriptionService.cs (1)
20Task<IEnumerable<TaggedText>> GetDescriptionAsync(ISymbol symbol, Project project, CancellationToken cancellationToken);
External\ILocationService.cs (1)
19Task<FileLinePositionSpan[]> GetSymbolLocationsAsync(ISymbol symbol, Project project, CancellationToken cancellationToken);
Internal\DescriptionService.cs (1)
34public async Task<IEnumerable<TaggedText>> GetDescriptionAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Internal\LocationService.cs (1)
45public async Task<FileLinePositionSpan[]> GetSymbolLocationsAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Internal\XamlDiagnosticSource.cs (1)
20Project IDiagnosticSource.GetProject() => document.Project;
Microsoft.CodeAnalysis.Features (370)
AddImport\AbstractAddImportFeatureService.cs (16)
144var project = document.Project; 145var projectToAssembly = new ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>>(concurrencyLevel: 2, capacity: project.Solution.ProjectIds.Count); 166private static bool IsHostOrRemoteWorkspace(Project project) 170ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>> projectToAssembly, 172Project project, 215ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>> projectToAssembly, 216Project project, ConcurrentQueue<Reference> allSymbolReferences, int maxResults, 261Project project, ConcurrentQueue<Reference> allSymbolReferences, int maxResults, SymbolReferenceFinder finder, 321private static ImmutableArray<(Project, PortableExecutableReference)> GetUnreferencedMetadataReferences( 322Project project, HashSet<PortableExecutableReference> seenReferences) 324using var _ = ArrayBuilder<(Project, PortableExecutableReference)>.GetInstance(out var result); 327foreach (var p in solution.Projects) 428private static Compilation CreateCompilation(Project project, PortableExecutableReference reference) 454private static HashSet<Project> GetViableUnreferencedProjects(Project project) 457var viableProjects = new HashSet<Project>(solution.Projects.Where(p => p.SupportsCompilation));
AddImport\AddImportFixData.cs (2)
64/// The optional id for a <see cref="Project"/> we'd like to add a reference to. 75/// is the id for the <see cref="Project"/> we can find that <see cref="PortableExecutableReference"/>
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (4)
41var newProject = newDocument.Project; 63Project newProject) : CodeActionOperation 67private readonly Project _newProject = newProject; 98var newProject = _newProject.WithMetadataReferences(
AddImport\CodeActions\MetadataSymbolReferenceCodeAction.cs (1)
28protected override Task<CodeActionOperation?> UpdateProjectAsync(Project project, bool isPreview, CancellationToken cancellationToken)
AddImport\CodeActions\ProjectSymbolReferenceCodeAction.cs (2)
40protected override Task<CodeActionOperation?> UpdateProjectAsync(Project project, bool isPreview, CancellationToken cancellationToken) 45var projectWithAddedReference = project.AddProjectReference(new ProjectReference(FixData.ProjectReferenceToAdd));
AddImport\CodeActions\SymbolReference.SymbolReferenceCodeAction.cs (1)
61protected abstract Task<CodeActionOperation?> UpdateProjectAsync(Project project, bool isPreview, CancellationToken cancellationToken);
AddImport\References\ProjectSymbolReference.cs (3)
30Project project) : SymbolReference(provider, symbolResult) 32private readonly Project _project = project; 92var project = document.Project;
AddImport\SearchScopes\AllSymbolsProjectSearchScope.cs (1)
21Project project,
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (2)
17Project assemblyProject, 22private readonly Project _assemblyProject = assemblyProject;
AddImport\SearchScopes\ProjectSearchScope.cs (2)
11protected readonly Project _project; 15Project project,
AddImport\SearchScopes\SourceSymbolsProjectSearchScope.cs (4)
24ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>> projectToAssembly, 25Project project, bool ignoreCase) : ProjectSearchScope(provider, project, ignoreCase) 27private readonly ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>> _projectToAssembly = projectToAssembly; 50static AsyncLazy<IAssemblySymbol?> CreateLazyAssembly(Project project)
AddImport\SymbolReferenceFinder.cs (3)
98internal Task<ImmutableArray<SymbolReference>> FindInSourceSymbolsInProjectAsync(ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>> projectToAssembly, Project project, bool exact, CancellationToken cancellationToken) 101internal Task<ImmutableArray<SymbolReference>> FindInMetadataSymbolsAsync(IAssemblySymbol assembly, Project assemblyProject, PortableExecutableReference metadataReference, bool exact, CancellationToken cancellationToken)
AddImport\SymbolReferenceFinder_PackageAssemblySearch.cs (2)
132var project = _document.Project; 174Project project,
AddMissingReference\AddMissingReferenceCodeAction.cs (3)
15internal sealed class AddMissingReferenceCodeAction(Project project, string title, ProjectReference? projectReferenceToAdd, AssemblyIdentity missingAssemblyIdentity) : CodeAction 17private readonly Project _project = project; 29public static async Task<CodeAction> CreateAsync(Project project, AssemblyIdentity missingAssemblyIdentity, CancellationToken cancellationToken)
BraceMatching\IEmbeddedLanguageBraceMatcher.cs (1)
13Project project,
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (2)
53foreach (var project in solution.Projects) 70Project project,
CodeFixes\Configuration\ConfigurationUpdater.cs (14)
70private readonly Project _project; 82Project project, 110Project project, 129Project project, 160Project project, 174Project project, 183Project project, 202Project project, 213Project project, 231var currentProject = project; 307var project = currentSolution.GetProject(projectId); 322private static AnalyzerConfigDocument? GetOrCreateAnalyzerConfigDocument(Project project, string analyzerConfigPath) 342Project project) 383internal static ImmutableArray<IOption2> GetCodeStyleOptionsForDiagnostic(Diagnostic diagnostic, Project project)
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (2)
58public Task<ImmutableArray<CodeFix>> GetFixesAsync(Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 61private static ImmutableArray<CodeFix> GetConfigurations(Project project, IEnumerable<Diagnostic> diagnostics)
CodeFixes\Configuration\ConfigureSeverity\ConfigureSeverityLevelCodeFixProvider.cs (2)
50public Task<ImmutableArray<CodeFix>> GetFixesAsync(Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 53private static ImmutableArray<CodeFix> GetConfigurations(Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken)
CodeFixes\FixAllOccurrences\IFixMultipleOccurrencesService.cs (1)
35ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (2)
135ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectsAndDiagnosticsToFixMap, 200Project project, ImmutableArray<Diagnostic> diagnostics,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (2)
23private readonly Project _project; 25protected AbstractGlobalSuppressMessageCodeAction(AbstractSuppressionCodeFixProvider fixer, Project project)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (2)
169Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 185Document documentOpt, Project project, IEnumerable<Diagnostic> diagnostics, SuppressionTargetInfo suppressionTargetInfo, bool skipSuppressMessage, bool skipUnsuppress, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (1)
17Project project, Diagnostic diagnostic,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (9)
34Project project) 48internal static CodeAction Create(string title, AbstractSuppressionCodeFixProvider fixer, Project triggerProject, ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject) 76var oldProject = grouping.Key; 77var currentProject = currentSolution.GetProject(oldProject.Id); 98Project triggerProject, 99ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject, 105var currentProject = currentSolution.GetProject(oldProject.Id); 173private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(Project project, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
85Project project, ImmutableArray<Diagnostic> diagnostics,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.cs (1)
26Project project,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (3)
23private readonly Project _project; 28Project project, 37Project project,
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
120var newProject = document.Project;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (2)
49var projectToBeUpdated = SemanticDocument.Project; 119var projectToBeUpdated = document.Project;
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
159public static FolderInfo CreateFolderHierarchyForProject(Project project)
Common\AbstractProjectExtensionProvider.cs (1)
47public static ImmutableArray<TExtension> GetExtensions(Project? project)
Completion\CompletionService.cs (6)
127/// We pass the project here to retrieve information about the <see cref="Project.AnalyzerReferences"/>, 128/// <see cref="WorkspaceKind"/> and <see cref="Project.Language"/> which are fast operations. 132Project? project, 390internal void TriggerLoadProjectProviders(Project project, CompletionOptions options) 393internal CompletionProvider? GetProvider(CompletionItem item, Project? project) 406public ImmutableArray<CompletionProvider> GetProjectProviders(Project project)
Completion\CompletionService.ProviderManager.cs (4)
97public ImmutableArray<CompletionProvider> GetCachedProjectCompletionProvidersOrQueueLoadInBackground(Project? project, CompletionOptions options) 152public CompletionProvider? GetProvider(CompletionItem item, Project? project) 168Project? project, ImmutableHashSet<string>? roles, CompletionTrigger trigger, in CompletionOptions options) 289public ImmutableArray<CompletionProvider> GetProjectProviders(Project project)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (5)
135var currentProject = context.Document.Project; 137foreach (var project in context.Document.Project.Solution.Projects) 171private static bool IsProjectTypeUnsupported(Project project) 179var project = completionContext.Document.Project; 284private static async Task<string> GetPublicKeyOfProjectAsync(Project project, CancellationToken cancellationToken)
Completion\Providers\CompletionUtilities.cs (2)
28public static ImmutableArray<Project> GetDistinctProjectsFromLatestSolutionSnapshot(ImmutableSegmentedList<Project> projects)
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionCacheServiceFactory.cs (5)
18Func<ImmutableSegmentedList<Project>, CancellationToken, ValueTask> processBatchAsync, 25private readonly Func<ImmutableSegmentedList<Project>, CancellationToken, ValueTask> _processBatchAsync = processBatchAsync; 30var workQueue = new AsyncBatchingWorkQueue<Project>( 40AsyncBatchingWorkQueue<Project> workQueue) : IImportCompletionCacheService<TProjectCacheEntry, TMetadataCacheEntry> 42public AsyncBatchingWorkQueue<Project> WorkQueue { get; } = workQueue;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (6)
45public void QueueCacheWarmUpTask(Project project) 85private async Task<(ImmutableArray<TypeImportCompletionCacheEntry> results, bool isPartial)> GetCacheEntriesAsync(Project currentProject, Compilation originCompilation, bool forceCacheCreation, CancellationToken cancellationToken) 91using var _2 = ArrayBuilder<Project>.GetInstance(out var projectsBuilder); 159public static async ValueTask BatchUpdateCacheAsync(ImmutableSegmentedList<Project> projects, CancellationToken cancellationToken) 162foreach (var project in latestProjects) 179private async Task<TypeImportCompletionCacheEntry> GetUpToDateCacheForProjectAsync(Project project, CancellationToken cancellationToken)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (6)
31public static async Task WarmUpCacheAsync(Project project, CancellationToken cancellationToken) 48public static void WarmUpCacheInCurrentProcess(Project project) 63var project = document.Project; 136public static async ValueTask BatchUpdateCacheAsync(ImmutableSegmentedList<Project> projects, CancellationToken cancellationToken) 139foreach (var project in latestProjects) 252Project project,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (8)
60private static IImportCompletionCacheService<ExtensionMethodImportCompletionCacheEntry, object> GetCacheService(Project project) 66public static void QueueCacheWarmUpTask(Project project) 71public static async ValueTask UpdateCacheAsync(Project project, CancellationToken cancellationToken) 76foreach (var relevantProject in GetAllRelevantProjects(project)) 139private static ImmutableArray<Project> GetAllRelevantProjects(Project project) 147private static ImmutableArray<PortableExecutableReference> GetAllRelevantPeReferences(Project project) 151Project project,
Completion\Providers\ImportCompletionProvider\IImportCompletionCacheService.cs (1)
12AsyncBatchingWorkQueue<Project> WorkQueue { get; }
Completion\Providers\ImportCompletionProvider\ITypeImportCompletionService.cs (1)
30void QueueCacheWarmUpTask(Project project);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (4)
435Project startingProject, INamedTypeSymbol tupleType, CancellationToken cancellationToken) 460var allProjects = dependentProjects.Select<ProjectId, Project>(solution.GetRequiredProject) 477Project project, INamedTypeSymbol tupleType, CancellationToken cancellationToken) 488private static async Task AddDocumentsToUpdateForProjectAsync(Project project, ArrayBuilder<DocumentToUpdate> result, ImmutableArray<string> tupleFieldNames, CancellationToken cancellationToken)
DesignerAttribute\DesignerAttributeDiscoveryService.cs (6)
62private static async ValueTask<bool> HasDesignerCategoryTypeAsync(Project project, CancellationToken cancellationToken) 177Project project, 197Project project, 221Project project, 267Project project, DocumentId documentId, string filePath, bool hasDesignerCategoryType, string? existingCategory) 285bool hasDesignerCategoryType, Project project, DocumentId documentId, string? existingCategory, CancellationToken cancellationToken)
Diagnostics\CodeAnalysisDiagnosticAnalyzerService.cs (1)
92public async ValueTask RunAnalysisAsync(Project project, CancellationToken cancellationToken)
Diagnostics\ICodeAnalysisDiagnosticAnalyzerService.cs (4)
22ValueTask RunAnalysisAsync(Project project, CancellationToken cancellationToken); 25/// Returns true if <see cref="RunAnalysisAsync(Project, CancellationToken)"/> was invoked on either the current or 35/// cref="RunAnalysisAsync(Project, CancellationToken)"/> invocation on the containing project or solution. The 45/// from the last <see cref="RunAnalysisAsync(Project, CancellationToken)"/> invocation on the given project or
Diagnostics\IDiagnosticAnalyzerService.cs (3)
29Task<ImmutableArray<DiagnosticData>> ForceAnalyzeProjectAsync(Project project, CancellationToken cancellationToken); 52Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 69Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Project project, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
506Project oldProject,
EditAndContinue\CommittedSolution.cs (4)
121public Project? GetProject(ProjectId id) 124public Project GetRequiredProject(ProjectId id) 350IEnumerable<(Project, IEnumerable<CodeAnalysis.DocumentState>)> documentsByProject, 351Func<Project, CompilationOutputs> compilationOutputsProvider,
EditAndContinue\DebuggingSession.cs (9)
33private readonly Func<Project, CompilationOutputs> _compilationOutputsProvider; 115Func<Project, CompilationOutputs> compilationOutputsProvider, 240internal CompilationOutputs GetCompilationOutputs(Project project) 258internal Task<(Guid Mvid, Diagnostic? Error)> GetProjectModuleIdAsync(Project project, CancellationToken cancellationToken) 293Project baselineProject, 436var project = document.Project; 709var oldProject = LastCommittedSolution.GetProject(projectId); 825var newProject = mappedDocument.Project; 827var oldProject = LastCommittedSolution.GetProject(newProject.Id);
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (3)
27private readonly Dictionary<DocumentId, (AsyncLazy<DocumentAnalysisResults> results, Project baseProject, Document document, ImmutableArray<ActiveStatementLineSpan> activeStatementSpans)> _analyses = []; 80var oldProject = oldDocument?.Project ?? oldSolution.GetRequiredProject(newDocument.Project.Id); 164private AsyncLazy<DocumentAnalysisResults> GetDocumentAnalysisNoLock(Project baseProject, Document document, ImmutableArray<ActiveStatementLineSpan> activeStatementSpans)
EditAndContinue\EditAndContinueService.cs (4)
53private Func<Project, CompilationOutputs> _compilationOutputsProvider = GetCompilationOutputs; 102private static CompilationOutputs GetCompilationOutputs(Project project) 183private static IEnumerable<(Project, IEnumerable<DocumentState>)> GetDocumentStatesGroupedByProject(Solution solution, ImmutableArray<DocumentId> documentIds) 289public void SetOutputProvider(Func<Project, CompilationOutputs> value)
EditAndContinue\EditSession.cs (21)
155public async Task<ImmutableArray<Diagnostic>?> GetModuleDiagnosticsAsync(Guid mvid, Project oldProject, Project newProject, ImmutableArray<DocumentAnalysisResults> documentAnalyses, CancellationToken cancellationToken) 183private static async IAsyncEnumerable<Location> CreateChangedLocationsAsync(Project oldProject, Project newProject, ImmutableArray<DocumentAnalysisResults> documentAnalyses, [EnumeratorCancellation] CancellationToken cancellationToken) 293foreach (var newProject in newSolution.Projects) 300var oldProject = oldSolution.GetProject(newProject.Id); 308foreach (var oldProject in oldSolution.Projects) 315var newProject = newSolution.GetProject(oldProject.Id); 342internal static async ValueTask<bool> HasChangedOrAddedDocumentsAsync(Project oldProject, Project newProject, ArrayBuilder<Document>? changedOrAddedDocuments, CancellationToken cancellationToken) 430internal static async Task PopulateChangedAndAddedDocumentsAsync(TraceLog log, Project oldProject, Project newProject, ArrayBuilder<Document> changedOrAddedDocuments, ArrayBuilder<ProjectDiagnostics> diagnostics, CancellationToken cancellationToken) 468private static async ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync(TraceLog log, Project project, ArrayBuilder<ProjectDiagnostics>? diagnostics, CancellationToken cancellationToken) 493internal static async IAsyncEnumerable<DocumentId> GetChangedDocumentsAsync(TraceLog log, Project oldProject, Project newProject, [EnumeratorCancellation] CancellationToken cancellationToken) 622Project oldProject, 623Project newProject, 827foreach (var newProject in solution.Projects) 834var oldProject = oldSolution.GetProject(newProject.Id); 1171private async ValueTask LogDeltaFilesAsync(TraceLog.FileLogger log, ManagedHotReloadUpdate delta, int baselineGeneration, Project oldProject, Project newProject, CancellationToken cancellationToken)
EditAndContinue\IEditAndContinueAnalyzer.cs (1)
17Project baseProject,
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (1)
104var firstProject = solution.GetProject(runningProjects.FirstOrDefault()) ?? solution.Projects.First();
EditAndContinue\Utilities\Extensions.cs (1)
43public static bool SupportsEditAndContinue(this Project project, TraceLog? log = null)
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (4)
41var project = document.Project; 52SolutionServices services, Project? project, SemanticModel semanticModel, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 68Project project, 77private readonly Project _project = project;
EmbeddedLanguages\Classification\EmbeddedLanguageClassifierContext.cs (2)
24public Project Project { get; } 43Project project,
EmbeddedLanguages\Json\LanguageServices\JsonBraceMatcher.cs (1)
36Project project,
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexBraceMatcher.cs (1)
39Project project,
ExternalAccess\UnitTesting\API\INewUnitTestingIncrementalAnalyzerImplementation.cs (1)
18Project project,
ExternalAccess\UnitTesting\API\NewUnitTestingIncrementalAnalyzer.cs (1)
29Project project,
ExternalAccess\UnitTesting\API\UnitTestingSearchHelpers.cs (5)
26Project project, UnitTestingSearchQuery query, CancellationToken cancellationToken) 49Project project, UnitTestingSearchQuery query, CancellationToken cancellationToken) 141Project project, 153Project project, 166Project project,
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingIncrementalAnalyzer.cs (1)
19Project project,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (14)
225foreach (var addedProject in solutionChanges.GetAddedProjects()) 235foreach (var removedProject in solutionChanges.GetRemovedProjects()) 328private async Task EnqueueDocumentWorkItemAsync(Project project, DocumentId documentId, TextDocument? document, UnitTestingInvocationReasons invocationReasons, SyntaxNode? changedMember = null) 353private static Document GetRequiredDocument(Project project, DocumentId documentId, Document? document) 368private async Task EnqueueFullProjectWorkItemAsync(Project project, UnitTestingInvocationReasons invocationReasons) 396IUnitTestingIncrementalAnalyzer analyzer, Project project, DocumentId documentId, Document? document, UnitTestingInvocationReasons invocationReasons) 426var oldProject = projectChanges.OldProject; 427var newProject = projectChanges.NewProject; 567var project = solution.GetProject(projectId); 615var project = solution.GetProject(projectId); 633public IEnumerable<(Project project, DocumentId documentId)> GetDocumentIds(Solution solution) 642foreach (var project in solution.Projects) 659var project = solution.GetProject(projectId); 670var project = solution.GetProject(documentId.ProjectId);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (7)
209private void EnqueueFullProjectDependency(Project project, IAssemblySymbol? internalVisibleToAssembly = null) 226var otherProject = solution.GetProject(projectId); 243public void Enqueue(Project project, DocumentId documentId, Document? document, SyntaxPath? changedMember) 308private readonly struct UnitTestingData(Project project, DocumentId documentId, Document? document, SyntaxPath? changedMember, IAsyncToken asyncToken) 313public readonly Project Project = project; 382public async Task EnqueueWorkItemAsync(Project project, DocumentId documentId, Document? document) 430private async Task EnqueueWorkItemAsync(Project? project)
ExternalAccess\VSTypeScript\Api\IVSTypeScriptDiagnosticAnalyzerImplementation.cs (1)
13Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptNavigateToSearchService.cs (1)
16Task<ImmutableArray<IVSTypeScriptNavigateToSearchResult>> SearchProjectAsync(Project project, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (4)
51ImmutableArray<Project> projects, 63using var _ = PooledHashSet<Project>.GetInstance(out var processedProjects); 68foreach (var project in projects) 73async Task ProcessProjectAsync(Project project)
ExternalAccess\VSTypeScript\VSTypeScriptProjectDiagnosticAnalyzer.cs (1)
18public override Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken)
FindUsages\AbstractFindUsagesService_FindImplementations.cs (2)
41IFindUsagesContext context, ISymbol symbol, Project project, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 68ISymbol symbol, Project project, IFindUsagesContext context, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken)
FindUsages\AbstractFindUsagesService_FindReferences.cs (3)
108IFindUsagesContext context, ISymbol symbol, Project project, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 127Project project, 159Project project,
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (2)
60private async ValueTask<(Project? project, ISymbol? symbol)> TryResolveSymbolAsync(Solution solution, string symbolKey, CancellationToken cancellationToken) 68var project = solution.GetProject(ProjectId.CreateFromSerialized(Guid.Parse(projectIdGuid), projectDebugName));
FindUsages\FindUsagesHelpers.cs (2)
22public static Task<(ISymbol symbol, Project project)?> GetRelevantSymbolAndProjectAtPositionAsync( 35public static async Task<(ISymbol symbol, Project project)?> GetRelevantSymbolAndProjectAtPositionAsync(
FullyQualify\AbstractFullyQualifyService.cs (1)
62var project = document.Project;
GenerateType\AbstractGenerateTypeService.CodeAction.cs (1)
116private bool IsPublicOnlyAccessibility(State state, Project project)
GenerateType\AbstractGenerateTypeService.cs (1)
52internal abstract bool IsPublicOnlyAccessibility(TExpressionSyntax expression, Project project);
GenerateType\AbstractGenerateTypeService.Editor.cs (11)
178private string GetNamespaceToGenerateIntoForUsageWithNamespace(Project targetProject, Project triggeringProject) 266Project projectToBeUpdated, 267Project triggeringProject, 337Project projectToBeUpdated, 338Project triggeringProject, 372private static Solution AddProjectReference(Project projectToBeUpdated, Project triggeringProject, Solution updatedSolution) 404Project triggeringProject, 468Project targetProject, 469Project triggeringProject)
GenerateType\GenerateTypeOptionsResult.cs (2)
21public Project Project { get; } 32Project project,
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (3)
18protected abstract Task<ISymbol> FindRelatedExplicitlyDeclaredSymbolAsync(Project project, ISymbol symbol, CancellationToken cancellationToken); 22public async Task<(ISymbol? symbol, Project project, TextSpan boundSpan)> GetSymbolProjectAndBoundSpanAsync( 25var project = document.Project;
GoToDefinition\IGoToDefinitionSymbolService.cs (1)
14Task<(ISymbol? symbol, Project project, TextSpan boundSpan)> GetSymbolProjectAndBoundSpanAsync(
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (3)
44Project project, 76private async ValueTask<(Project remapped, SymbolAndLineNumberArray symbolAndLineNumbers)> GetMemberSymbolsAsync( 91Project? project = null;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (4)
65Project sourceProject, 334public Project? MapDocument(Document document) 345var project = solution.GetProject(fileInfo.SourceProjectId); 366private static async Task<UniqueDocumentKey> GetUniqueDocumentKeyAsync(Project project, INamedTypeSymbol topLevelNamedType, bool signaturesOnly, CancellationToken cancellationToken)
MetadataAsSource\IMetadataAsSourceFileProvider.cs (2)
22Project sourceProject, 56Project? MapDocument(Document document);
MetadataAsSource\IMetadataAsSourceFileService.cs (1)
28Project sourceProject,
MetadataAsSource\MetadataAsSourceFileService.cs (2)
71Project sourceProject, 250Project? project = null;
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
28public MetadataAsSourceGeneratedFileInfo(string rootPath, Workspace sourceWorkspace, Project sourceProject, INamedTypeSymbol topLevelNamedType, bool signaturesOnly)
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
60ImmutableArray<Project> projects,
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (3)
22ImmutableArray<Project> projects, 61ImmutableArray<Project> projects, 76Project project, Action<RoslynNavigateToItem> onItemFound, VoidResult _, CancellationToken cancellationToken)
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (3)
146ImmutableArray<Project> projects, 187ImmutableArray<Project> projects, 212Project project,
NavigateTo\INavigateToSearcherHost.cs (2)
21INavigateToSearchService? GetNavigateToSearchService(Project project); 52public INavigateToSearchService? GetNavigateToSearchService(Project project)
NavigateTo\INavigateToSearchService.cs (3)
37ImmutableArray<Project> projects, 64ImmutableArray<Project> projects, 83ImmutableArray<Project> projects,
NavigateTo\NavigateToSearcher.cs (21)
188var project = _activeDocument.Project; 205var activeProject = _activeDocument.Project; 216private INavigateToSearchService GetNavigateToSearchService(Project project) 231ImmutableArray<ImmutableArray<Project>> orderedProjects, 283private ImmutableArray<ImmutableArray<Project>> GetOrderedProjectsToProcess() 285using var result = TemporaryArray<ImmutableArray<Project>>.Empty; 287using var _ = PooledHashSet<Project>.GetInstance(out var processedProjects); 298using var buffer = TemporaryArray<Project>.Empty; 309foreach (var project in _solution.Projects) 326private ImmutableArray<Document> GetPriorityDocuments(ImmutableArray<Project> projects) 328using var _1 = PooledHashSet<Project>.GetInstance(out var projectsSet); 347ImmutableArray<ImmutableArray<Project>> orderedProjects, 349Func<INavigateToSearchService, ImmutableArray<Project>, Func<ImmutableArray<INavigateToSearchResult>, Task>, Func<Task>, Task> processProjectAsync, 378async ValueTask SearchCoreAsync(IGrouping<INavigateToSearchService, Project> grouping, CancellationToken cancellationToken) 412ImmutableArray<ImmutableArray<Project>> orderedProjects, 430ImmutableArray<ImmutableArray<Project>> orderedProjects, 448foreach (var project in projects) 462ImmutableArray<ImmutableArray<Project>> orderedProjects, 505foreach (var project in projects) 534public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 536foreach (var _ in projects)
NavigateTo\NavigateToUtilities.cs (1)
19foreach (var project in solution.Projects)
NavigateTo\RoslynNavigateToItem.cs (1)
143var firstProject = itemDocument.Project;
Navigation\DefaultSymbolNavigationService.cs (2)
15public Task<INavigableLocation?> GetNavigableLocationAsync(ISymbol symbol, Project project, CancellationToken cancellationToken) 18public Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Navigation\INavigableItem.cs (1)
92public static NavigableProject FromProject(Project project)
Navigation\ISymbolNavigationService.cs (2)
22Task<INavigableLocation?> GetNavigableLocationAsync(ISymbol symbol, Project project, CancellationToken cancellationToken); 26Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (4)
81Project sourceProject, 306private ProjectInfo? CreateProjectInfo(Workspace workspace, Project project, ImmutableDictionary<string, string> pdbCompilationOptions, string assemblyName, string assemblyVersion, SourceHashAlgorithm checksumAlgorithm) 338SourceFileInfo?[] sourceFileInfos, Encoding encoding, ProjectId projectId, Workspace sourceWorkspace, Project sourceProject) 430public Project? MapDocument(Document document)
ProjectManagement\IProjectManagementService.cs (1)
19string GetDefaultNamespace(Project project, Workspace workspace);
RelatedDocuments\AbstractRelatedDocumentsService.cs (1)
42var project = document.Project;
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
161var project = document.Project;
SemanticSearch\SemanticSearchUtilities.cs (1)
72public static Project GetQueryProject(Solution solution)
Shared\Extensions\ProjectExtensions.cs (1)
9public static Glyph GetGlyph(this Project project)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (4)
20Project project, 34Compilation compilation, ISet<string> availableTypeParameterNames, Project project, CancellationToken cancellationToken) : AsyncSymbolVisitor 40private readonly Project _project = project; 124INamedTypeSymbol constraintType, IImmutableSet<Project> projects)
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
138[methodSymbol], document.Project.Solution, cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
55foreach (var project in fixAllContext.Solution.Projects)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (4)
22public abstract Solution UpgradeProject(Project project, string version); 23public abstract bool IsUpgrade(Project project, string newVersion); 43var project = context.Document.Project; 93private bool CanUpgrade(Project project, string language, string version)
StackTraceExplorer\AbstractStackTraceSymbolResolver.cs (1)
16Project project,
StackTraceExplorer\StackFrameLocalMethodResolver.cs (1)
18Project project,
StackTraceExplorer\StackFrameMethodSymbolResolver.cs (1)
15public override Task<IMethodSymbol?> TryGetBestMatchAsync(Project project,
StackTraceExplorer\StackTraceExplorerService.cs (1)
99foreach (var project in solution.Projects)
StackTraceExplorer\StackTraceExplorerUtilities.cs (3)
47using var _ = PooledObjects.ArrayBuilder<Project>.GetInstance(out var candidateProjects); 48foreach (var project in solution.Projects) 108private static async Task<IMethodSymbol?> TryGetBestMatchAsync(Project project, string fullyQualifiedTypeName, StackFrameSimpleNameNode methodNode, StackFrameParameterList methodArguments, StackFrameTypeArgumentList? methodTypeArguments, CancellationToken cancellationToken)
SymbolMapping\SymbolMappingResult.cs (2)
9public Project Project { get; } 12internal SymbolMappingResult(Project project, ISymbol symbol)
SyncNamespaces\AbstractSyncNamespacesService.cs (11)
33ImmutableArray<Project> projects, 58private static async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetDiagnosticsByProjectAsync( 59ImmutableArray<Project> projects, 64var builder = ImmutableDictionary.CreateBuilder<Project, ImmutableArray<Diagnostic>>(); 66foreach (var project in projects) 76Project project, 98ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject, 156private readonly ImmutableDictionary<Project, ImmutableArray<Diagnostic>> _diagnosticsByProject; 158internal DiagnosticProvider(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject) 163public override Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 176public override Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken)
SyncNamespaces\ISyncNamespacesService.cs (1)
20ImmutableArray<Project> projects, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken);
Tagging\CompilationAvailableHelpers.cs (1)
15public static Task ComputeCompilationInCurrentProcessAsync(Project project, CancellationToken cancellationToken)
UnusedReferences\UnusedReferencesRemover.cs (1)
36foreach (var project in projects)
Workspace\CompileTimeSolutionProvider.cs (1)
131var existingStaleProject = staleSolution.GetProject(projectState.Id);
Microsoft.CodeAnalysis.Features.Test.Utilities (17)
EditAndContinue\EditAndContinueTestVerifier.cs (5)
136CreateProjects(editScripts, workspace, targetFramework, out var oldProject, out var newProject); 455private void CreateProjects(EditScriptDescription[] editScripts, AdhocWorkspace workspace, TargetFramework targetFramework, out Project oldProject, out Project newProject) 546foreach (var project in solution.Projects)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (5)
45private protected Func<Project, CompilationOutputs> _mockCompilationOutputsProvider = _ => new MockCompilationOutputs(Guid.NewGuid()); 95internal static Project AddEmptyTestProject(Solution solution) 109var project = AddEmptyTestProject(solution); 251Project? generatorProject = null, 265Project? generatorProject = null,
EditAndContinue\Extensions.cs (5)
55public static Project AddTestProject(this Solution solution, string projectName, string language = LanguageNames.CSharp) 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) 67public static Document AddTestDocument(this Project project, string source, string path) 70public static Document AddTestDocument(this Project project, string source, string path, out DocumentId id)
Snippets\AbstractSnippetProviderTests.cs (2)
35var project = workspace.CurrentSolution. 118var project = workspace.CurrentSolution.
Microsoft.CodeAnalysis.Features.UnitTests (46)
EditAndContinue\ActiveStatementsMapTests.cs (3)
120var project = solution.Projects.Single(); 175var project = solution.Projects.Single(); 226var project = solution.Projects.Single();
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (5)
234var project = solution.AddProject("dummy_proj", "dummy_proj", NoCompilationConstants.LanguageName); 572var project = document1.Project; 763var project = solution. 1141var project = AddEmptyTestProject(solution); 1557var projectC = solution.GetProjectsByName("C").Single();
EditAndContinue\EditSessionActiveStatementsTests.cs (5)
44var mockCompilationOutputsProvider = new Func<Project, CompilationOutputs>(_ => new MockCompilationOutputs(Guid.NewGuid())); 72var project = solution 179var dummyProject = solution.AddProject("dummy_proj", "dummy_proj", NoCompilationConstants.LanguageName); 181var project = solution.GetProject(projectId); 661var project = solution.Projects.Single();
FindUsages\DefinitionItemFactoryTests.cs (33)
82Project project, 94expressionMap.Add(project.Id.Id.ToString(), $"project.{nameof(Project.Id)}.{nameof(Project.Id.Id)}.{nameof(Project.Id.Id.ToString)}()"); 131var project = solution.Projects.Single(); 167var project = solution.Projects.Single(); 209var project = solution.Projects.Single(); 245var project = solution.Projects.Single(); 287var project = solution.Projects.Single(); 329var project = solution.Projects.Single(); 382var project = solution.Projects.Single(); 436var project = solution.Projects.Single(); 476var project = solution.Projects.Single(); 516var project = solution.Projects.Single(); 558var project = solution.Projects.Single(); 616var project = solution.Projects.Single(p => p.Name == "P1"); 662var project = solution.Projects.Single(); 699var project = solution.Projects.Single(); 761var project = solution.Projects.Single(); 817var project = solution.Projects.Single(); 871var project = solution.Projects.Single(); 926var project = solution.Projects.Single(); 976var project = solution.Projects.Single(); 1031var project = solution.Projects.Single(); 1083var project = solution.Projects.Single(); 1145var project = solution.Projects.Single(); 1202var project = solution.Projects.Single(); 1259var project = solution.Projects.Single(); 1331var project = solution.Projects.Single(); 1391var project = solution.Projects.Single(); 1443var project = solution.Projects.Single(); 1506var project = solution.Projects.Single(); 1577var project = solution.Projects.Single();
Microsoft.CodeAnalysis.LanguageServer (3)
LanguageServer\Handler\DebugConfiguration\WorkspaceDebugConfigurationHandler.cs (3)
41private static bool IsProjectInWorkspace(Uri workspacePath, Project project) 46private ProjectDebugConfiguration GetProjectDebugConfiguration(Project project) 53private static string GetProjectName(Project project)
Microsoft.CodeAnalysis.LanguageServer.Protocol (78)
Extensions\Extensions.cs (1)
165public static Project? GetProject(this Solution solution, TextDocumentIdentifier projectIdentifier)
Extensions\ProtocolConversions.cs (1)
813public static LSP.VSProjectContext ProjectToProjectContext(Project project)
Extensions\ProtocolConversions.Diagnostics.cs (2)
29public static ImmutableArray<LSP.Diagnostic> ConvertDiagnostic(DiagnosticData diagnosticData, bool supportsVisualStudioExtensions, Project project, bool isLiveSource, bool potentialDuplicate, IGlobalOptionService globalOptionService) 96Project project,
ExternalAccess\Razor\FormatNewFileHandler.cs (1)
67var project = document.Project;
ExternalAccess\Razor\FormatNewFileParams.cs (1)
16public required TextDocumentIdentifier Project { get; init; }
Features\CodeFixes\CodeFixService.FixAllDiagnosticProvider.cs (2)
66public override async Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 74public override async Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken)
Features\CodeFixes\CodeFixService.FixAllPredefinedDiagnosticProvider.cs (2)
22public override Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 28public override Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken)
Features\Diagnostics\DiagnosticAnalyzerService.cs (5)
59public static Task<VersionStamp> GetDiagnosticVersionAsync(Project project, CancellationToken cancellationToken) 98public async Task<ImmutableArray<DiagnosticData>> ForceAnalyzeProjectAsync(Project project, CancellationToken cancellationToken) 105Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 112Project project, ImmutableHashSet<string>? diagnosticIds, 125public Task<ImmutableArray<DiagnosticAnalyzer>> GetAnalyzersAsync(Project project, CancellationToken cancellationToken)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (3)
53public static bool IsAnalyzerEnabledForProject(DiagnosticAnalyzer analyzer, Project project, IGlobalOptionService globalOptions) 124Project project, 159private static async Task VerifyDiagnosticLocationsAsync(ImmutableArray<Diagnostic> diagnostics, Project project, CancellationToken cancellationToken)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.CompilationManager.cs (1)
29Project project,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (2)
48public Task<ImmutableArray<DiagnosticAnalyzer>> GetAnalyzersForTestingPurposesOnlyAsync(Project project, CancellationToken cancellationToken) 51private static string GetProjectLogMessage(Project project, ImmutableArray<DiagnosticAnalyzer> analyzers)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (1)
30Project project,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (1)
44/// Return <see cref="DiagnosticAnalyzer"/>s for the given <see cref="Project"/>.
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (4)
21public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 36Project project, 52Project project, 137bool ShouldIncludeAnalyzer(Project project, DiagnosticAnalyzer analyzer)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (1)
61var project = document.Project;
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (2)
37public async Task<ImmutableArray<DiagnosticData>> ForceAnalyzeProjectAsync(Project project, CancellationToken cancellationToken) 94DiagnosticAnalyzerInfoCache infoCache, DiagnosticAnalyzer analyzer, bool isHostAnalyzer, Project project)
Features\Diagnostics\EngineV2\InProcOrRemoteHostAnalyzerRunner.cs (6)
45Project project, 54Project project, 82Project project, 125Project project, 159Project project, 215private static ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> Hydrate(ImmutableArray<(DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics)> diagnosticByDocument, Project project)
Features\EditAndContinue\EditAndContinueDiagnosticSource_Workspace.cs (1)
20private sealed class ProjectSource(Project project, ImmutableArray<DiagnosticData> diagnostics) : AbstractProjectDiagnosticSource(project)
Features\Options\BlockStructureOptionsStorage.cs (1)
11public static BlockStructureOptions GetBlockStructureOptions(this IGlobalOptionService globalOptions, Project project)
Handler\Completion\CompletionHandler.cs (1)
87var project = document.Project;
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (2)
158var project = diagnosticSource.GetProject(); 256var project = solution.GetProject(textDocumentIdentifier);
Handler\Diagnostics\BuildOnlyDiagnosticIdsHandler.cs (1)
55foreach (var project in context.Solution.Projects)
Handler\Diagnostics\DiagnosticSourceProviders\DiagnosticSourceManager.cs (1)
145public Project GetProject() => sources[0].GetProject();
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDiagnosticSourceHelpers.cs (3)
15public static IEnumerable<Project> GetProjectsInPriorityOrder(Solution solution, ImmutableArray<string> supportedLanguages) 22static IEnumerable<Project?> GetProjectsInPriorityOrderWorker(Solution solution) 37foreach (var project in solution.Projects)
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDocumentsAndProjectDiagnosticSourceProvider.cs (2)
60foreach (var project in WorkspaceDiagnosticSourceHelpers.GetProjectsInPriorityOrder(solution, context.SupportedLanguages)) 65async Task AddDocumentsAndProjectAsync(Project project, IDiagnosticAnalyzerService diagnosticAnalyzerService, CancellationToken cancellationToken)
Handler\Diagnostics\DiagnosticSources\AbstractDocumentDiagnosticSource.cs (1)
24public Project GetProject() => Document.Project;
Handler\Diagnostics\DiagnosticSources\AbstractProjectDiagnosticSource.cs (10)
14internal abstract class AbstractProjectDiagnosticSource(Project project) 17protected Project Project => project; 19public static AbstractProjectDiagnosticSource CreateForFullSolutionAnalysisDiagnostics(Project project, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer) 22public static AbstractProjectDiagnosticSource CreateForCodeAnalysisDiagnostics(Project project, ICodeAnalysisDiagnosticAnalyzerService codeAnalysisService) 28public ProjectOrDocumentId GetId() => new(Project.Id); 29public Project GetProject() => Project; 31=> !string.IsNullOrEmpty(Project.FilePath) 32? new VSTextDocumentIdentifier { ProjectContext = ProtocolConversions.ProjectToProjectContext(Project), Uri = ProtocolConversions.CreateAbsoluteUri(Project.FilePath) } 34public string ToDisplayString() => Project.Name; 36private sealed class FullSolutionAnalysisDiagnosticSource(Project project, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer)
Handler\Diagnostics\DiagnosticSources\AbstractWorkspaceDocumentDiagnosticSource.cs (1)
32private static readonly ConditionalWeakTable<Project, AsyncLazy<ILookup<DocumentId, DiagnosticData>>> s_projectToDiagnostics = new();
Handler\Diagnostics\DiagnosticSources\IDiagnosticSource.cs (2)
14/// Wrapper around a source for diagnostics (e.g. a <see cref="Project"/> or <see cref="Document"/>) 19Project GetProject();
Handler\Diagnostics\DiagnosticsPullCache.cs (2)
21internal readonly record struct DiagnosticsRequestState(Project Project, int GlobalStateVersion, RequestContext Context, IDiagnosticSource DiagnosticSource); 26/// cref="Project.GetDependentVersionAsync(CancellationToken)"/> while the <see cref="Checksum"/> is produced by
Handler\Diagnostics\IDiagnosticProjectInformationService.cs (3)
21VSDiagnosticProjectInformation GetDiagnosticProjectInformation(Project project); 29public VSDiagnosticProjectInformation GetDiagnosticProjectInformation(Project project) 32public static VSDiagnosticProjectInformation GetDiagnosticProjectInformationHelper(Project project)
Handler\PullHandlers\VersionedPullCache.cs (1)
74Project project,
Handler\SemanticTokens\SemanticTokensHelpers.cs (1)
41var project = contextDocument.Project;
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (1)
40public async Task TryEnqueueRefreshComputationAsync(Project project, CancellationToken cancellationToken)
Handler\SourceGenerators\SourceGeneratorRefreshQueue.cs (4)
82var oldProject = e.OldSolution.GetProject(projectId); 83var newProject = e.NewSolution.GetProject(projectId); 112async Task CheckDependentVersionsAsync(Project oldProject, Project newProject)
Handler\SpellCheck\SpellCheckPullCache.cs (1)
23var project = state.Document.Project;
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (2)
54foreach (var project in solution.Projects) 61void AddDocumentsFromProject(Project? project, ImmutableArray<string> supportedLanguages)
Handler\Tasks\WorkspaceTaskDiagnosticSourceProvider.cs (1)
36foreach (var project in WorkspaceDiagnosticSourceHelpers.GetProjectsInPriorityOrder(context.Solution, context.SupportedLanguages))
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
Completion\CompletionFeaturesTests.cs (2)
583Project project, LanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, 876Project project, LanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger,
Completion\CompletionResolveTests.cs (1)
511internal override bool ShouldTriggerCompletion(Project project, LanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CodeAnalysis.Completion.CompletionOptions options, OptionSet passthroughOptions, ImmutableHashSet<string> roles = null)
Diagnostics\PullDiagnosticTests.cs (1)
1320static DiagnosticData CreateDiagnostic(string id, Project project, Document? document = null)
Workspaces\LspWorkspaceManagerTests.cs (2)
445var newProjectWorkspaceTwo = testWorkspaceTwo.CurrentSolution.Projects.First().WithAssemblyName("NewCSProj1"); 501var newProject = testWorkspace.CurrentSolution.Projects.First().WithAssemblyName(newAssemblyName);
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (34)
AnnotatePublicApiFix.cs (9)
37Project project = context.Document.Project; 96private readonly List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> _diagnosticsToFix; 99public FixAllAdditionalDocumentChangeAction(string title, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix) 187var diagnosticsToFix = new List<KeyValuePair<Project, ImmutableArray<Diagnostic>>>(); 194diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(fixAllContext.Project, diagnostics)); 201Project project = fixAllContext.Project; 203diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(fixAllContext.Project, diagnostics)); 210foreach (Project project in fixAllContext.Solution.Projects) 213diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(project, diagnostics));
DeclarePublicApiFix.cs (17)
38var project = context.Document.Project; 64private static IEnumerable<TextDocument?> GetUnshippedPublicApiFiles(Project project, bool isPublic) 85private static async Task<Solution> GetFixAsync(TextDocument? surfaceAreaDocument, bool isPublic, Project project, string newSymbolName, ImmutableHashSet<string> siblingSymbolNamesToRemove, CancellationToken cancellationToken) 102private static Solution AddPublicApiFiles(Project project, SourceText unshippedText, bool isPublic) 110static Project AddAdditionalDocument(Project project, string name, SourceText text) 211private readonly List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> _diagnosticsToFix; 216public FixAllAdditionalDocumentChangeAction(string title, DocumentId? apiDocId, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix, bool isPublic) 232foreach (KeyValuePair<Project, ImmutableArray<Diagnostic>> pair in _diagnosticsToFix) 234Project project = pair.Key; 317var project = newSolution.GetProject(pair.Key); 332var diagnosticsToFix = new List<KeyValuePair<Project, ImmutableArray<Diagnostic>>>(); 339diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(fixAllContext.Project, diagnostics)); 346Project project = fixAllContext.Project; 348diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(fixAllContext.Project, diagnostics)); 355foreach (Project project in fixAllContext.Solution.Projects) 358diagnosticsToFix.Add(new KeyValuePair<Project, ImmutableArray<Diagnostic>>(project, diagnostics));
NullableEnablePublicApiFix.cs (6)
34Project project = context.Document.Project; 73private readonly List<Project> _projectsToFix; 76public FixAllAdditionalDocumentChangeAction(string title, Solution solution, List<Project> projectsToFix) 90foreach (var project in _projectsToFix) 123var projectsToFix = new List<Project>(); 137foreach (Project project in fixAllContext.Solution.Projects)
PublicApiFixHelpers.cs (2)
55internal static TextDocument? GetPublicApiDocument(this Project project, string name) 60internal static TextDocument? GetShippedDocument(this Project project, bool isPublic)
Microsoft.CodeAnalysis.Remote.ServiceHub (17)
Host\RemoteWorkspace.SolutionCreator.cs (6)
339private async Task<Solution> UpdateProjectAsync(Project project, ProjectStateChecksums oldProjectChecksums, ProjectStateChecksums newProjectChecksums, CancellationToken cancellationToken) 424private async Task<Project> UpdateDocumentsAsync<TDocumentState>( 425Project project, 471private async Task<Project> UpdateDocumentsAsync( 472Project project, 535private async Task<Project> UpdateDocumentAsync(
Host\TestUtils.cs (3)
169public static async Task<Dictionary<Checksum, object>> GetAssetMapAsync(this Project project, CancellationToken cancellationToken) 205foreach (var project in solution.Projects) 224private static async Task AppendAssetMapAsync(this Project project, Dictionary<Checksum, object> map, CancellationToken cancellationToken)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (6)
58private readonly Project _project; 67Project project, 86Project project, 423static bool ShouldRedirectAnalyzers(Project project, AnalyzerReference reference) 473public Project Project { get; } 477public CompilationWithAnalyzersCacheEntry(Checksum solutionChecksum, Project project, CompilationWithAnalyzersPair? compilationWithAnalyzers, BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap)
Services\EditAndContinue\RemoteEditAndContinueService.cs (2)
151var firstProject = solution.GetProject(runningProjects.FirstOrDefault()) ?? solution.Projects.First(); 170static ImmutableArray<DiagnosticData> GetUnexpectedUpdateError(Project project, string message)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
SolutionAssetStorage.cs (1)
55public ValueTask<Scope> StoreAssetsAsync(Project project, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Verifiers\CSharpSourceGeneratorVerifier`1+Test.cs (1)
82protected override async Task<(Compilation compilation, ImmutableArray<Diagnostic> generatorDiagnostics)> GetProjectCompilationAsync(Project project, IVerifier verifier, CancellationToken cancellationToken)
Verifiers\VisualBasicSourceGeneratorVerifier`1+Test.cs (1)
67protected override async Task<(Compilation compilation, ImmutableArray<Diagnostic> generatorDiagnostics)> GetProjectCompilationAsync(Project project, IVerifier verifier, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.VisualBasic.Features (2)
GenerateType\VisualBasicGenerateTypeService.vb (1)
552Friend Overrides Function IsPublicOnlyAccessibility(expression As ExpressionSyntax, project As Project) As Boolean
GoToDefinition\VisualBasicGoToDefinitionSymbolService.vb (1)
24Protected Overrides Async Function FindRelatedExplicitlyDeclaredSymbolAsync(project As Project, symbol As ISymbol, cancellationToken As CancellationToken) As Task(Of ISymbol)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
122Private Shared Async Function AnalyzeDocumentAsync(oldProject As Project, newDocument As Document, Optional activeStatementMap As ActiveStatementsMap = Nothing) As Task(Of DocumentAnalysisResults)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
FindSymbols\VisualBasicReferenceFinder.vb (3)
24project As Project, 37project As Project, 50project As Project,
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
32Dim project As Project = ws.AddProject(
Microsoft.CodeAnalysis.Workspaces (458)
Classification\AbstractClassificationService.cs (1)
74var project = document.Project;
Classification\Classifier.cs (2)
59Project? project, 71Project? project,
Classification\EmbeddedLanguageClassificationServiceExtensions.cs (1)
17Project project,
Classification\IEmbeddedLanguageClassificationService.cs (1)
25Project project,
Classification\SemanticClassificationCacheUtilities.cs (1)
16var project = document.Project;
CodeFixes\CodeFix.cs (3)
21public readonly Project Project; 43public CodeFix(Project project, CodeAction action, Diagnostic diagnostic) 50public CodeFix(Project project, CodeAction action, ImmutableArray<Diagnostic> diagnostics)
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (1)
47/// other aspects of (like it's properties), or changes to the <see cref="Project"/> or <see cref="Solution"/>
CodeFixes\FixAllOccurrences\FixAllContext.cs (10)
34public Project Project => State.Project; 53/// Note that <see cref="GetDocumentDiagnosticsAsync(Document)"/>, <see cref="GetProjectDiagnosticsAsync(Project)"/> and <see cref="GetAllDiagnosticsAsync(Project)"/> methods 84Optional<(Document? document, Project project)> documentAndProject, 185Project project, 282public Task<ImmutableArray<Diagnostic>> GetProjectDiagnosticsAsync(Project project) 296public Task<ImmutableArray<Diagnostic>> GetAllDiagnosticsAsync(Project project) 311private async Task<ImmutableArray<Diagnostic>> GetProjectDiagnosticsAsync(Project project, bool includeAllDocumentDiagnostics) 333Optional<(Document? document, Project project)> documentAndProject = default, 349internal Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync()
CodeFixes\FixAllOccurrences\FixAllContext.DiagnosticProvider.cs (7)
35public abstract Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken); 41public abstract Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken); 67internal static async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync( 75var project = fixAllContext.Project; 85return await ProducerConsumer<(Project project, ImmutableArray<Diagnostic> diagnostics)>.RunParallelAsync( 94var projectsAndDiagnostics = ImmutableDictionary.CreateBuilder<Project, ImmutableArray<Diagnostic>>(); 109return ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty;
CodeFixes\FixAllOccurrences\FixAllContextHelper.cs (1)
29var project = fixAllContext.Project;
CodeFixes\FixAllOccurrences\FixAllProvider.cs (2)
55/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at 69/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at
CodeFixes\FixAllOccurrences\FixAllState.cs (4)
30Project project, 48protected override FixAllState With(Document? document, Project project, FixAllScope scope, string? codeActionEquivalenceKey) 86ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix, 90var triggerProject = diagnosticsToFix.First().Key;
CodeFixes\FixAllOccurrences\FixAllState.FixMultipleDiagnosticProvider.cs (5)
22public ImmutableDictionary<Project, ImmutableArray<Diagnostic>> ProjectDiagnosticsMap { get; } 27ProjectDiagnosticsMap = ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty; 30public FixMultipleDiagnosticProvider(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsMap) 36public override Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 69public override Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken)
CodeFixes\Supression\IConfigurationFixProvider.cs (1)
34Task<ImmutableArray<CodeFix>> GetFixesAsync(Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken);
CodeFixesAndRefactorings\CommonFixAllState.cs (5)
20public Project Project { get; } 28Project project, 43protected abstract TFixAllState With(Document? document, Project project, FixAllScope scope, string? codeActionEquivalenceKey); 46Optional<(Document? document, Project project)> documentAndProject = default, 71Optional<(Document? document, Project project)> documentAndProject,
CodeFixesAndRefactorings\FixAllLogger.cs (1)
165public static void LogDiagnosticsStats(int correlationId, ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectsAndDiagnosticsToFixMap)
CodeFixesAndRefactorings\IFixAllContext.cs (2)
19Project Project { get; } 29Optional<(Document? document, Project project)> documentAndProject = default,
CodeFixesAndRefactorings\IFixAllState.cs (2)
20Project Project { get; } 29Optional<(Document? document, Project project)> documentAndProject = default,
CodeRefactorings\FixAllOccurences\DocumentBasedFixAllProvider.cs (1)
49/// or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at will be considered.
CodeRefactorings\FixAllOccurences\FixAllContext.cs (3)
61public Project Project => State.Project; 75Optional<(Document? document, Project project)> documentAndProject, 100Optional<(Document? document, Project project)> documentAndProject = default,
CodeRefactorings\FixAllOccurences\FixAllProvider.cs (2)
55/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at 69/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at
CodeRefactorings\FixAllOccurences\FixAllState.cs (3)
48Project project, 61Project project, 73protected override FixAllState With(Document? document, Project project, FixAllScope scope, string? codeActionEquivalenceKey)
Diagnostics\DiagnosticAnalysisResult.cs (2)
76Project project, 155private static void VerifyDocumentMap(Project project, ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> map)
Diagnostics\DiagnosticAnalysisResultBuilder.cs (10)
19internal struct DiagnosticAnalysisResultBuilder(Project project) 21public readonly Project Project = project; 45Contract.ThrowIfTrue(Project.SupportsCompilation); 60var diagnosticDocumentId = Project.GetDocumentForExternalLocation(diagnostic.Location); 64AddDocumentDiagnostic(ref lazyLocals, Project.GetRequiredTextDocument(diagnosticDocumentId), diagnostic); 69AddDocumentDiagnostic(ref _lazyNonLocals, Project.GetRequiredTextDocument(diagnosticDocumentId), diagnostic); 136var diagnosticDocumentId = Project.GetDocumentForExternalLocation(diagnostic.Location); 139AddDocumentDiagnostic(ref _lazyNonLocals, Project.GetRequiredTextDocument(diagnosticDocumentId), diagnostic); 157AddDocumentDiagnostic(ref lazyLocals, Project.GetRequiredDocument(diagnosticTree), diagnostic); 162AddDocumentDiagnostic(ref _lazyNonLocals, Project.GetRequiredDocument(diagnosticTree), diagnostic);
Diagnostics\DiagnosticData.cs (4)
149public async Task<Diagnostic> ToDiagnosticAsync(Project project, CancellationToken cancellationToken) 189public static DiagnosticData Create(Diagnostic diagnostic, Project project) 196var project = document.Project; 293public static bool TryCreate(DiagnosticDescriptor descriptor, string[] messageArguments, Project project, [NotNullWhen(true)] out DiagnosticData? diagnosticData)
Diagnostics\Extensions.cs (12)
27private static readonly ConditionalWeakTable<Project, AsyncLazy<Checksum>> s_projectToDiagnosticChecksum = new(); 29public static async Task<ImmutableArray<Diagnostic>> ToDiagnosticsAsync(this IEnumerable<DiagnosticData> diagnostics, Project project, CancellationToken cancellationToken) 40public static ValueTask<ImmutableArray<Location>> ConvertLocationsAsync(this IReadOnlyCollection<DiagnosticDataLocation> locations, Project project, CancellationToken cancellationToken) 44this DiagnosticDataLocation dataLocation, Project project, CancellationToken cancellationToken) 110Project project, 323Project project, 371Project project, 457/// <see cref="Project.GetDependentSemanticVersionAsync(CancellationToken)"/> does not change as it only returns top level changes.</item> 459/// <see cref="Project.GetDependentSemanticVersionAsync(CancellationToken)"/> changes as the project is removed, then added resulting in a version change.</item> 465public static Task<Checksum> GetDiagnosticChecksumAsync(this Project? project, CancellationToken cancellationToken) 478static async Task<Checksum> ComputeDiagnosticChecksumAsync(Project project, CancellationToken cancellationToken) 510public static async Task<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(Project project, CancellationToken cancellationToken)
Diagnostics\GeneratorDiagnosticsPlaceholderAnalyzer.cs (1)
30var project = textDocument.Project;
Diagnostics\HostDiagnosticAnalyzers.cs (2)
85public ImmutableDictionary<string, ImmutableArray<DiagnosticDescriptor>> GetDiagnosticDescriptorsPerReference(DiagnosticAnalyzerInfoCache infoCache, Project project) 124public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateDiagnosticAnalyzersPerReference(Project project)
Diagnostics\ProjectDiagnosticAnalyzer.cs (1)
18public abstract Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken);
Editing\SymbolEditor.cs (3)
84foreach (var project in solutionChanges.GetAddedProjects()) 103var project = ChangedSolution.GetProject(symbol.ContainingAssembly, cancellationToken); 150var project = solution.GetProject(projectId);
Editing\SyntaxGenerator.cs (1)
77public static SyntaxGenerator GetGenerator(Project project)
ExternalAccess\UnitTesting\Api\UnitTestingProjectExtensions.cs (1)
15public static Task<bool> HasSuccessfullyLoadedAsync(this Project project, CancellationToken cancellationToken)
FindSymbols\Declarations\DeclarationFinder.cs (2)
19Project project, 68Project project,
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (3)
24Project project, SearchQuery query, SymbolFilter criteria, CancellationToken cancellationToken) 60Project project, SearchQuery query, SymbolFilter criteria, CancellationToken cancellationToken) 99var referencedProject = project.Solution.GetProject(projectReference.ProjectId);
FindSymbols\Declarations\DeclarationFinder_SourceDeclarations.cs (5)
64Project project, string name, bool ignoreCase, SymbolFilter criteria, CancellationToken cancellationToken) 135Project project, string pattern, SymbolFilter criteria, CancellationToken cancellationToken) 181foreach (var project in solution.Projects) 191Project project, string name, bool ignoreCase, SymbolFilter filter, CancellationToken cancellationToken) 246Project project, string pattern, SymbolFilter criteria, CancellationToken cancellationToken)
FindSymbols\FindReferences\DependentProjectsFinder.cs (27)
36(IAssemblySymbol assembly, Project? sourceProject, SymbolVisibility visibility), 37ImmutableArray<(Project project, bool hasInternalsAccess)>>> s_solutionToDependentProjectMap = new(); 40public static async Task<ImmutableArray<Project>> GetDependentProjectsAsync( 41Solution solution, ImmutableArray<ISymbol> symbols, IImmutableSet<Project> projects, CancellationToken cancellationToken) 73private static async Task<ImmutableArray<Project>> GetDependentProjectsWorkerAsync( 80using var _ = PooledHashSet<Project>.GetInstance(out var result); 101/// cref="IAssemblySymbol"/> for both source and metadata symbols, and an optional <see cref="Project"/> if this 104private static Dictionary<IAssemblySymbol, (Project? sourceProject, SymbolVisibility maxVisibility)> GetSymbolOriginations( 107var result = new Dictionary<IAssemblySymbol, (Project? sourceProject, SymbolVisibility visibility)>(); 120var project = assembly.Locations.Any(static loc => loc.IsInMetadata) 134private static async Task<ImmutableArray<(Project project, bool hasInternalsAccess)>> ComputeDependentProjectsAsync( 136(IAssemblySymbol assembly, Project? sourceProject) symbolOrigination, 143ImmutableArray<(Project project, bool hasInternalsAccess)> dependentProjects; 162static async Task<ImmutableArray<(Project project, bool hasInternalsAccess)>> ComputeDependentProjectsWorkerAsync( 164(IAssemblySymbol assembly, Project? sourceProject) symbolOrigination, 170using var _ = PooledHashSet<(Project, bool hasInternalsAccess)>.GetInstance(out var dependentProjects); 193Solution solution, Project? sourceProject, HashSet<(Project project, bool hasInternalsAccess)> dependentProjects, CancellationToken cancellationToken) 203var project = solution.GetRequiredProject(projectId); 215var referencedProject = solution.GetProject(previous.Assembly, cancellationToken); 259(IAssemblySymbol assembly, Project? sourceProject) symbolOrigination, 260HashSet<(Project project, bool hasInternalsAccess)> dependentProjects, 268foreach (var project in solution.Projects) 307(IAssemblySymbol assembly, Project? sourceProject) symbolOrigination, 308Project project, 324private static async Task<bool> HasReferenceToAssemblyAsync(Project project, string assemblyName, CancellationToken cancellationToken) 396static Compilation CreateCompilation(Project project)
FindSymbols\FindReferences\DependentTypeFinder.cs (14)
63IImmutableSet<Project>? projects, 131foreach (var project in orderedProjectsToExamine) 141async Task DescendInheritanceTreeInProjectAsync(Project project) 189async Task AddDescendantSourceTypesInProjectAsync(SymbolSet result, Project project) 291async Task AddDescendantMetadataTypesInProjectAsync(SymbolSet result, Project project) 333Project project, 425var sourceProject = 440ProjectDependencyGraph dependencyGraph, Project project) 447private static ImmutableArray<Project> GetOrderedProjectsToExamine( 449IImmutableSet<Project> projects, 461private static ImmutableArray<Project> OrderTopologically( 462Solution solution, IEnumerable<Project> projectsToExamine) 478private static ImmutableArray<Project> GetProjectsToExamineWorker( 480IImmutableSet<Project> projects,
FindSymbols\FindReferences\DependentTypeFinder_DerivedClasses.cs (1)
18IImmutableSet<Project>? projects,
FindSymbols\FindReferences\DependentTypeFinder_DerivedInterfaces.cs (1)
18IImmutableSet<Project>? projects,
FindSymbols\FindReferences\DependentTypeFinder_ImplementingTypes.cs (1)
17IImmutableSet<Project>? projects,
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (3)
29/// substantively different <see cref="Project"/>. For example, if the <see 43Project project, CancellationToken cancellationToken) 67private static async Task<ProjectIndex> CreateIndexAsync(Project project, CancellationToken cancellationToken)
FindSymbols\FindReferences\DependentTypeFinder_Remote.cs (2)
21IImmutableSet<Project>? projects, 55IImmutableSet<Project>? projects,
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (1)
30Project project,
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (15)
28ISymbol symbol, Project project, CancellationToken cancellationToken); 34ISymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, FindReferencesSearchOptions options, CancellationToken cancellationToken); 84Project project, 117Project project, 140Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 147Project project, 329Project project, 345Project project, 361protected static Task FindDocumentsWithForEachStatementsAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 364protected static Task FindDocumentsWithUsingStatementsAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 803TSymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, 813TSymbol symbol, Project project, CancellationToken cancellationToken) 819ISymbol symbol, Project project, CancellationToken cancellationToken) 827ISymbol symbol, HashSet<string>? globalAliases, Project project, 871Project project, string name, int arity, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (1)
22Project project,
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (4)
48protected override Task<ImmutableArray<string>> DetermineGlobalAliasesAsync(IMethodSymbol symbol, Project project, CancellationToken cancellationToken) 57Project project, 92private static Task FindDocumentsWithImplicitObjectCreationExpressionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 96Project project,
FindSymbols\FindReferences\Finders\DestructorSymbolReferenceFinder.cs (1)
21Project project,
FindSymbols\FindReferences\Finders\DynamicTypeSymbolReferenceFinder.cs (1)
28Project project,
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (1)
52Project project,
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
28Project project,
FindSymbols\FindReferences\Finders\ExplicitInterfaceMethodReferenceFinder.cs (1)
21Project project,
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (1)
32Project project,
FindSymbols\FindReferences\Finders\ILanguageServiceReferenceFinder.cs (1)
20ISymbol symbol, Project project, CancellationToken cancellationToken);
FindSymbols\FindReferences\Finders\IReferenceFinder.cs (2)
28ISymbol symbol, Project project, CancellationToken cancellationToken); 55Project project, IImmutableSet<Document>? documents,
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
43Project project,
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (3)
22protected override Task<ImmutableArray<string>> DetermineGlobalAliasesAsync(INamedTypeSymbol symbol, Project project, CancellationToken cancellationToken) 55Project project, 82Project project,
FindSymbols\FindReferences\Finders\NamespaceSymbolReferenceFinder.cs (2)
21protected override Task<ImmutableArray<string>> DetermineGlobalAliasesAsync(INamespaceSymbol symbol, Project project, CancellationToken cancellationToken) 29Project project,
FindSymbols\FindReferences\Finders\OperatorSymbolReferenceFinder.cs (2)
23Project project, 36Project project,
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (4)
50Project project, 93private static Task FindDocumentsWithDeconstructionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 96private static Task FindDocumentsWithAwaitExpressionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 99private static Task FindDocumentsWithCollectionInitializersAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (1)
27Project project,
FindSymbols\FindReferences\Finders\PreprocessingSymbolReferenceFinder.cs (1)
22Project project,
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (1)
35Project project,
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (3)
110Project project, 175Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 182Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (1)
21Project project,
FindSymbols\FindReferences\FindReferencesSearchEngine.BidirectionalSymbolSet.cs (1)
47public override async Task InheritanceCascadeAsync(Project project, CancellationToken cancellationToken)
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (6)
125private async IAsyncEnumerable<(Project project, ImmutableArray<(ISymbol symbol, SymbolGroup group)> allSymbols)> GetProjectsAndSymbolsToSearchSeriallyAsync( 127ImmutableArray<Project> projectsToSearch, 139var currentProject = _solution.GetRequiredProject(projectId); 205private Task<ImmutableArray<Project>> GetProjectsToSearchAsync( 216Project project, ImmutableArray<(ISymbol symbol, SymbolGroup group)> allSymbols, Action<Reference> onReferenceFound, CancellationToken cancellationToken) 342Project project,
FindSymbols\FindReferences\FindReferencesSearchEngine.NonCascadingSymbolSet.cs (1)
24public override Task InheritanceCascadeAsync(Project project, CancellationToken cancellationToken)
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (3)
56public abstract Task InheritanceCascadeAsync(Project project, CancellationToken cancellationToken); 239ImmutableHashSet<Project> projects, CancellationToken cancellationToken) 274ImmutableHashSet<Project> projects,
FindSymbols\FindReferences\FindReferencesSearchEngine.UnidirectionalSymbolSet.cs (1)
45public override async Task InheritanceCascadeAsync(Project project, CancellationToken cancellationToken)
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (2)
64var currentProject = _solution.GetRequiredProject(projectId); 75async ValueTask PerformSearchInProjectSeriallyAsync(ImmutableArray<(ISymbol symbol, SymbolGroup group)> symbols, Project project)
FindSymbols\ReferenceLocationExtensions.cs (1)
28var project = projectGroup.Key;
FindSymbols\SymbolFinder_Declarations_AllDeclarations.cs (2)
17Project project, string name, bool ignoreCase, CancellationToken cancellationToken = default) 29Project project, string name, bool ignoreCase, SymbolFilter filter, CancellationToken cancellationToken = default)
FindSymbols\SymbolFinder_Declarations_CustomQueries.cs (4)
61var project = solution.GetRequiredProject(projectId); 73public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, CancellationToken cancellationToken = default) 79public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default) 89Project project, SearchQuery query, SymbolFilter filter, CancellationToken cancellationToken)
FindSymbols\SymbolFinder_Declarations_SourceDeclarations.cs (4)
40public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, string name, bool ignoreCase, CancellationToken cancellationToken = default) 47Project project, string name, bool ignoreCase, SymbolFilter filter, CancellationToken cancellationToken = default) 95public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(Project project, string pattern, CancellationToken cancellationToken = default) 106Project project, string pattern, SymbolFilter filter, CancellationToken cancellationToken = default)
FindSymbols\SymbolFinder_Hierarchy.cs (19)
27ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 37ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 93ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 116IImmutableSet<Project>? projects, 204/// IImmutableSet{Project}, CancellationToken)"/>. 213INamedTypeSymbol type, Solution solution, IImmutableSet<Project>? projects, CancellationToken cancellationToken) 221/// IImmutableSet{Project}, CancellationToken)"/>. 231INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 243/// <inheritdoc cref="FindDerivedClassesArrayAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/> 246INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 267INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 279/// <inheritdoc cref="FindDerivedInterfacesAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/> 282INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 303INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 315/// <inheritdoc cref="FindImplementationsAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/> 318INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 332ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 351/// <inheritdoc cref="FindImplementationsAsync(ISymbol, Solution, IImmutableSet{Project}, CancellationToken)"/> 356ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
FindSymbols\SymbolTree\ISymbolTreeInfoCacheService.cs (3)
12/// Computes and caches <see cref="SymbolTreeInfo"/> indices for the source symbols in <see cref="Project"/>s and 17ValueTask<SymbolTreeInfo?> TryGetPotentiallyStaleSourceSymbolTreeInfoAsync(Project project, CancellationToken cancellationToken); 18ValueTask<SymbolTreeInfo?> TryGetPotentiallyStaleMetadataSymbolTreeInfoAsync(Project project, PortableExecutableReference reference, CancellationToken cancellationToken);
FindSymbols\SymbolTree\SymbolTreeInfo.cs (1)
20/// cref="Project"/> or <see cref="PortableExecutableReference"/>. This tree can be used to quickly determine if
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (5)
30private static string GetSourceKeySuffix(Project project) 34Project project, Checksum checksum, CancellationToken cancellationToken) 53Project project, CancellationToken cancellationToken) 70public static Task<Checksum> GetSourceSymbolsChecksumAsync(Project project, CancellationToken cancellationToken) 119Project project, Checksum checksum, CancellationToken cancellationToken)
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (6)
69Project project, 96Project project, CancellationToken cancellationToken) 128var project = solution.GetProject(projectId); 144private async Task AnalyzeProjectAsync(Project project, CancellationToken cancellationToken) 159private async Task UpdateSourceSymbolTreeInfoAsync(Project project, CancellationToken cancellationToken) 191Project project,
Packaging\IPackageInstallerService.cs (1)
29ImmutableArray<Project> GetProjectsWithInstalledPackage(Solution solution, string packageName, string version);
Recommendations\Recommender.cs (1)
58private static RecommendationServiceOptions GetOptions(OptionSet? options, Project project)
Remote\RemoteArguments.cs (5)
62var project = solution.GetOriginatingProject(symbol); 68public static SerializableSymbolAndProjectId Create(ISymbol symbol, Project project, CancellationToken cancellationToken) 75var project = solution.GetOriginatingProject(symbol); 86ISymbol symbol, Project project, CancellationToken cancellationToken, 103var project = solution.GetRequiredProject(projectId);
Remote\RemoteHostClient.cs (5)
31public static Task<RemoteHostClient?> TryGetClientAsync(Project project, CancellationToken cancellationToken) 140Project project, 167Project project, 209Project project, 226Project project,
Remote\RemoteServiceConnection.cs (4)
79Project project, 85Project project, 129Project project, 135Project project,
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
343var currentProject = conflictResolution.CurrentSolution.GetRequiredProject(projectId); 468private async Task<ImmutableHashSet<ISymbol>?> GetNonConflictSymbolsAsync(Project currentProject)
Rename\Renamer.RenameDocumentActionSet.cs (1)
140var project = solution.GetRequiredProject(_documentId.ProjectId);
Shared\Extensions\ISolutionExtensions.cs (1)
26var project = solution.GetProject(projectId)!;
Shared\Extensions\ProjectExtensions.cs (12)
16internal static Project WithSolutionOptions(this Project project, OptionSet options) 19public static TextDocument? GetTextDocument(this Project project, DocumentId? documentId) 22internal static DocumentId? GetDocumentForExternalLocation(this Project project, Location location) 28internal static DocumentId? GetDocumentForFile(this Project project, AdditionalText additionalText) 31private static DocumentId? GetDocumentIdWithFilePath(this Project project, string filePath) 34public static Document GetRequiredDocument(this Project project, DocumentId documentId) 37public static Document GetRequiredDocument(this Project project, SyntaxTree tree) 40public static TextDocument GetRequiredAdditionalDocument(this Project project, DocumentId documentId) 43public static TextDocument GetRequiredAnalyzerConfigDocument(this Project project, DocumentId documentId) 46public static TextDocument GetRequiredTextDocument(this Project project, DocumentId documentId) 49public static async ValueTask<Document> GetRequiredSourceGeneratedDocumentAsync(this Project project, DocumentId documentId, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
15Project triggerProject)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (3)
38public static Project GetRequiredProject(this Solution solution, ProjectId projectId) 40var project = solution.GetProject(projectId); 81var project = solution.GetRequiredProject(documentId.ProjectId);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (9)
17public static TLanguageService? GetLanguageService<TLanguageService>(this Project? project) where TLanguageService : class, ILanguageService 24public static TLanguageService GetRequiredLanguageService<TLanguageService>(this Project project) where TLanguageService : class, ILanguageService 33/// Gets extended host language services, which includes language services from <see cref="Project.LanguageServices"/>. 35public static HostLanguageServices GetExtendedLanguageServices(this Project project) 44public static string? TryGetAnalyzerConfigPathForProjectConfiguration(this Project project) 47public static string? TryGetAnalyzerConfigPathForDiagnosticConfiguration(this Project project, Diagnostic diagnostic) 53private static string? TryGetAnalyzerConfigPathForProjectOrDiagnosticConfiguration(Project project, Diagnostic? diagnostic) 101public static AnalyzerConfigDocument? TryGetExistingAnalyzerConfigDocumentAtPath(this Project project, string analyzerConfigPath) 109public static async Task<Compilation> GetRequiredCompilationAsync(this Project project, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
58foreach (var sourceProject in solution.Projects) 76var project = solution.GetProject(symbol.ContainingAssembly, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
25public Project Project => Document.Project;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
12public static bool CanApplyParseOptionChange(this Project project, ParseOptions oldOptions, ParseOptions newOptions)
Storage\SQLite\v2\SQLitePersistentStorage_ProjectSerialization.cs (3)
17protected override Task<bool> ChecksumMatchesAsync(ProjectKey projectKey, Project? project, string name, Checksum checksum, CancellationToken cancellationToken) 20protected override Task<Stream?> ReadStreamAsync(ProjectKey projectKey, Project? project, string name, Checksum? checksum, CancellationToken cancellationToken) 23protected override Task<bool> WriteStreamAsync(ProjectKey projectKey, Project? project, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Storage\SQLite\v2\SQLitePersistentStorageConstants.cs (1)
66/// Inside the DB we have a table for data that we want associated with a <see cref="Project"/>. The data is
Workspace\AdhocWorkspace.cs (2)
63public Project AddProject(string name, string language) 72public Project AddProject(ProjectInfo projectInfo)
Workspace\Host\ISupportedChangesService.cs (4)
21bool CanApplyCompilationOptionChange(CompilationOptions oldOptions, CompilationOptions newOptions, Project project); 24bool CanApplyParseOptionChange(ParseOptions oldOptions, ParseOptions newOptions, Project project); 44public bool CanApplyCompilationOptionChange(CompilationOptions oldOptions, CompilationOptions newOptions, Project project) 47public bool CanApplyParseOptionChange(ParseOptions oldOptions, ParseOptions newOptions, Project project)
Workspace\Host\PersistentStorage\AbstractPersistentStorage.cs (8)
50protected abstract Task<bool> ChecksumMatchesAsync(ProjectKey projectKey, Project? project, string name, Checksum checksum, CancellationToken cancellationToken); 52protected abstract Task<Stream?> ReadStreamAsync(ProjectKey projectKey, Project? project, string name, Checksum? checksum, CancellationToken cancellationToken); 54protected abstract Task<bool> WriteStreamAsync(ProjectKey projectKey, Project? project, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken); 75public Task<bool> ChecksumMatchesAsync(Project project, string name, Checksum checksum, CancellationToken cancellationToken) 81public Task<Stream?> ReadStreamAsync(Project project, string name, Checksum? checksum, CancellationToken cancellationToken) 90public Task<Stream?> ReadStreamAsync(Project project, string name, CancellationToken cancellationToken) 96public Task<bool> WriteStreamAsync(Project project, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken) 105public Task<bool> WriteStreamAsync(Project project, string name, Stream stream, CancellationToken cancellationToken)
Workspace\Host\PersistentStorage\IChecksummedPersistentStorage.cs (3)
29Task<bool> ChecksumMatchesAsync(Project project, string name, Checksum checksum, CancellationToken cancellationToken = default); 52Task<Stream?> ReadStreamAsync(Project project, string name, Checksum? checksum = null, CancellationToken cancellationToken = default); 84Task<bool> WriteStreamAsync(Project project, string name, Stream stream, Checksum? checksum = null, CancellationToken cancellationToken = default);
Workspace\Host\PersistentStorage\IPersistentStorage.cs (2)
19Task<Stream?> ReadStreamAsync(Project project, string name, CancellationToken cancellationToken = default); 32Task<bool> WriteStreamAsync(Project project, string name, Stream stream, CancellationToken cancellationToken = default);
Workspace\Host\PersistentStorage\NoOpPersistentStorage.cs (5)
26public Task<bool> ChecksumMatchesAsync(Project project, string name, Checksum checksum, CancellationToken cancellationToken) 41public Task<Stream?> ReadStreamAsync(Project project, string name, CancellationToken cancellationToken) 50public Task<Stream?> ReadStreamAsync(Project project, string name, Checksum? checksum, CancellationToken cancellationToken) 65public Task<bool> WriteStreamAsync(Project project, string name, Stream stream, CancellationToken cancellationToken) 74public Task<bool> WriteStreamAsync(Project project, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Workspace\Host\PersistentStorage\ProjectKey.cs (3)
12/// <see cref="Project"/> without needing to have the entire <see cref="Project"/> snapshot available. 34public static ProjectKey ToProjectKey(Project project)
Workspace\ProjectSystem\ProjectSystemProject.cs (4)
582var projectBeforeMutations = solutionChanges.Solution.GetRequiredProject(Id); 665Project projectBeforeMutation, 782var project = solution.GetRequiredProject(projectId); 1413var project = w.CurrentSolution.GetRequiredProject(Id);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (4)
51private readonly Action<Project> _onProjectRemoved; 81Action<Project> onProjectRemoved, 386Project project = null!; 870Func<Project, IEnumerable<TReference>> getReferences,
Workspace\Solution\AdditionalDocument.cs (1)
12internal AdditionalDocument(Project project, TextDocumentState state)
Workspace\Solution\AnalyzerConfigDocument.cs (1)
9internal AnalyzerConfigDocument(Project project, AnalyzerConfigDocumentState state)
Workspace\Solution\AssetPath.cs (1)
12/// particular, this is often used to scope to a particular <see cref="Project"/> or <see cref="Document"/> to avoid
Workspace\Solution\Document.cs (2)
45internal Document(Project project, DocumentState state) 546/// returned if the compilation for its <see cref="Project"/> was already produced. In this case, generators and
Workspace\Solution\Project.cs (33)
51/// The ID of the project. Multiple <see cref="Project"/> instances may share the same ID. However, only 90/// <see langword="true"/> if this <see cref="Project"/> supports providing data through the 464private static readonly Func<DocumentId, Project, Document?> s_tryCreateDocumentFunction = 467private static readonly Func<DocumentId, Project, AdditionalDocument?> s_tryCreateAdditionalDocumentFunction = 470private static readonly Func<DocumentId, Project, AnalyzerConfigDocument?> s_tryCreateAnalyzerConfigDocumentFunction = 473private static readonly Func<DocumentId, (SourceGeneratedDocumentState state, Project project), SourceGeneratedDocument> s_createSourceGeneratedDocumentFunction = 505public ProjectChanges GetChanges(Project oldProject) 549public Project WithAssemblyName(string assemblyName) 555public Project WithDefaultNamespace(string defaultNamespace) 558internal Project WithOutputFilePath(string? path) 561internal Project WithOutputRefFilePath(string? path) 564internal Project WithCompilationOutputInfo(in CompilationOutputInfo info) 570public Project WithCompilationOptions(CompilationOptions options) 576public Project WithParseOptions(ParseOptions options) 583public Project AddProjectReference(ProjectReference projectReference) 590public Project AddProjectReferences(IEnumerable<ProjectReference> projectReferences) 596public Project RemoveProjectReference(ProjectReference projectReference) 603public Project WithProjectReferences(IEnumerable<ProjectReference> projectReferences) 610public Project AddMetadataReference(MetadataReference metadataReference) 617public Project AddMetadataReferences(IEnumerable<MetadataReference> metadataReferences) 623public Project RemoveMetadataReference(MetadataReference metadataReference) 630public Project WithMetadataReferences(IEnumerable<MetadataReference> metadataReferences) 637public Project AddAnalyzerReference(AnalyzerReference analyzerReference) 644public Project AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) 650public Project RemoveAnalyzerReference(AnalyzerReference analyzerReference) 657public Project WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferencs) 664internal Project WithAttributes(ProjectInfo.ProjectAttributes attributes) 727public Project RemoveDocument(DocumentId documentId) 737public Project RemoveDocuments(ImmutableArray<DocumentId> documentIds) 747public Project RemoveAdditionalDocument(DocumentId documentId) 755public Project RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 765public Project RemoveAnalyzerConfigDocument(DocumentId documentId) 773public Project RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds)
Workspace\Solution\ProjectChanges.cs (14)
12internal ProjectChanges(Project newProject, Project oldProject) 20public Project OldProject { get; } 22public Project NewProject { get; } 97/// Get <see cref="DocumentId"/>s of added documents in the order they appear in <see cref="Project.DocumentIds"/> of the <see cref="NewProject"/>. 103/// Get <see cref="DocumentId"/>s of added dditional documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="NewProject"/>. 109/// Get <see cref="DocumentId"/>s of added analyzer config documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="NewProject"/>. 116/// in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="NewProject"/>. 122/// Get changed documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="NewProject"/>. 134/// in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="NewProject"/>. 141/// in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="NewProject"/>. 147/// Get <see cref="DocumentId"/>s of removed documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="OldProject"/>. 153/// Get <see cref="DocumentId"/>s of removed additional documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="OldProject"/>. 159/// Get <see cref="DocumentId"/>s of removed analyzer config documents in the order they appear in <see cref="Project.DocumentIds"/> of <see cref="OldProject"/>.
Workspace\Solution\ProjectId.cs (1)
15/// An identifier that can be used to refer to the same <see cref="Project"/> across versions.
Workspace\Solution\Solution.cs (18)
32private ImmutableDictionary<ProjectId, Project> _projectIdToProjectMap; 49_projectIdToProjectMap = ImmutableDictionary<ProjectId, Project>.Empty; 125public IEnumerable<Project> Projects => ProjectIds.Select(id => GetProject(id)!); 143public Project? GetProject(ProjectId? projectId) 153private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject; 154private static Project CreateProject(ProjectId projectId, Solution solution) 163/// Gets the <see cref="Project"/> associated with an assembly symbol. 165public Project? GetProject(IAssemblySymbol assemblySymbol, 174/// Given a <paramref name="symbol"/> returns the <see cref="ProjectId"/> of the <see cref="Project"/> it came 197internal Project? GetOriginatingProject(ISymbol symbol) 245var project = GetProject(documentId?.ProjectId); 260var project = GetProject(documentId?.ProjectId); 298var project = GetProject(documentId.ProjectId); 347public Project AddProject(string name, string assemblyName, string language) 1027/// Create a new <see cref="Solution"/> instance with the corresponding <see cref="Project"/>s updated to include 1626var newProject = newSolution.GetRequiredProject(newDocumentState.Id.ProjectId); 1652internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState) 1759var project = this.GetProject(documentId.ProjectId);
Workspace\Solution\SolutionChanges.cs (2)
25public IEnumerable<Project> GetAddedProjects() 52public IEnumerable<Project> GetRemovedProjects()
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (2)
134/// <see cref="Project.GetCompilationAsync"/> or <see cref="Project.TryGetCompilation"/> must be from a <see
Workspace\Solution\SolutionCompilationState.cs (4)
1143/// Gets the <see cref="Project"/> associated with an assembly symbol. 1842/// <inheritdoc cref="Solution.WithCachedSourceGeneratorState(ProjectId, Project)"/> 1843public SolutionCompilationState WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState) 1911public GeneratorDriver? GetGeneratorDriver(Project project)
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (1)
20/// Returns <see langword="true"/> if this <see cref="Project"/>/<see cref="Compilation"/> could produce the
Workspace\Solution\SolutionCompilationState.RootedSymbolSet.cs (3)
41/// A helper type for mapping <see cref="ISymbol"/> back to an originating <see cref="Project"/>/<see 45/// In IDE scenarios we have the need to map from an <see cref="ISymbol"/> to the <see cref="Project"/> that 49/// cref="SymbolKey"/>) to resolve that symbol back in that that <see cref="Project"/>.
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (2)
38/// cref="VersionStamp"/> for a project. As long as the <see cref="Project.GetDependentSemanticVersionAsync"/> for 104/// The <see cref="Project.GetDependentSemanticVersionAsync"/> version of the project that the <see
Workspace\Solution\SourceGeneratedDocument.cs (1)
16internal SourceGeneratedDocument(Project project, SourceGeneratedDocumentState state)
Workspace\Solution\TextDocument.cs (2)
22public Project Project { get; } 24internal TextDocument(Project project, TextDocumentState state, TextDocumentKind kind)
Workspace\Workspace.cs (14)
302foreach (var addedProject in changes.GetAddedProjects()) 1452foreach (var p in solution.Projects) 1468var project = solution.GetProject(pid)!; 1567foreach (var proj in solutionChanges.GetAddedProjects()) 1589foreach (var proj in solutionChanges.GetRemovedProjects()) 1831/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed. 1840public virtual bool CanApplyCompilationOptionChange(CompilationOptions oldOptions, CompilationOptions newOptions, Project project) 1844/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed. 1853public virtual bool CanApplyParseOptionChange(ParseOptions oldOptions, ParseOptions newOptions, Project project) 2029private static ProjectInfo CreateProjectInfo(Project project) 2089var oldProject = CurrentSolution.GetRequiredProject(projectId); 2090var newProjectForAssert = oldProject.WithCompilationOptions(options); 2107var oldProject = CurrentSolution.GetRequiredProject(projectId); 2108var newProjectForAssert = oldProject.WithParseOptions(options);
Workspace\Workspace_Editor.cs (3)
879protected virtual Project AdjustReloadedProject(Project oldProject, Project reloadedProject)
Workspace\Workspace_SourceGeneration.cs (1)
122var requestedProject = solution.GetProject(projectId);
Workspace\WorkspaceChangeEventArgs.cs (1)
39/// The id of the affected <see cref="Project"/>. Can be <see langword="null"/> if this is an change unrelated
Microsoft.CodeAnalysis.Workspaces.MSBuild (11)
MSBuild\MSBuildWorkspace.cs (7)
224public Task<Project> OpenProjectAsync( 240public async Task<Project> OpenProjectAsync( 263var projectResult = this.CurrentSolution.GetProject(projects[0].Id); 335var project = projectChanges.OldProject ?? projectChanges.NewProject; 629var project = this.CurrentSolution.GetProject(projectId); 654var project = this.CurrentSolution.GetProject(projectReference.ProjectId); 669var project = this.CurrentSolution.GetProject(projectReference.ProjectId);
MSBuild\ProjectMap.cs (4)
63foreach (var project in solution.Projects) 72/// Add a <see cref="Project"/> to this <see cref="ProjectMap"/>. 74/// <param name="project">The <see cref="Project"/> to add to this <see cref="ProjectMap"/>.</param> 75public void Add(Project project)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (148)
MSBuildWorkspaceTestBase.cs (6)
72var project = sol.Projects.First(); 81var project = sol.Projects.First(); 90var project = sol.GetProjectsByName("VisualBasicProject").FirstOrDefault(); 99var project = sol.GetProjectsByName("VisualBasicProject").FirstOrDefault(); 128var p1 = sol.Projects.First(p => p.Language == LanguageNames.CSharp); 129var p2 = sol.Projects.First(p => p.Language == LanguageNames.VisualBasic);
NetCoreTests.cs (18)
81var project = await workspace.OpenProjectAsync(projectFilePath); 110var libraryProject = await workspace.OpenProjectAsync(libraryFilePath); 121var project = await workspace.OpenProjectAsync(projectFilePath); 150var project = await workspace.OpenProjectAsync(projectFilePath); 161var library2 = await workspace.OpenProjectAsync(library2FilePath); 172static void AssertSingleProjectReference(Project project, string projectRefFilePath) 201foreach (var project in workspace.CurrentSolution.Projects) 214foreach (var project in workspace.CurrentSolution.Projects) 242foreach (var project in workspace.CurrentSolution.Projects) 291foreach (var project in workspace.CurrentSolution.Projects) 313foreach (var project in workspace.CurrentSolution.Projects) 350foreach (var project in projects) 354var referencedProject = workspace.CurrentSolution.GetProject(projectReference.ProjectId); 389foreach (var project in projects) 419var project = await workspace.OpenProjectAsync(projectFilePath); 477var project = await workspace.OpenProjectAsync(fullProjectPath); 498var project = await workspace.OpenProjectAsync(vbProjectFilePath); 518static void AssertSingleProjectReference(Project project, string projectRefFilePath)
NewlyCreatedProjectsFromDotNetNew.cs (1)
214var project = await workspace.OpenProjectAsync(projectFilePath, cancellationToken: CancellationToken.None);
VisualStudioMSBuildWorkspaceTests.cs (123)
64var project = solution.Projects.First(); 81var vbProject = solution.Projects.First(p => p.Language == LanguageNames.VisualBasic); 120var p0 = solution.Projects.ElementAt(0); 121var p1 = solution.Projects.ElementAt(1); 152var proj1 = await workspace.OpenProjectAsync(fullPath1); 153var proj2 = await workspace.OpenProjectAsync(fullPath2); 188private static MetadataReference GetMetadataReference(Project project, string name) 193private static MetadataReference GetMetadataReferenceByAlias(Project project, string aliasName) 249var p1 = sol.Projects.First(p => p.Language == LanguageNames.CSharp); 250var p2 = sol.Projects.First(p => p.Language == LanguageNames.VisualBasic); 264var p1 = sol.Projects.First(p => p.Language == LanguageNames.CSharp); 265var p2 = sol.Projects.First(p => p.Language == LanguageNames.VisualBasic); 285var project = solution.Projects.Single(); 303var project = sol.Projects.First(p => p.Language == language); 318var p1 = sol.Projects.First(p => p.Language == LanguageNames.CSharp); 319var p2 = sol.Projects.First(p => p.Language == LanguageNames.VisualBasic); 341var p1 = sol.Projects.First(p => p.Language == LanguageNames.CSharp); 351var p2 = p1.Solution.Projects.First(p => p.Language == LanguageNames.VisualBasic); 378var project2 = solution.GetProjectsByName("Project2").First(); 397var project = solution.Projects.First(); 441var project = await workspace.OpenProjectAsync(projectFilePath); 462var project = await workspace.OpenProjectAsync(projectFilePath); 480var project = await workspace.OpenProjectAsync(projectFilePath); 496var project = await workspace.OpenProjectAsync(projectFilePath); 511var project = await workspace.OpenProjectAsync(projectFilePath); 525var project = await workspace.OpenProjectAsync(projectFilePath); 540var project = await workspace.OpenProjectAsync(projectFilePath); 555var project = await workspace.OpenProjectAsync(projectFilePath); 568var project = await workspace.OpenProjectAsync(projectFilePath); 580var project = await workspace.OpenProjectAsync(projectFilePath); 594var project = solution.Projects.First(); 607var project = await workspace.OpenProjectAsync(projectFilePath); 620var project = await workspace.OpenProjectAsync(projectFilePath); 635var project = await workspace.OpenProjectAsync(projectFilePath); 649var project = await workspace.OpenProjectAsync(projectFilePath); 664var project = await workspace.OpenProjectAsync(projectFilePath); 679var project = await workspace.OpenProjectAsync(projectFilePath); 693var project = await workspace.OpenProjectAsync(projectFilePath); 706var project = await workspace.OpenProjectAsync(projectFilePath); 719var project = await workspace.OpenProjectAsync(projectFilePath); 733var project = await workspace.OpenProjectAsync(projectFilePath); 748var project = await workspace.OpenProjectAsync(projectFilePath); 766var project = await workspace.OpenProjectAsync(projectFilePath); 794var project = solution.Projects.First(); 812var project = solution.Projects.First(); 830var project = solution.Projects.First(); 848var project = solution.Projects.First(); 899var project = await workspace.OpenProjectAsync(projectFilePath); 918var project = await workspace.OpenProjectAsync(projectFilePath); 1228var project = await workspace.OpenProjectAsync(projectFilePath); 1257var project = await workspace.OpenProjectAsync(projectFilePath); 1290var project = await workspace.OpenProjectAsync(projectFilePath); 1328var project = await workspace.OpenProjectAsync(projectFilePath); 1352var project = await workspace.OpenProjectAsync(projectFilePath); 1375var project = await workspace.OpenProjectAsync(projectFilePath); 1397var project = await workspace.OpenProjectAsync(projectFilePath); 1418var project = await workspace.OpenProjectAsync(projectFilePath); 1441var vbProject = await workspace.OpenProjectAsync(vbProjectFilePath); 1448var csProject = await workspace.OpenProjectAsync(csProjectFilePath); 1473var project = await workspace.OpenProjectAsync(projectFilePath); 1661var project = sol.Projects.First(); 1842var project = solution.GetProjectsByName("VisualBasicProject").FirstOrDefault(); 1868var project = solution.GetProjectsByName("VisualBasicProject").FirstOrDefault(); 1902var project = sol.GetProjectsByName("VisualBasicProject").FirstOrDefault(); 1925var project = sol.GetProjectsByName("VisualBasicProject").FirstOrDefault(); 1949var project = sol.GetProjectsByName("CSharpProject").FirstOrDefault(); 1972var project = sol.GetProjectsByName("CSharpProject").FirstOrDefault(); 1997var project = solution.GetProjectsByName("CSharpProject").FirstOrDefault(); 2018var project = solution.GetProjectsByName("CSharpProject").FirstOrDefault(); 2025var project2 = solution2.GetProjectsByName("CSharpProject").FirstOrDefault(); 2044var projectB = workspaceB.CurrentSolution.GetProjectsByName("CSharpProject").FirstOrDefault(); 2059var project = solution.GetProjectsByName("CSharpProject").FirstOrDefault(); 2068var project2 = solution2.GetProjectsByName("CSharpProject").FirstOrDefault(); 2093var project = solution.GetProjectsByName("CSharpProject").FirstOrDefault(); 2101var project2 = solution2.GetProjectsByName("CSharpProject").FirstOrDefault(); 2174var project = solution.GetProjectsByName("CSharpProject").FirstOrDefault(); 2201var csProject = await workspace.OpenProjectAsync(csProjectFilePath); 2205var vbProject = await workspace.OpenProjectAsync(vbProjectFilePath); 2307var proj = await workspace.OpenProjectAsync(projectFullPath); 2332var proj = await workspace.OpenProjectAsync(projectFullPath); 2356var proj = await workspace.OpenProjectAsync(projectFullPath); 2374var project = await workspace.OpenProjectAsync(projectFullPath); 2394var proj = await workspace.OpenProjectAsync(projectFullPath); 2417var proj = await workspace.OpenProjectAsync(fullPath); 2434var proj = sol.Projects.First(); 2453foreach (var project in sol.Projects) 2473var project = await workspace.OpenProjectAsync(referencingProjectPath); 2526foreach (var project in sol.Projects) 2541var project = solution.Projects.First(); 2557var project = solution.Projects.First(); 2575var project = solution.Projects.First(p => p.Language == LanguageNames.VisualBasic); 2593var csproject = workspace.CurrentSolution.Projects.First(p => p.Language == LanguageNames.CSharp); 2601var vbproject = workspace.CurrentSolution.Projects.First(p => p.Language == LanguageNames.VisualBasic); 2670var project = solution.Projects.First(); 2734var testProject = solution.Projects.FirstOrDefault(p => p.Name == "ReferenceTest"); 2738var libraryProject = solution.Projects.FirstOrDefault(p => p.Name == "Library1"); 2760var testProject = solution.Projects.FirstOrDefault(p => p.Name == "ReferenceTest"); 2764var library1Project = solution.Projects.FirstOrDefault(p => p.Name == "Library1"); 2768var library2Project = solution.Projects.FirstOrDefault(p => p.Name == "Library2"); 2798var project = await workspace.OpenProjectAsync(projPath); 2817var project = await workspace.OpenProjectAsync(projPath); 2836var project = await workspace.OpenProjectAsync(projPath); 2884var project = await workspace.OpenProjectAsync(projPath); 2941var project = solution.Projects.First(); 2969var project = solution.Projects.First(p => p.Language == LanguageNames.VisualBasic); 2997var proj = await workspace.OpenProjectAsync(projectFilePath); 3011var proj = await workspace.OpenProjectAsync(projectFilePath); 3028var proj = await workspace.OpenProjectAsync(projectFilePath); 3050var project = Assert.Single(solution.Projects); 3063var proj = await workspace.OpenProjectAsync(projectFilePath); 3078var project = await workspace.OpenProjectAsync(projectFilePath); 3095var project = await workspace.OpenProjectAsync(projectFilePath); 3112var proj = await workspace.OpenProjectAsync(projectFilePath); 3179foreach (var project in solution.Projects) 3198var project = await workspace.OpenProjectAsync(projectFilePath); 3219var project = solution.Projects.Single(p => p.FilePath.EndsWith("CSharpProject_ProjectReference.csproj")); 3246var project = await workspace.OpenProjectAsync(projectFullPath); 3269var project = await workspace.OpenProjectAsync(projectFullPath); 3282var csharpProject = solution.Projects.Single(); 3313var project = await workspace.OpenProjectAsync(projPath); 3332var project = await workspace.OpenProjectAsync(GetSolutionFileName("Project.csproj")); 3345var project = await workspace.OpenProjectAsync(GetSolutionFileName(@"CSharpProject\CSharpProject.csproj")); 3358var project = await workspace.OpenProjectAsync(GetSolutionFileName(@"CSharpProject\CSharpProject.csproj"));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
Formatting\FormattingTestBase.cs (1)
43var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", language);
SolutionUtilities.cs (2)
99public static Tuple<Project, ProjectReference> GetSingleAddedProjectReference(Solution oldSolution, Solution newSolution) 105public static Project AddEmptyProject(Solution solution, string languageName = LanguageNames.CSharp, string name = "TestProject")
WorkspaceExtensions.cs (1)
54public static IEnumerable<Project> GetProjectsByName(this Solution solution, string name)
Workspaces\TestWorkspace`1.cs (1)
571public override bool CanApplyParseOptionChange(ParseOptions oldOptions, ParseOptions newOptions, Project project)
Microsoft.CodeAnalysis.Workspaces.UnitTests (225)
CodeCleanup\AddMissingTokensTests.cs (1)
2730var project = solution.AddProject(projectId, "Project", "Project.dll", language).GetProject(projectId);
CodeCleanup\CodeCleanupTests.cs (1)
418var project = solution.AddProject(projectId, "Project", "Project.dll", language).GetProject(projectId);
CodeCleanup\FixIncorrectTokenTests.cs (1)
755var project = solution.AddProject(projectId, "Project", "Project.dll", language).GetProject(projectId);
CodeCleanup\NormalizeModifiersOrOperatorsTests.cs (1)
1031var project = solution.AddProject(projectId, "Project", "Project.dll", language).GetProject(projectId);
CodeCleanup\ReduceTokenTests.cs (1)
2018var project = solution.AddProject(projectId, "Project", "Project.dll", language).GetProject(projectId);
CommandLineProject\CommandLineProjectWorkspaceTests.cs (2)
30var project = ws.CurrentSolution.GetProject(info.Id); 58var project = ws.CurrentSolution.GetProject(info.Id);
FindAllDeclarationsTests.cs (20)
94using var workspace = CreateWorkspaceWithProject(workspaceKind, out var project); 113using var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project); 123var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project, testHost); 260using var workspace = CreateWorkspaceWithProject(workspaceKind, out var project); 270var declarations = await SymbolFinder.FindSourceDeclarationsAsync((Project)null, "Test", true); 279using var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project); 289using var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project); 416using var workspace = CreateWorkspaceWithProject(workspaceKind, out var project); 424using var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project); 432using var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project); 442var declarations = await SymbolFinder.FindSourceDeclarationsAsync((Project)null, str => str.Contains("Test")); 451using var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project); 461using var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project); 550using var workspace = CreateWorkspaceWithProject(workspaceKind, out var project); 563using var workspace = CreateWorkspaceWithProject(workspaceKind, out var project); 573var declarations = await SymbolFinder.FindSourceDeclarationsWithPatternAsync((Project)null, "test"); 582using var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project); 592using var workspace = CreateWorkspaceWithProject(SolutionKind.SingleClass, out var project); 667var project = solution.Projects.First(); 704var project = solution.Projects.Single();
FindAllDeclarationsTests.TestSolutionsAndProject.cs (1)
138private Workspace CreateWorkspaceWithProject(SolutionKind solutionKind, out Project project, TestHost testHost = TestHost.OutOfProcess)
FindReferencesTests.cs (13)
103var project = solution.Projects.First(); 128var project = solution.Projects.First(); 177var prj = sln.GetProject(prj1Id).WithCompilationOptions(new VisualBasic.VisualBasicCompilationOptions(OutputKind.ConsoleApplication, embedVbCoreRuntime: true)); 216var prj = sln.GetProject(prj1Id).WithCompilationOptions(new VisualBasic.VisualBasicCompilationOptions(OutputKind.ConsoleApplication, embedVbCoreRuntime: true)); 280var prj = sln.GetProject(prj1Id).WithCompilationOptions(new CSharp.CSharpCompilationOptions(OutputKind.ConsoleApplication)); 323var project = solution.Projects.First(); 388var netCoreProject = solution.Projects.First(p => p.Name == "NetCoreProject"); 389var netStandardProject = solution.Projects.First(p => p.Name == "NetStandardProject"); 435var project = solution.Projects.Single(); 513var project = solution.Projects.First(); 540var project = solution.Projects.First(); 573var project = solution.Projects.First(); 615var project = solution.Projects.First();
Formatter\FormatterTests.cs (4)
51var project = workspace.AddProject("Dummy", NoCompilationConstants.LanguageName); 69var project = workspace.AddProject("Dummy", NoCompilationConstants.LanguageName); 113var csProject = workspace.AddProject("CS", LanguageNames.CSharp); 114var vbProject = workspace.AddProject("VB", LanguageNames.VisualBasic);
GeneratedCodeRecognitionTests.cs (5)
57var project = CreateProject(); 59var projectWithUserConfiguredGeneratedCodeTrue = project.AddAnalyzerConfigDocument(".editorconfig", 65var projectWithUserConfiguredGeneratedCodeFalse = project.AddAnalyzerConfigDocument(".editorconfig", 83static void TestCore(string fileName, Project project, bool assertGenerated) 97private static Project CreateProject()
SemanticModelReuse\SemanticModelReuseTests.cs (1)
27var project = solution.AddProject(projectId, "Project", "Project.dll", language).GetProject(projectId);
Simplifier\SimplifierTests.cs (3)
28var project = workspace.AddProject("CSharpTest", LanguageNames.CSharp); 76var csProject = workspace.AddProject("CS", LanguageNames.CSharp); 77var vbProject = workspace.AddProject("VB", LanguageNames.VisualBasic);
SolutionTests\ProjectDependencyGraphTests.cs (11)
503var a = solution.GetProjectsByName("A").Single(); 504var b = solution.GetProjectsByName("B").Single(); 505var d = solution.GetProjectsByName("D").Single(); 531var a = solution.GetProjectsByName("A").Single(); 532var b = solution.GetProjectsByName("B").Single(); 533var e = solution.GetProjectsByName("E").Single(); 560var a = solution.GetProjectsByName("A").Single(); 561var b = solution.GetProjectsByName("B").Single(); 562var c = solution.GetProjectsByName("C").Single(); 613var b = solution.GetProjectsByName("B").Single(); 614var c = solution.GetProjectsByName("C").Single();
SolutionTests\ProjectSemanticVersionTests.cs (6)
22var project = AddEmptyProject(workspace.CurrentSolution); 31var project = AddEmptyProject(workspace.CurrentSolution) 261private static async Task AssertSemanticVersionChangedAsync(Project project1, Project project2) 266private static async Task AssertSemanticVersionUnchangedAsync(Project project1, Project project2)
SolutionTests\SolutionTests.cs (72)
334var project = solution.GetProject(projectId)!; 2315var project2 = solution.Projects.Single(); 2532var project = solution.GetProject(pid); 2544var project = solution.GetProject(project1); 2573var project = solution.GetProject(pid); 2593var project2 = solution.GetProject(pid2); 2617var project = Assert.Single(solution.Projects); 2642var project1 = solution.GetProject(projectId1); 2643var project2 = solution.GetProject(projectId2); 2695var finalProject = solution.Projects.Single(); 2837foreach (var project in solution.Projects) 3064var project = sol.GetProject(pid); 3481var proj = sol.GetProject(pid); 3979var project3 = solution.GetProject(pid3); 3982var projectForBaseType = solution.GetProject(classC.BaseType.ContainingAssembly); 3998var proj = ws.AddProject("proj", LanguageNames.CSharp); 4015var project = workspace.AddProject("CSharpProject", LanguageNames.CSharp); 4024var project1 = workspace.AddProject( 4036var project2 = workspace.AddProject( 4056var project1 = workspace.AddProject( 4066var project2 = workspace.AddProject( 4085var project = workspace.CurrentSolution.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp); 4110var project = workspace.CurrentSolution.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp); 4138var project = workspace.CurrentSolution.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp); 4183var project = workspace.CurrentSolution.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp); 4229var project1 = workspace.AddProject( 4242var project2 = workspace.AddProject( 4265var project = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 4283var project = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 4299var originalProject = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 4304var forkedProject = originalProject.RemoveDocument(originalProject.DocumentIds.Single()) 4323var originalProject = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 4328var forkedProject = originalProject.RemoveDocument(originalProject.DocumentIds.Single()) 4483GetMultipleProjects(out var csBrokenProject, out var vbNormalProject, out var dependsOnBrokenProject, out var dependsOnVbNormalProject, out var transitivelyDependsOnBrokenProjects, out var transitivelyDependsOnNormalProjects); 4564var dummyProject = solution.AddProject("dummy", "dummy", LanguageNames.CSharp); 4707var project = solution.GetProject(projectId); 4741var project = solution.GetProject(projectId); 4782var project = solution.GetProject(projectId); 5329out Project csBrokenProject, 5330out Project vbNormalProject, 5331out Project dependsOnBrokenProject, 5332out Project dependsOnVbNormalProject, 5333out Project transitivelyDependsOnBrokenProjects, 5334out Project transitivelyDependsOnNormalProjects) 5610var project = workspace.CurrentSolution.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp); 5616var frozenProject = frozenSolution.Projects.Single(); 5627var project = workspace.CurrentSolution.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp); 5635var frozenProject = frozenSolution.Projects.Single(); 5647var project1 = workspace.CurrentSolution.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp); 5648var project2 = project1.Solution.AddProject("CSharpProject2", "CSharpProject2", LanguageNames.CSharp); 5657var frozenProject1 = frozenSolution.GetProject(project1.Id); 5660var frozenProject2 = frozenSolution.GetProject(project2.Id); 5675var project1 = workspace.CurrentSolution.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp); 5676var project2 = project1.Solution.AddProject("CSharpProject2", "CSharpProject2", LanguageNames.CSharp); 5687var frozenProject1 = frozenSolution.GetProject(project1.Id); 5694var frozenProject2 = frozenSolution.GetProject(project2.Id); 5705var project1 = workspace.CurrentSolution.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp); 5706var project2 = project1.Solution.AddProject("CSharpProject2", "CSharpProject2", LanguageNames.CSharp); 5717var frozenProject1 = frozenSolution.GetProject(project1.Id); 5724var frozenProject2 = frozenSolution.GetProject(project2.Id); 5738var project1 = workspace.CurrentSolution.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp); 5748var forkedProject1 = frozenSolution.WithDocumentText(project1.Documents.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id); 5763var project1 = workspace.CurrentSolution 5815var project = workspace.CurrentSolution.AddProject("TypeScript", "TypeScript", "TypeScript"); 5820var frozenProject = frozenSolution.Projects.Single(); 5836var project1 = workspace.CurrentSolution 5846var project2 = project1.Solution
SolutionTests\SolutionWithSourceGeneratorTests.cs (51)
48var project = AddEmptyProject(workspace.CurrentSolution) 89var project = AddEmptyProject(workspace.CurrentSolution) 137var project = AddEmptyProject(workspace.CurrentSolution) 181var project = AddEmptyProject(workspace.CurrentSolution) 253var project = AddEmptyProject(workspace.CurrentSolution) 266static async Task AssertCompilationContainsOneRegularAndOneGeneratedFile(Project project, DocumentId documentId, string expectedGeneratedContents) 293var project = AddEmptyProject(workspace.CurrentSolution) 319static async Task AssertCompilationContainsGeneratedFilesAsync(Project project, params string[] expectedGeneratedContents) 337var project = AddEmptyProject(workspace.CurrentSolution) 346var partialProject = project.Documents.Single().WithFrozenPartialSemantics(forceFreeze, CancellationToken.None).Project; 365var projectBeforeChange = AddEmptyProject(workspace.CurrentSolution) 371var projectAfterChange = 404var project = AddEmptyProject(solution); 443var project = AddEmptyProject(workspace.CurrentSolution) 457var project = AddEmptyProject(workspace.CurrentSolution) 480var project = AddEmptyProject(workspace.CurrentSolution) 500var project = AddEmptyProject(workspace.CurrentSolution) 527var project = AddEmptyProject(workspace.CurrentSolution) 562static async Task<Project> MakeChangesToDocument(Project project) 575var project = AddEmptyProject(workspace.CurrentSolution); 588var project = AddEmptyProject(workspace.CurrentSolution) 612var project = AddEmptyProject(workspace.CurrentSolution) 690var project = AddEmptyProject(workspace.CurrentSolution) 718var project = AddEmptyProject(workspace.CurrentSolution) 749var project = AddEmptyProject(workspace.CurrentSolution) 778var project = AddEmptyProject(workspace.CurrentSolution) 846var project = AddEmptyProject(workspace.CurrentSolution); 870var project = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference); 884static async Task AssertFrozen(Project project, SourceGeneratedDocumentIdentity identity) 905var project2 = AddEmptyProject(solution, name: "TestProject2").AddAnalyzerReference(analyzerReference); 928var project = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference); 948var project0 = AddEmptyProject(workspace.CurrentSolution); 951var project1 = project0.AddAnalyzerReference(analyzerReference1); 957var project2 = project1.RemoveAnalyzerReference(analyzerReference1); 967var project3 = project2.AddAnalyzerReference(analyzerReference2); 984var project = AddEmptyProject(workspace.CurrentSolution) 1016var project = AddEmptyProject(workspace.CurrentSolution) 1046var project = AddEmptyProject(workspace.CurrentSolution) 1074var project = AddEmptyProject(workspace.CurrentSolution) 1101var project = AddEmptyProject(workspace.CurrentSolution) 1129var project = AddEmptyProject(workspace.CurrentSolution) 1162var project = AddEmptyProject(workspace.CurrentSolution) 1217var project = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference); 1232static async Task<SourceGeneratedDocument> FreezeAndGetDocument(Project project, SourceGeneratedDocumentIdentity identity) 1252var project = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference); 1269static async Task<SourceGeneratedDocument> FreezeAndGetDocument(Project project, SourceGeneratedDocumentIdentity identity) 1289var project = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference); 1300static async Task<Solution> FreezeDocumentAndGetSolution(Project project, SourceGeneratedDocumentIdentity identity) 1320var project = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference); 1335static async Task<Solution> FreezeDocumentAndGetSolution(Project project, SourceGeneratedDocumentIdentity identity)
SolutionTests\SourceGeneratorTelemetryCollectorWorkspaceServiceTests.cs (1)
31var project = AddEmptyProject(workspace.CurrentSolution)
SolutionTests\TryApplyChangesTests.cs (9)
47public override bool CanApplyParseOptionChange(ParseOptions oldOptions, ParseOptions newOptions, Project project) 57public override bool CanApplyCompilationOptionChange(CompilationOptions oldOptions, CompilationOptions newOptions, Project project) 77var project = workspace.CurrentSolution.Projects.Single(); 90var project = workspace.CurrentSolution.Projects.Single(); 103var project = workspace.CurrentSolution.Projects.Single(); 120var project = workspace.CurrentSolution.Projects.Single(); 135var project = workspace.CurrentSolution.Projects.Single(); 150var project = workspace.CurrentSolution.Projects.Single(); 164var project = workspace.CurrentSolution.Projects.Single();
SymbolKeyTests.cs (2)
864var project = workspace.AddProject("Test", LanguageNames.CSharp); 911var project = workspace.AddProject("Test", LanguageNames.CSharp);
WorkspaceTests\AdhocWorkspaceTests.cs (9)
36var project = ws.AddProject(info); 48var project = ws.AddProject("TestProject", LanguageNames.CSharp); 58var project = ws.AddProject("TestProject", LanguageNames.CSharp); 70var project = ws.AddProject("TestProject", LanguageNames.CSharp); 98var project = solution.Projects.FirstOrDefault(); 131var project1 = solution.GetProject(id1); 137var project2 = solution.GetProject(id2); 173var proj = ws.CurrentSolution.Projects.First(); 382var proj = pws.CurrentSolution.GetProject(projid);
WorkspaceTests\WorkspaceReferenceTests.cs (8)
28var project = ws.AddProject(projectInfo); 57var referenceProject = ws.AddProject(referenceInfo); 68var project = ws.AddProject(projectInfo); 97var referenceProject = ws.AddProject(referenceInfo); 108var project = ws.AddProject(projectInfo); 137var referenceProject = ws.AddProject(referenceInfo); 148var project = ws.AddProject(projectInfo); 181var project = ws.AddProject(projectInfo);
WorkspaceTests\WorkspaceTests.cs (2)
127public Project AddProject(string name, string language) 133public Project AddProject(ProjectInfo projectInfo)
Microsoft.Gen.ComplianceReports.Unit.Tests (14)
test\Generators\Shared\RoslynTestUtils.cs (14)
41public static Project CreateTestProject(IEnumerable<Assembly>? references, bool includeBaseReferences = true) 52public static Project CreateTestProject( 88public static void CommitChanges(this Project proj) 93public static Project WithDocument(this Project proj, string name, string text) 98public static Document FindDocument(this Project proj, string name) 267var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences); 310var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences, langVersion); 361var proj = CreateTestProject(references, includeBaseReferences); 397var proj = CreateTestProject(references); 443var proj = CreateTestProject(references); 498var changedProj = solution.GetProject(proj.Id); 534private static async Task<Project> RecreateProjectDocumentsAsync(Project project)
Microsoft.Gen.ContextualOptions.Unit.Tests (14)
test\Generators\Shared\RoslynTestUtils.cs (14)
41public static Project CreateTestProject(IEnumerable<Assembly>? references, bool includeBaseReferences = true) 52public static Project CreateTestProject( 88public static void CommitChanges(this Project proj) 93public static Project WithDocument(this Project proj, string name, string text) 98public static Document FindDocument(this Project proj, string name) 267var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences); 310var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences, langVersion); 361var proj = CreateTestProject(references, includeBaseReferences); 397var proj = CreateTestProject(references); 443var proj = CreateTestProject(references); 498var changedProj = solution.GetProject(proj.Id); 534private static async Task<Project> RecreateProjectDocumentsAsync(Project project)
Microsoft.Gen.Logging.Unit.Tests (14)
test\Generators\Shared\RoslynTestUtils.cs (14)
41public static Project CreateTestProject(IEnumerable<Assembly>? references, bool includeBaseReferences = true) 52public static Project CreateTestProject( 88public static void CommitChanges(this Project proj) 93public static Project WithDocument(this Project proj, string name, string text) 98public static Document FindDocument(this Project proj, string name) 267var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences); 310var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences, langVersion); 361var proj = CreateTestProject(references, includeBaseReferences); 397var proj = CreateTestProject(references); 443var proj = CreateTestProject(references); 498var changedProj = solution.GetProject(proj.Id); 534private static async Task<Project> RecreateProjectDocumentsAsync(Project project)
Microsoft.Gen.MetadataExtractor.Unit.Tests (14)
test\Generators\Shared\RoslynTestUtils.cs (14)
41public static Project CreateTestProject(IEnumerable<Assembly>? references, bool includeBaseReferences = true) 52public static Project CreateTestProject( 88public static void CommitChanges(this Project proj) 93public static Project WithDocument(this Project proj, string name, string text) 98public static Document FindDocument(this Project proj, string name) 267var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences); 310var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences, langVersion); 361var proj = CreateTestProject(references, includeBaseReferences); 397var proj = CreateTestProject(references); 443var proj = CreateTestProject(references); 498var changedProj = solution.GetProject(proj.Id); 534private static async Task<Project> RecreateProjectDocumentsAsync(Project project)
Microsoft.Gen.Metrics.Unit.Tests (14)
test\Generators\Shared\RoslynTestUtils.cs (14)
41public static Project CreateTestProject(IEnumerable<Assembly>? references, bool includeBaseReferences = true) 52public static Project CreateTestProject( 88public static void CommitChanges(this Project proj) 93public static Project WithDocument(this Project proj, string name, string text) 98public static Document FindDocument(this Project proj, string name) 267var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences); 310var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences, langVersion); 361var proj = CreateTestProject(references, includeBaseReferences); 397var proj = CreateTestProject(references); 443var proj = CreateTestProject(references); 498var changedProj = solution.GetProject(proj.Id); 534private static async Task<Project> RecreateProjectDocumentsAsync(Project project)
Microsoft.Gen.MetricsReports.Unit.Tests (14)
test\Generators\Shared\RoslynTestUtils.cs (14)
41public static Project CreateTestProject(IEnumerable<Assembly>? references, bool includeBaseReferences = true) 52public static Project CreateTestProject( 88public static void CommitChanges(this Project proj) 93public static Project WithDocument(this Project proj, string name, string text) 98public static Document FindDocument(this Project proj, string name) 267var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences); 310var proj = CreateTestProject(references, preprocessorSymbols, includeBaseReferences, langVersion); 361var proj = CreateTestProject(references, includeBaseReferences); 397var proj = CreateTestProject(references); 443var proj = CreateTestProject(references); 498var changedProj = solution.GetProject(proj.Id); 534private static async Task<Project> RecreateProjectDocumentsAsync(Project project)
Microsoft.Interop.ComInterfaceGenerator (9)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (3)
183HashSet<Project> projectsToAddUnsafe = new(); 216foreach (var project in projectsToAddUnsafe) 227private static Solution AddUnsafe(Solution solution, Project project)
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (6)
39IEnumerable<Project?> sortedProjects = dependencyGraph.GetTopologicallySortedProjects(context.CancellationToken) 48public static async Task<ImmutableArray<Project>> GetProjectsWithDiagnosticsAsync(this FixAllContext context) 58ImmutableArray<Project>.Builder projectsWithDiagnostics = ImmutableArray.CreateBuilder<Project>(); 59foreach (var project in context.Solution.Projects) 69return ImmutableArray<Project>.Empty;
Microsoft.Interop.LibraryImportGenerator (10)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
52private static async Task<Solution> AddDisableRuntimeMarshallingAttributeApplicationToProject(Project project, CancellationToken cancellationToken)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (3)
183HashSet<Project> projectsToAddUnsafe = new(); 216foreach (var project in projectsToAddUnsafe) 227private static Solution AddUnsafe(Solution solution, Project project)
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (6)
39IEnumerable<Project?> sortedProjects = dependencyGraph.GetTopologicallySortedProjects(context.CancellationToken) 48public static async Task<ImmutableArray<Project>> GetProjectsWithDiagnosticsAsync(this FixAllContext context) 58ImmutableArray<Project>.Builder projectsWithDiagnostics = ImmutableArray.CreateBuilder<Project>(); 59foreach (var project in context.Solution.Projects) 69return ImmutableArray<Project>.Empty;
Microsoft.ML.CodeAnalyzer.Tests (1)
Code\BestFriendTest.cs (1)
66var projectA = solution.AddProject("ProjectA", "ProjectA", LanguageNames.CSharp);
Microsoft.VisualStudio.LanguageServices (167)
CallHierarchy\CallHierarchyItem.cs (1)
38Project project)
CallHierarchy\CallHierarchyProvider.cs (2)
55ISymbol symbol, Project project, ImmutableArray<Location> callsites, CancellationToken cancellationToken) 100public async Task<ImmutableArray<AbstractCallFinder>> CreateFindersAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
CallHierarchy\Finders\AbstractCallFinder.cs (6)
94var project = workspace.CurrentSolution.GetProject(_projectId); 116private static IImmutableSet<Document> IncludeDocuments(CallHierarchySearchScope scope, Project project) 126var currentProject = project.Solution.GetProject(activeDocument.ProjectId); 148protected virtual async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 165var callingProject = project.Solution.GetProject(caller.CallingSymbol.ContainingAssembly, cancellationToken); 180protected abstract Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken);
CallHierarchy\Finders\BaseMemberFinder.cs (1)
27protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\CallToOverrideFinder.cs (1)
23protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\FieldReferenceFinder.cs (1)
30protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\ImplementerFinder.cs (2)
33protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 36protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\InterfaceImplementationCallFinder.cs (1)
30protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\MethodCallFinder.cs (1)
33protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\OverridingMemberFinder.cs (2)
29protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 32protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CodeCleanup\AbstractCodeCleanUpFixer.cs (1)
195ImmutableArray<Project> projects,
CodeLens\CodeLensCallbackListener.cs (1)
65foreach (var project in solution.Projects)
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (1)
220private Project? GetProject(Solution solution, IVsHierarchy? hierarchy)
EditorConfigSettings\DataProvider\CodeStyle\CommonCodeStyleSettingsProvider.cs (1)
24protected override void UpdateOptions(TieredAnalyzerConfigOptions options, ImmutableArray<Project> projectsInScope)
EditorConfigSettings\DataProvider\Whitespace\CommonWhitespaceSettingsProvider.cs (1)
24protected override void UpdateOptions(TieredAnalyzerConfigOptions options, ImmutableArray<Project> projectsInScope)
GenerateType\GenerateTypeDialogViewModel.cs (6)
406private Project _selectedProject; 407public Project SelectedProject 416var previousProject = _selectedProject; 495private Project _previouslyPopulatedProject = null; 795public Project Project { get; } 797public ProjectSelectItem(Project project)
Implementation\AbstractEditorFactory.cs (7)
49protected abstract Project GetProjectWithCorrectParseOptionsForProject(Project project, IVsHierarchy hierarchy); 293Project? projectToAddTo = null; 376private static Project AddEditorConfigFiles(Project projectToAddTo, string projectFolder) 391static Project AddEditorConfigFile(Project project, string folder, out bool foundRoot)
Implementation\HierarchyItemToProjectIdMap.cs (2)
67var matchingProject = candidateProjects.FirstOrDefault(p => _workspace.TryGetDependencyNodeTargetIdentifier(p.Id) == targetFrameworkMoniker); 80foreach (var candidateProject in candidateProjects)
Implementation\IHierarchyItemToProjectIdMap.cs (1)
19/// returns the <see cref="ProjectId"/> of the equivalent Roslyn <see cref="Project"/>.
Interactive\VsResetInteractive.cs (2)
112var projectOpt = GetProjectFromHierarchy(hierarchy); 164internal Project GetProjectFromHierarchy(IVsHierarchy hierarchy)
LanguageServer\Handler\Diagnostics\VisualStudioDiagnosticProjectInformationService.cs (1)
19public VSDiagnosticProjectInformation GetDiagnosticProjectInformation(Project project)
LanguageService\AbstractCreateServicesOnTextViewConnection.cs (2)
38protected virtual Task InitializeServiceForProjectWithOpenedDocumentAsync(Project project) 86else if (Workspace.CurrentSolution.GetProject(projectId) is Project project)
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (2)
24private readonly Project _project; 33Project project)
Library\ObjectBrowser\AbstractListItemFactory.cs (3)
474var project = solution.GetProject(projectId); 507public async Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Project project, bool lookInReferences, CancellationToken cancellationToken) 599var project = solution.GetProject(projectId);
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (8)
64Project project); 184internal Project GetProject(ProjectId projectId) 187internal Project GetProject(ObjectListItem listItem) 201var project = GetProject(projectId); 413var project = GetProject(symbolListItem); 481var project = this.Workspace.CurrentSolution.GetProject(symbolListItem.ProjectId); 507IStreamingFindUsagesPresenter presenter, SymbolListItem symbolListItem, Project project, OptionsProvider<ClassificationOptions> classificationOptions) 537Project project,
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_Description.cs (1)
19var project = GetProject(listItem);
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_ListItems.cs (1)
26internal Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Project project, bool lookInReferences, CancellationToken cancellationToken)
Library\ObjectBrowser\Extensions.cs (5)
55public static string GetProjectDisplayName(this Project project) 81static bool IsUnambiguousProjectNameInSolution(Project project) 83foreach (var other in project.Solution.Projects) 100public static bool IsVenus(this Project project) 122public static string GetProjectNavInfoName(this Project project)
Library\ObjectBrowser\Lists\ProjectListItem.cs (2)
15public ProjectListItem(Project project) 21private static StandardGlyphGroup GetProjectGlyph(Project project)
Library\ObjectBrowser\ObjectList.cs (5)
494var project = this.LibraryManager.GetProject(listItem.ProjectId); 558var project = this.LibraryManager.GetProject(projectListItem.ProjectId); 681var project = this.LibraryManager.Workspace.CurrentSolution.GetProject(symbolListItem.ProjectId); 751var project = this.LibraryManager.Workspace.CurrentSolution.GetProject(symbolItem.ProjectId); 909var project = this.LibraryManager.Workspace.CurrentSolution.GetProject(projectListItem.ProjectId);
Library\ObjectBrowser\ObjectListItem.cs (1)
75var project = workspace.CurrentSolution.GetProject(ProjectId);
Library\VsNavInfo\NavInfoFactory.cs (7)
21public IVsNavInfo CreateForProject(Project project) 34public IVsNavInfo CreateForSymbol(ISymbol symbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 63public IVsNavInfo CreateForNamespace(INamespaceSymbol namespaceSymbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 73public IVsNavInfo CreateForType(ITypeSymbol typeSymbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 114public IVsNavInfo CreateForMember(ISymbol memberSymbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 128private IVsNavInfo Create(IAssemblySymbol containingAssembly, Project project, Compilation compilation, bool useExpandedHierarchy = false, 174private static string GetLibraryName(Project project)
Packaging\PackageInstallerServiceFactory.cs (4)
547var project = solution.GetProject(projectId); 657public ImmutableArray<Project> GetProjectsWithInstalledPackage(Solution solution, string packageName, string version) 661using var _ = ArrayBuilder<Project>.GetInstance(out var result); 668var project = solution.GetProject(projectId);
Progression\GraphBuilder.cs (8)
36private readonly Dictionary<GraphNode, Project> _nodeToContextProjectMap = []; 84Project? project = null; 123var project = _solution.GetProject(projectId); 151public Project GetContextProject(GraphNode node, CancellationToken cancellationToken) 155_nodeToContextProjectMap.TryGetValue(node, out var project); 160public ProjectId GetContextProjectId(Project project, ISymbol symbol) 162var thisProject = project.Solution.GetProject(symbol.ContainingAssembly) ?? project; 196ISymbol symbol, Project contextProject, Document contextDocument, CancellationToken cancellationToken)
Progression\GraphNodeIdCreation.cs (2)
405var foundProject = solution.GetProject(containingAssembly, cancellationToken); 423foreach (var project in solution.Projects)
Progression\GraphQueries\SearchGraphQuery.cs (1)
46public INavigateToSearchService? GetNavigateToSearchService(Project project)
ProjectSystem\VisualStudioProjectManagementService.cs (1)
29public string GetDefaultNamespace(Microsoft.CodeAnalysis.Project project, Workspace workspace)
ProjectSystem\VisualStudioWorkspace.cs (3)
64public abstract bool TryGoToDefinition(ISymbol symbol, Project project, CancellationToken cancellationToken); 65public abstract Task<bool> TryGoToDefinitionAsync(ISymbol symbol, Project project, CancellationToken cancellationToken); 67public abstract bool TryFindAllReferences(ISymbol symbol, Project project, CancellationToken cancellationToken);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (4)
31var fromProject = currentSolution.GetProject(FromProjectId); 35var updatedProject = AddDocument(fromProject); 40protected abstract Project AddDocument(Project fromProject);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (3)
26protected abstract IReadOnlyList<DocumentId> GetDocumentIds(Project fromProject); 33var fromProject = currentSolution.GetProject(FromProjectId); 38var updatedProject = fromProject.RemoveDocument(DocumentId);
ProjectSystem\VisualStudioWorkspaceImpl.AddAdditionalDocumentUndoUnit.cs (2)
23protected override Project AddDocument(Project fromProject)
ProjectSystem\VisualStudioWorkspaceImpl.AddAnalyzerConfigDocumentUndoUnit.cs (2)
22protected override Project AddDocument(Project fromProject)
ProjectSystem\VisualStudioWorkspaceImpl.AddDocumentUndoUnit.cs (2)
22protected override Project AddDocument(Project fromProject)
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (2)
32var fromProject = currentSolution.GetProject(FromProjectId); 50var updatedProject = fromProject.AddMetadataReference(reference);
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (4)
29var fromProject = currentSolution.GetProject(FromProjectId); 30var toProject = currentSolution.GetProject(_toProjectId); 36var updatedProject = fromProject.AddProjectReference(new ProjectReference(_toProjectId)); 44var toProject = currentSolution.GetProject(_toProjectId);
ProjectSystem\VisualStudioWorkspaceImpl.cs (4)
364internal bool IsCPSProject(CodeAnalysis.Project project) 396public override bool CanApplyCompilationOptionChange(CompilationOptions oldOptions, CompilationOptions newOptions, CodeAnalysis.Project project) 399public override bool CanApplyParseOptionChange(ParseOptions oldOptions, ParseOptions newOptions, CodeAnalysis.Project project) 1544internal void RemoveProjectFromMaps(CodeAnalysis.Project project)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveAdditionalDocumentUndoUnit.cs (1)
21protected override IReadOnlyList<DocumentId> GetDocumentIds(Project fromProject)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveAnalyzerConfigDocumentUndoUnit.cs (1)
21protected override IReadOnlyList<DocumentId> GetDocumentIds(Project fromProject)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveDocumentUndoUnit.cs (1)
21protected override IReadOnlyList<DocumentId> GetDocumentIds(Project fromProject)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (2)
31var fromProject = currentSolution.GetProject(FromProjectId); 39var updatedProject = fromProject.RemoveMetadataReference(reference);
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (4)
29var fromProject = currentSolution.GetProject(FromProjectId); 30var toProject = currentSolution.GetProject(_toProjectId); 36var updatedProject = fromProject.RemoveProjectReference(new ProjectReference(_toProjectId)); 44var toProject = currentSolution.GetProject(_toProjectId);
PullMemberUp\SymbolDependentsBuilder.cs (3)
22Project project, 37private readonly Project _project; 45Project project,
Snippets\SnippetExpansionClient.cs (1)
1076private static void AddReferences(Project originalProject, XElement snippetNode)
SyncNamespaces\SyncNamespacesCommandHandler.cs (2)
114private ImmutableArray<Project> GetProjectsForHierarchy(Shell.Interop.IVsHierarchy projectHierarchy) 124private void SyncNamespaces(ImmutableArray<Project> projects)
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (5)
195Dictionary<string, Project>? projectNameToProjectMap = null; 196Dictionary<Project, ImmutableDictionary<string, Document>>? filePathToDocumentMap = null; 224foreach (var p in _workspace.CurrentSolution.Projects) 231if (!projectNameToProjectMap.TryGetValue(projectName, out var project)) 300private static async Task<ImmutableDictionary<string, Document>> GetFilePathToDocumentMapAsync(Project project, CancellationToken cancellationToken)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (16)
128private static Func<Project, bool> GetShouldFixInProjectDelegate(IVsHierarchyItemManager vsHierarchyItemManager, IHierarchyItemToProjectIdMap projectMap, IVsHierarchy? projectHierarchy) 174Func<Project, bool> shouldFixInProject, 185private bool ApplySuppressionFix(IEnumerable<DiagnosticData>? diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, bool isAddSuppression, bool isSuppressionInSource, bool onlyCompilerDiagnostics, bool showPreviewChangesDialog) 193Func<Project, bool> shouldFixInProject, 231? ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty 425private static ImmutableDictionary<Project, ImmutableArray<Diagnostic>> GetProjectDiagnosticsMappedToNewSolution(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectDiagnosticsToFixMap, Solution newSolution, string language) 427ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Builder? projectDiagsBuilder = null; 433var project = newSolution.GetProject(oldProject.Id); 436projectDiagsBuilder ??= ImmutableDictionary.CreateBuilder<Project, ImmutableArray<Diagnostic>>(); 441return projectDiagsBuilder != null ? projectDiagsBuilder.ToImmutable() : ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty; 450private async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken) 542private async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken) 549return ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty; 551var finalBuilder = ImmutableDictionary.CreateBuilder<Project, ImmutableArray<Diagnostic>>();
TaskList\ExternalErrorDiagnosticUpdateSource.cs (2)
222private static RpcContracts.Utilities.ProjectIdentifier? GetProjectIdentifier(Project? project, Guid projectHierarchyGuid) 362var project = Solution.GetProject(projectId);
TaskList\ProjectExternalErrorReporter.cs (1)
86var project = _workspace.CurrentSolution.GetProject(_projectId);
UnusedReferences\Dialog\UnusedReferencesTableProvider.DataSource.cs (1)
36var project = solution.Projects.First(project => projectFilePath.Equals(project.FilePath, StringComparison.OrdinalIgnoreCase));
Workspace\SourceGeneratedFileManager.cs (3)
335var project = this.Workspace.CurrentSolution.GetProject(_documentIdentity.DocumentId.ProjectId); 438var oldProject = e.OldSolution.GetProject(projectId); 439var newProject = e.NewSolution.GetProject(projectId);
Workspace\VisualStudioSymbolNavigationService.cs (3)
51ISymbol symbol, Project project, CancellationToken cancellationToken) 128Project project, ISymbol symbol, CancellationToken cancellationToken) 184public async Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.CSharp (7)
EditorConfigSettings\DataProvider\CodeStyle\CSharpCodeStyleSettingsProvider.cs (1)
28protected override void UpdateOptions(TieredAnalyzerConfigOptions options, ImmutableArray<Project> projectsInScope)
EditorConfigSettings\DataProvider\Whitespace\CSharpWhitespaceSettingsProvider.cs (1)
28protected override void UpdateOptions(TieredAnalyzerConfigOptions options, ImmutableArray<Project> projectsInScope)
LanguageService\CSharpCreateServicesOnTextViewConnection.cs (1)
40protected override async Task InitializeServiceForProjectWithOpenedDocumentAsync(Project project)
LanguageService\CSharpEditorFactory.cs (2)
24protected override Project GetProjectWithCorrectParseOptionsForProject(Project project, IVsHierarchy hierarchy)
ObjectBrowser\DescriptionBuilder.cs (1)
22Project project) : AbstractDescriptionBuilder(description, libraryManager, listItem, project)
ObjectBrowser\ObjectBrowserLibraryManager.cs (1)
24Project project)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (8)
CodeModel\AbstractFileCodeElementTests.cs (1)
53protected Microsoft.CodeAnalysis.Project GetCurrentProject()
CodeModel\FileCodeModelTestHelpers.cs (1)
35var project = workspace.CurrentSolution.Projects.Single();
Interactive\Commands\ResetInteractiveTests.cs (3)
51var project = workspace.CurrentSolution.Projects.FirstOrDefault(p => p.AssemblyName == "ResetInteractiveTestsAssembly"); 68Project project, 140private static IEnumerable<string> GetProjectReferences(TestWorkspace workspace, Project project)
PersistentStorage\AbstractPersistentStorageTests.cs (3)
118var project = solution.Projects.First(); 220var project = solution.Projects.Single(); 990var project = solution.Projects.Single();
Microsoft.VisualStudio.LanguageServices.LiveShare (2)
Client\RemoteLanguageServiceWorkspace.cs (1)
317var project = CurrentSolution.Projects.FirstOrDefault(p => p.Name == projectName && p.Language == language);
ProjectsHandler.cs (1)
27foreach (var project in solution.Projects)
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (7)
CodeModel\Mocks\MockVisualStudioWorkspace.vb (3)
68Public Overrides Function TryGoToDefinition(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean 72Public Overrides Function TryGoToDefinitionAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of Boolean) 76Public Overrides Function TryFindAllReferences(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean
ProjectSystemShim\Framework\ExtensionMethods.vb (1)
11Public Function HasMetadataReference(project As Project, path As String) As Boolean
ProjectSystemShim\Framework\TestEnvironment.vb (3)
110Public Overrides Function TryGoToDefinition(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean 114Public Overrides Function TryGoToDefinitionAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of Boolean) 118Public Overrides Function TryFindAllReferences(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean
Microsoft.VisualStudio.LanguageServices.UnitTests (5)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (3)
319Public Function GetDiagnosticsForIdsAsync(project As Project, documentId As DocumentId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), includeLocalDocumentDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetDiagnosticsForIdsAsync 323Public Function GetProjectDiagnosticsForIdsAsync(project As Project, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetProjectDiagnosticsForIdsAsync 327Public Function ForceAnalyzeProjectAsync(project As Project, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.ForceAnalyzeProjectAsync
GenerateType\GenerateTypeViewModelTests.vb (1)
879Public Function GetDefaultNamespace(project As Project, workspace As Microsoft.CodeAnalysis.Workspace) As String Implements IProjectManagementService.GetDefaultNamespace
ProjectSystemShim\VisualStudioProjectTests\ProjectSystemProjectFactoryTests.vb (1)
33Dim newProjectInSolution As Project = environment.Workspace.CurrentSolution.GetProject(project1.Id)
Microsoft.VisualStudio.LanguageServices.VisualBasic (4)
LanguageService\VisualBasicEditorFactory.vb (2)
26Protected Overrides Function GetProjectWithCorrectParseOptionsForProject(project As Project, hierarchy As IVsHierarchy) As Project
ObjectBrowser\DescriptionBuilder.vb (1)
19project As Project)
ObjectBrowser\ObjectBrowserLibraryManager.vb (1)
21project As Project
Microsoft.VisualStudio.LanguageServices.Xaml (6)
Extensions.cs (1)
26public static Project GetCodeProject(this TextDocument document)
Implementation\LanguageServer\Extensions\SolutionExtensions.cs (1)
14public static IEnumerable<Project> GetXamlProjects(this Solution solution)
Implementation\LanguageServer\Extensions\SymbolExtensions.cs (1)
28var codeProject = document.GetCodeProject();
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
177var project = document.GetCodeProject();
Implementation\LanguageServer\Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (1)
127var project = document.Project;
Implementation\LanguageServer\Handler\Diagnostics\WorkspacePullDiagnosticHandler.cs (1)
45foreach (var project in projects)
Mvc.Api.Analyzers.Test (17)
ActualApiResponseMetadataFactoryTest.cs (4)
69var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { source }); 365var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source }); 405var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { source }); 425var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
AddResponseTypeAttributeCodeFixProviderIntegrationTest.cs (2)
64var project = GetProject(testMethod); 81private Project GetProject(string testMethod)
ApiActionsDoNotRequireExplicitModelValidationCheckCodeFixProviderTest.cs (2)
31var project = GetProject(testMethod); 46private Project GetProject(string testMethod)
ApiControllerFactsTest.cs (2)
34var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { source }); 129var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (4)
22var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, source); 27public static Project CreateProjectWithReferencesInBinDir(Assembly testAssembly, params string[] source) 33var project = DiagnosticProject.Create(testAssembly, source); 46public Task<Diagnostic[]> GetDiagnosticsAsync(Project project)
MvcFactsTest.cs (1)
223var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
SymbolApiConventionMatcherTest.cs (1)
556var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
SymbolApiResponseMetadataProviderTest.cs (1)
477var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
Roslyn.VisualStudio.Next.UnitTests (56)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
47var project = workspace.AddProject("proj", LanguageNames.CSharp);
Remote\SnapshotSerializationTests.cs (2)
49var project1 = solution.AddProject("Project", "Project.dll", LanguageNames.CSharp); 53var project2 = document1.Project.Solution.AddProject("Project2", "Project2.dll", LanguageNames.VisualBasic);
Services\AssetProviderTests.cs (1)
128var project = workspace.CurrentSolution.Projects.First();
Services\ServiceHubServicesTests.cs (11)
468static async Task AssertSourceGeneratedDocumentsAreSame(Project localProject, Project remoteProject, int expectedCount) 1483var project = solution.GetProject(projectIds[i]); 1634private static (Project project, Document document) GetProjectAndDocument(Solution solution, string projectName, string documentName) 1636var project = solution.Projects.First(p => string.Equals(p.Name, projectName, StringComparison.OrdinalIgnoreCase)); 1642private static (Project project, ImmutableArray<Document> documents) GetProjectAndDocuments(Solution solution, string projectName, ImmutableArray<string> documentNames) 1644var project = solution.Projects.First(p => string.Equals(p.Name, projectName, StringComparison.OrdinalIgnoreCase)); 1727var project = solution.AddProject(projectName, $"{projectName}.dll", language) 1736var current = solution.GetProject(projectId); 1742var current = solution.GetProject(projectId); 1748var current = solution.GetProject(projectId);
Services\SolutionServiceTests.cs (36)
268var project = solution.Projects.Single(); 309var project = s.GetProject(existingProjectId); 549var project1 = solution.Projects.Single(); 550var project2 = solution.AddProject("P2", "P2", LanguageNames.CSharp); 590var project1 = solution.Projects.Single(); 591var project2 = solution.AddProject("P2", "P2", LanguageNames.CSharp); 631var project1 = solution.Projects.Single(); 632var project2 = solution.AddProject("P2", "P2", LanguageNames.CSharp); 633var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 664var project1 = solution.Projects.Single(); 665var project2 = solution.AddProject("P2", "P2", LanguageNames.CSharp); 666var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 705var project1 = solution.Projects.Single(); 706var project2 = solution.AddProject("P2", "P2", LanguageNames.CSharp); 707var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 745var project1 = solution.Projects.Single(); 746var project2 = solution.AddProject("P2", "P2", LanguageNames.CSharp); 747var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 785var project1 = solution.Projects.Single(); 786var project2 = solution.AddProject("P2", "P2", LanguageNames.VisualBasic); 818var project1 = solution.Projects.Single(); 819var project2 = solution.AddProject("P2", "P2", LanguageNames.VisualBasic); 873var project1 = solution.Projects.Single(); 874var project2 = solution.AddProject("P2", "P2", LanguageNames.CSharp); 919var project1 = solution.Projects.Single(); 942var project1 = solution.Projects.Single(); 943var project2 = solution.AddProject("P2", "P2", LanguageNames.CSharp); 987var project1 = solution.Projects.Single(); 1006var project1 = solution.Projects.Single(); 1038var project1 = solution.Projects.Single(); 1076var project1 = solution.Projects.Single(p => p.AssemblyName == "Assembly1"); 1077var project2 = solution.Projects.Single(p => p.AssemblyName == "Assembly2"); 1102var project1 = solution.Projects.Single(); 1129var project1 = solution.Projects.Single(); 1158var project1 = solution.Projects.Single(); 1205var project1 = solution.Projects.Single();
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (5)
51var project = workspace.CurrentSolution.Projects.First(); 84var project = workspace.CurrentSolution.Projects.First(); 164var project = workspace.CurrentSolution.Projects.First(); 204var project = workspace.CurrentSolution.Projects.First().AddAnalyzerReference(analyzerReference); 237var project = solution.GetProject(projectId);
Test.Utilities (2)
CodeMetricsTestsBase.cs (2)
32protected Project CreateProject(string[] sources, string language = LanguageNames.CSharp) 74var project = CreateProject(sources, language);