113 references to CurrentSolution
dotnet-format (4)
CodeFormatter.cs (2)
49foreach (var project in workspace.CurrentSolution.Projects) 62var solution = workspace.CurrentSolution;
Workspaces\FolderWorkspace.cs (2)
43return CurrentSolution; 54var document = CurrentSolution.GetDocument(documentId);
Microsoft.CodeAnalysis.ExternalAccess.HotReload (2)
Api\HotReloadMSBuildWorkspace.cs (2)
75var oldSolution = CurrentSolution; 151var updatedSolution = CurrentSolution;
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Options\OmniSharpSolutionAnalyzerConfigOptionsUpdater.cs (1)
23var oldSolution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.Features (18)
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
110var newSolution = workspace.CurrentSolution.WithDocumentText( 122var rolledBackSolution = workspace.CurrentSolution.WithDocumentText(
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
37/// cref="Workspace.CurrentSolution"/> normally represents.
ExternalAccess\UnitTesting\UnitTestingStackTraceServiceAccessor.cs (2)
23=> _stackTraceExplorerService.GetDocumentAndLine(workspace.CurrentSolution, parsedFrame.UnderlyingObject); 38var definition = await _stackTraceExplorerService.TryFindDefinitionAsync(workspace.CurrentSolution, parsedFrame.UnderlyingObject, StackFrameSymbolPart.Method, cancellationToken).ConfigureAwait(false);
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
44var (project, symbol) = await TryResolveSymbolAsync(workspace.CurrentSolution, symbolKey, cancellationToken).ConfigureAwait(false);
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (6)
66metadataWorkspace.OnSolutionFallbackAnalyzerOptionsChanged(sourceWorkspace.CurrentSolution.FallbackAnalyzerOptions); 104var (temporaryProjectInfo, temporaryDocumentId) = GenerateProjectAndDocumentInfo(fileInfo, metadataWorkspace.CurrentSolution.Services, sourceProject, topLevelNamedType); 105var temporarySolution = metadataWorkspace.CurrentSolution.AddProject(temporaryProjectInfo); 212var document = metadataWorkspace.CurrentSolution.GetRequiredDocument(generatedDocumentId); 230var newLoader = new WorkspaceFileTextLoader(metadataWorkspace.CurrentSolution.Services, fileInfo.TemporaryFilePath, MetadataAsSourceGeneratedFileInfo.Encoding); 305var solution = fileInfo.Workspace.CurrentSolution;
MetadataAsSource\MetadataAsSourceFileService.cs (2)
181documentId = workspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath).SingleOrDefault(); 203var documentId = workspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault();
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (4)
258var navigateProject = metadataWorkspace.CurrentSolution.GetRequiredProject(projectId); 265if (!metadataWorkspace.CurrentSolution.ContainsDocument(documentInfo.Id)) 272navigateProject = metadataWorkspace.CurrentSolution.GetRequiredProject(projectId); 396var solution = info.SourceWorkspace.CurrentSolution;
Microsoft.CodeAnalysis.Workspaces (71)
CodeActions\CodeAction_Cleanup.cs (1)
102originalSolution ??= changedSolution.Workspace.CurrentSolution;
CodeActions\Operations\ApplyChangesOperation.cs (1)
53var currentSolution = workspace.CurrentSolution;
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
122var solution = _workspace.CurrentSolution; 244foreach (var projectId in service._workspace.CurrentSolution.ProjectIds)
Formatting\Formatter.cs (1)
320return syntaxFormattingService.GetFormattingOptions(optionSet ?? workspace.CurrentSolution.Options);
Recommendations\Recommender.cs (1)
26var solution = workspace.CurrentSolution;
Workspace\AdhocWorkspace.cs (9)
57return this.CurrentSolution; 83return this.CurrentSolution.GetProject(projectInfo.Id); 143return this.CurrentSolution.GetDocument(documentInfo.Id); 151var doc = this.CurrentSolution.GetDocument(documentId); 164var doc = this.CurrentSolution.GetDocument(documentId); 179var doc = this.CurrentSolution.GetAdditionalDocument(documentId); 192var doc = this.CurrentSolution.GetAdditionalDocument(documentId); 207var doc = this.CurrentSolution.GetAnalyzerConfigDocument(documentId); 220var doc = this.CurrentSolution.GetAnalyzerConfigDocument(documentId);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (3)
298if (_documentAlreadyInWorkspace(_project._projectSystemProjectFactory.Workspace.CurrentSolution, documentId)) 350if (_project._projectSystemProjectFactory.Workspace.CurrentSolution.GetDocument(documentId) != null) 506var documentToReload = w.CurrentSolution.GetDocument(documentId);
Workspace\ProjectSystem\ProjectSystemProject.cs (7)
277TryReportCompilationThrownAway(_projectSystemProjectFactory.Workspace.CurrentSolution, Id); 510private bool HasBeenRemoved => !_projectSystemProjectFactory.Workspace.CurrentSolution.ContainsProject(Id); 1321return _projectSystemProjectFactory.Workspace.CurrentSolution.GetRequiredProject(Id).AllProjectReferences.Contains(projectReference); 1329var projectReferencesInWorkspace = _projectSystemProjectFactory.Workspace.CurrentSolution.GetRequiredProject(Id).AllProjectReferences; 1374if (!_projectSystemProjectFactory.Workspace.CurrentSolution.ContainsProject(Id)) 1408var project = w.CurrentSolution.GetRequiredProject(Id); 1414if (w.CurrentSolution.ProjectIds.Count == 1)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (2)
144analyzerReferences: w.CurrentSolution.AnalyzerReferences).WithTelemetryId(SolutionTelemetryId); 397project = Workspace.CurrentSolution.GetRequiredProject(projectId);
Workspace\TextExtensions.cs (4)
26var solution = workspace.CurrentSolution; 62var solution = workspace.CurrentSolution; 109var solution = workspace.CurrentSolution; 130return workspace.CurrentSolution.GetDocument(id);
Workspace\Workspace.cs (37)
163/// Sets the <see cref="CurrentSolution"/> of this workspace. This method does not raise a WorkspaceChange event. 173/// Sets the <see cref="CurrentSolution"/> of this workspace. This method does not raise a 188var oldSolution = this.CurrentSolution; 218/// Applies specified transformation to <see cref="CurrentSolution"/>, updates <see cref="CurrentSolution"/> to 228/// <returns>True if <see cref="CurrentSolution"/> was set to the transformed solution, false if the 423/// Applies specified transformation to <see cref="CurrentSolution"/>, updates <see cref="CurrentSolution"/> to 434/// <param name="onBeforeUpdate">Action to perform immediately prior to updating <see cref="CurrentSolution"/>. 435/// The action will be passed the old <see cref="CurrentSolution"/> that will be replaced and the exact solution 439/// <param name="onAfterUpdate">Action to perform once <see cref="CurrentSolution"/> has been updated. The 440/// action will be passed the old <see cref="CurrentSolution"/> that was just replaced and the exact solution it 530/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>. 536return this.CurrentSolution.Options; 1535var oldSolution = this.CurrentSolution; 1593if (CurrentSolution.FallbackAnalyzerOptions != newSolution.FallbackAnalyzerOptions) 1598if (!CurrentSolution.AnalyzerReferences.SequenceEqual(newSolution.AnalyzerReferences)) 2082var oldProject = CurrentSolution.GetRequiredProject(projectId); 2100var oldProject = CurrentSolution.GetRequiredProject(projectId); 2314=> CheckSolutionIsEmpty(this.CurrentSolution); 2328=> CheckProjectIsInSolution(this.CurrentSolution, projectId); 2344=> CheckProjectIsNotInSolution(this.CurrentSolution, projectId); 2361if (!this.CurrentSolution.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference)) 2374if (this.CurrentSolution.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference)) 2387var transitiveReferences = this.CurrentSolution.GetProjectDependencyGraph().GetProjectsThatThisProjectTransitivelyDependsOn(toProjectId); 2401if (!this.CurrentSolution.GetProject(projectId)!.MetadataReferences.Contains(metadataReference)) 2412if (this.CurrentSolution.GetProject(projectId)!.MetadataReferences.Contains(metadataReference)) 2423if (!this.CurrentSolution.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference)) 2434if (this.CurrentSolution.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference)) 2466=> CheckDocumentIsInSolution(this.CurrentSolution, documentId); 2482=> CheckAdditionalDocumentIsInSolution(this.CurrentSolution, documentId); 2498=> CheckAnalyzerConfigDocumentIsInSolution(this.CurrentSolution, documentId); 2515if (this.CurrentSolution.ContainsDocument(documentId)) 2527=> CheckAdditionalDocumentIsNotInSolution(this.CurrentSolution, documentId); 2543=> CheckAnalyzerConfigDocumentIsNotInSolution(this.CurrentSolution, documentId); 2560var project = this.CurrentSolution.GetProject(projectId); 2570var document = this.CurrentSolution.GetTextDocument(documentId);
Workspace\Workspace_Editor.cs (2)
213/// Gets the ids for documents in the <see cref="CurrentSolution"/> snapshot associated with the given <paramref name="container"/>. 229return CurrentSolution.GetRelatedDocumentIds(documentId);
Workspace\Workspace_Events.cs (1)
175var currentSolution = this.CurrentSolution;
Microsoft.CodeAnalysis.Workspaces.MSBuild (12)
MSBuild\MSBuildWorkspace.cs (11)
220return this.CurrentSolution; 259var projectMap = ProjectMap.Create(this.CurrentSolution); 270var projectResult = this.CurrentSolution.GetProject(projects[0].Id); 396var document = this.CurrentSolution.GetDocument(documentId); 414var document = this.CurrentSolution.GetAdditionalDocument(documentId); 462var project = this.CurrentSolution.GetRequiredProject(info.Id.ProjectId); 522var document = this.CurrentSolution.GetDocument(documentId); 606var relativePath = PathUtilities.GetRelativePath(Path.GetDirectoryName(CurrentSolution.GetRequiredProject(projectId).FilePath)!, peRef.FilePath); 636var project = this.CurrentSolution.GetProject(projectId); 661var project = this.CurrentSolution.GetProject(projectReference.ProjectId); 676var project = this.CurrentSolution.GetProject(projectReference.ProjectId);
MSBuild\ProjectMap.cs (1)
16/// project into a custom <see cref="Workspace"/>. To use, pass <see cref="Workspace.CurrentSolution"/> to <see cref="Create(Solution)"/>.
Microsoft.DotNet.HotReload.Utils.Generator (2)
BaselineProject.cs (2)
52workspace.CurrentSolution.Services, 55return (service, workspace.CurrentSolution, project.Id);
Microsoft.DotNet.HotReload.Watch (3)
HotReload\CompilationHandler.cs (3)
66_hotReloadService = new HotReloadService(Workspace.CurrentSolution.Services, () => ValueTask.FromResult(GetAggregateCapabilities())); 265if (Workspace.CurrentSolution is { ProjectIds: not [] } currentSolution) 349var currentSolution = Workspace.CurrentSolution;