1984 references to CurrentSolution
AnalyzerRunner (6)
CodeRefactoringRunner.cs (1)
53var solution = _workspace.CurrentSolution;
DiagnosticAnalyzerRunner.cs (2)
65var solution = _workspace.CurrentSolution; 79var solution = _workspace.CurrentSolution;
IncrementalAnalyzerRunner.cs (1)
58await using var persistentStorage = await persistentStorageService.GetStorageAsync(SolutionKey.ToSolutionKey(_workspace.CurrentSolution), cancellationToken).ConfigureAwait(false);
Program.cs (2)
93ShowSolutionStatistics(workspace.CurrentSolution, cancellationToken); 99await ShowCompilerDiagnosticsAsync(workspace.CurrentSolution, cancellationToken).ConfigureAwait(false);
IdeBenchmarks (6)
FormatterBenchmarks.cs (2)
47var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id); 60var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
InheritanceMargin\InheritanceMarginGlyphBenchmarks.cs (1)
130var items = await BenchmarksHelpers.GenerateInheritanceMarginItemsAsync(workspace.CurrentSolution, cancellationToken).ConfigureAwait(false);
RegexClassifierBenchmarks.cs (1)
73var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
SQLitePersistentStorageBenchmark.cs (2)
69var solution = _workspace.CurrentSolution; 73_document = _workspace.CurrentSolution.Projects.Single().Documents.Single();
IdeCoreBenchmarks (12)
FindReferencesBenchmarks.cs (1)
98using (var storage = await storageService.GetStorageAsync(SolutionKey.ToSolutionKey(_workspace.CurrentSolution), CancellationToken.None))
FormatterBenchmarks.cs (1)
49var solution = new AdhocWorkspace().CurrentSolution
IncrementalSourceGeneratorBenchmarks.cs (1)
156var project = _workspace.CurrentSolution.Projects.Single(p => p.Name == "Microsoft.CodeAnalysis.Workspaces(netstandard2.0)");
NavigateToBenchmarks.cs (7)
97var docCount = _workspace.CurrentSolution.Projects.SelectMany(p => p.Documents).Count(); 122foreach (var project in _workspace.CurrentSolution.Projects) 156foreach (var project in _workspace.CurrentSolution.Projects) 175foreach (var project in _workspace.CurrentSolution.Projects) 197using (var storage = await storageService.GetStorageAsync(SolutionKey.ToSolutionKey(_workspace.CurrentSolution), CancellationToken.None)) 202var tasks = _workspace.CurrentSolution.Projects.SelectMany(p => p.Documents).Select(d => Task.Run( 226var searchTasks = _workspace.CurrentSolution.Projects.Select(
ProjectOperationBenchmarks.cs (1)
58var solution = _workspace.CurrentSolution;
RenameBenchmarks.cs (1)
43_solution = new AdhocWorkspace().CurrentSolution
Microsoft.CodeAnalysis.CodeStyle.LegacyTestFramework.UnitTestUtilities (13)
AbstractCodeActionOrUserDiagnosticTest.cs (11)
196var newSolution = workspace.CurrentSolution; 197foreach (var projectId in workspace.CurrentSolution.ProjectIds) 236var newSolution = workspace.CurrentSolution; 668var expectedSolution = expectedWorkspace.CurrentSolution; 760workspace.CurrentSolution, new ProgressTracker(), CancellationToken.None); 772result = Tuple.Create(workspace.CurrentSolution, applyChangesOperation.ChangedSolution); 776var oldSolution = workspace.CurrentSolution; 778var newSolution = workspace.CurrentSolution; 916document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 921document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 932return workspace.CurrentSolution.GetDocument(hostDocument.Id);
AbstractUserDiagnosticTest.cs (2)
107workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(analyzeReferences)); 114return workspace.CurrentSolution.GetDocument(hostDocument.Id);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (239)
Classification\SemanticClassifierTests.cs (2)
39var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id); 2485var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id);
Classification\SyntacticClassifierTests.cs (3)
24var document = workspace.CurrentSolution.Projects.First().Documents.First(); 5645var document = workspace.CurrentSolution.Projects.First().Documents.First(); 5673var document = workspace.CurrentSolution.Projects.First().Documents.First();
Classification\TotalClassifierTests.cs (1)
26var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id);
CodeActions\ApplyChangesOperationTests.cs (1)
241var originalSolution = workspace.CurrentSolution;
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
920var documentToModify = workspace.CurrentSolution.GetDocument(documentToModifyId);
CodeActions\Preview\PreviewExceptionTests.cs (3)
75workspace, workspace.CurrentSolution, textBuffer, provider, codeActions.First(), fixAllFlavors: null); 88workspace, workspace.CurrentSolution, textBuffer, provider, codeActions.First(), fixAllFlavors: null); 101workspace, workspace.CurrentSolution, textBuffer, provider, codeActions.First(), fixAllFlavors: null);
CodeGeneration\SyntaxGeneratorTests.cs (2)
36var solution = workspace.CurrentSolution; 70var solution = workspace.CurrentSolution;
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
168var document = workspace.CurrentSolution.GetDocument(documentId);
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
432var document = workspace.CurrentSolution.GetRequiredDocument(hostDocument.Id);
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
621var document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 1193var document = workspace.CurrentSolution.GetDocument(hostDocument.Id);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (10)
2482var solution = testWorkspace.CurrentSolution; 2739var solution = testWorkspace.CurrentSolution; 2795var solution = testWorkspace.CurrentSolution; 3080var document = workspace.CurrentSolution.GetRequiredDocument(testDocument.Id); 3206var compilation = await workspace.CurrentSolution.Projects.First(p => p.Name == "P3").GetCompilationAsync(); 3211var p1 = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 3217var document = workspace.CurrentSolution.GetRequiredDocument(testDocument.Id); 3260var origComp = await workspace.CurrentSolution.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None); 3265var project = workspace.CurrentSolution.Projects.Single(); 3271var document = workspace.CurrentSolution.GetRequiredDocument(testDocument.Id);
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (2)
336var document = workspace.CurrentSolution.GetDocument(testDocument.Id); 347var currentDocument = workspace.CurrentSolution.GetDocument(testDocument.Id);
Completion\CompletionServiceTests.cs (7)
52var document = workspace.CurrentSolution 110var document = workspace.CurrentSolution 136Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions( 137workspace.CurrentSolution.Options.WithChangedOption(new OptionKey(ThirdPartyOption.Instance, LanguageNames.CSharp), 1)))); 139var document = workspace.CurrentSolution.GetDocument(testDocument.Id); 170var project = SolutionUtilities.AddEmptyProject(workspace.CurrentSolution) 176var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
Debugging\DataTipInfoGetterTests.cs (1)
56workspace.CurrentSolution.Projects.First().Documents.First(),
Debugging\LocationInfoGetterTests.cs (1)
30workspace.CurrentSolution.Projects.Single().Documents.Single(),
Debugging\NameResolverTests.cs (2)
25var nameResolver = new BreakpointResolver(workspace.CurrentSolution, searchText); 37var results = await debugInfo.ResolveBreakpointsAsync(workspace.CurrentSolution, "goo", CancellationToken.None);
Debugging\ProximityExpressionsGetterTests.cs (1)
80var document = workspace.CurrentSolution.GetDocument(testDocument.Id);
DecompiledSource\DecompiledSourceFormattingTests.cs (1)
229var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (18)
58var newSolution = workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference }) 62var document = workspace.CurrentSolution.Projects.Single().Documents.Single(); 89ideEngineWorkspace.TryApplyChanges(ideEngineWorkspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 91var ideEngineDocument = ideEngineWorkspace.CurrentSolution.Projects.Single().Documents.Single(); 104var compilerEngineCompilation = (CSharpCompilation)compilerEngineWorkspace.CurrentSolution.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None).Result; 125workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 127var document = workspace.CurrentSolution.Projects.Single().Documents.Single(); 163var additionalDocId = DocumentId.CreateNewId(workspace.CurrentSolution.Projects.Single().Id); 169workspace.TryApplyChanges(workspace.CurrentSolution 173var sourceDocument = workspace.CurrentSolution.Projects.Single().Documents.Single(); 203workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 205var ideEngineDocument = workspace.CurrentSolution.Projects.Single().Documents.Single(); 259ideEngineWorkspace.TryApplyChanges(ideEngineWorkspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 261var ideEngineDocument = ideEngineWorkspace.CurrentSolution.Projects.Single().Documents.Single(); 280var compilerEngineCompilation = (CSharpCompilation)compilerEngineWorkspace.CurrentSolution.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None).Result; 339var compilerEngineCompilation = (CSharpCompilation)(await compilerEngineWorkspace.CurrentSolution.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None)); 775Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] 780var project = workspace.CurrentSolution.Projects.Single();
Diagnostics\Suppression\SuppressionTests.cs (3)
449workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 761var solution = workspace.CurrentSolution; 1003var solution = workspace.CurrentSolution;
EditAndContinue\ActiveStatementTrackingServiceTests.cs (1)
186var solution = workspace.CurrentSolution;
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (14)
302var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 369var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 396var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source); 430var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 463var oldSolution = workspace.CurrentSolution. 512var oldSolution = workspace.CurrentSolution; 517var newSolution = workspace.CurrentSolution.WithDocumentText(documentId, SourceText.From(source2)); 543var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source); 581var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 620var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 661var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 708var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 742var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 796var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1);
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (3)
39Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution 53var solution = workspace.CurrentSolution; 363var solution = workspace.CurrentSolution;
EncapsulateField\EncapsulateFieldTestState.cs (1)
35TargetDocument = Workspace.CurrentSolution.GetDocument(_testDocument.Id);
ExtractMethod\ExtractMethodBase.cs (3)
131var document = workspace.CurrentSolution.GetDocument(testDocument.Id); 172var document = workspace.CurrentSolution.GetDocument(testDocument.Id); 190var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
ExtractMethod\ExtractMethodTests.cs (1)
11249var solution = new AdhocWorkspace().CurrentSolution;
Formatting\CodeCleanupTests.cs (5)
728var project = workspace.CurrentSolution.Projects.Single(); 752var document = workspace.CurrentSolution.GetDocument(hostdoc.Id); 769var document = workspace.CurrentSolution.GetDocument(hostdoc.Id); 823var solution = workspace.CurrentSolution.WithAnalyzerReferences(new[] 836var document = workspace.CurrentSolution.GetDocument(hostdoc.Id);
Formatting\FormattingEngineTests.cs (1)
418var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
Formatting\Indentation\SmartIndenterEnterOnTokenTests.cs (2)
1415var document = workspace.CurrentSolution.GetDocument(hostdoc.Id); 1456var document = workspace.CurrentSolution.GetDocument(hostdoc.Id);
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (1)
3416var document = workspace.CurrentSolution.GetDocument(testDocument.Id);
Intents\IntentTestsBase.cs (2)
110var priorDocument = workspace.CurrentSolution.GetRequiredDocument(testDocument.Id); 121var textDiffService = workspace.CurrentSolution.Services.GetRequiredService<IDocumentTextDifferencingService>();
LineSeparators\LineSeparatorTests.cs (1)
539var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id);
MoveToNamespace\MoveToNamespaceTests.cs (1)
1319var document = workspace.CurrentSolution.GetDocument(testDocument.Id);
NavigateTo\NavigateToSearcherTests.cs (5)
129workspace.CurrentSolution, 172workspace.CurrentSolution, 212workspace.CurrentSolution, 251workspace.CurrentSolution, 273public Document Document => _workspace.CurrentSolution.Projects.Single().Documents.Single();
Organizing\AbstractOrganizerTests.cs (1)
30var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
160var document = masWorkspace!.CurrentSolution.Projects.First().Documents.First(d => d.FilePath == file.FilePath); 216var project = workspace.CurrentSolution.Projects.First();
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (10)
167var implProject = workspace.CurrentSolution.Projects.First(); 233var implProject = workspace.CurrentSolution.Projects.First(); 293var implProject = workspace.CurrentSolution.Projects.First(); 347var implProject = workspace.CurrentSolution.Projects.First(); 397var implProject = workspace.CurrentSolution.Projects.First(); 461var implProject = workspace.CurrentSolution.Projects.First(); 518var implProject = workspace.CurrentSolution.Projects.First(); 525implProject = workspace.CurrentSolution.Projects.First().AddMetadataReference(MetadataReference.CreateFromFile(dllFilePath)); 533implProject = workspace.CurrentSolution.Projects.First(); 539implProject = workspace.CurrentSolution.Projects.First().AddMetadataReference(MetadataReference.CreateFromFile(realImplementationDllFilePath));
PdbSourceDocument\PdbSourceDocumentTests.cs (3)
481var implProject = workspace.CurrentSolution.Projects.First(); 528var implProject = workspace.CurrentSolution.Projects.First(); 923var project = workspace.CurrentSolution.Projects.First();
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (2)
217workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 221var document = workspace.CurrentSolution.Projects.First().Documents.First();
QuickInfo\SemanticQuickInfoSourceTests.cs (3)
46var document = workspace.CurrentSolution.GetRequiredDocument(documentId); 102var document = workspace.CurrentSolution.GetRequiredDocument(documentId); 254var document = workspace.CurrentSolution.GetRequiredDocument(documentId);
QuickInfo\SyntacticQuickInfoSourceTests.cs (1)
610var document = workspace.CurrentSolution.Projects.First().Documents.First();
Squiggles\ErrorSquiggleProducerTests.cs (2)
321new object(), workspace, workspace.CurrentSolution, document.Project.Id, document.Id, 365new LiveId(), workspace, workspace.CurrentSolution, document.Project.Id, document.Id,
StringIndentation\StringIndentationTests.cs (1)
31var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id);
SymbolKey\SymbolKeyTests.cs (5)
44var solution = workspace.CurrentSolution; 79var solution = workspace.CurrentSolution; 118var solution = workspace.CurrentSolution; 163var solution = workspace.CurrentSolution; 194var solution = workspace.CurrentSolution;
Workspaces\WorkspaceTests_EditorFeatures.cs (105)
64var solution = workspace.CurrentSolution; 76Assert.Equal(solution, workspace.CurrentSolution); 86var solution = workspace.CurrentSolution; 93solution = workspace.CurrentSolution; 102var solution = workspace.CurrentSolution; 108solution = workspace.CurrentSolution; 117var solution = workspace.CurrentSolution; 122solution = workspace.CurrentSolution; 124solution = workspace.CurrentSolution; 133var solution = workspace.CurrentSolution; 144var solution = workspace.CurrentSolution; 158var solution = workspace.CurrentSolution; 183var solution = workspace.CurrentSolution; 220workspace.TryApplyChanges(workspace.CurrentSolution); 223var tree1 = await workspace.CurrentSolution 230var tree2 = await workspace.CurrentSolution 239var currentSnapshot = workspaceSnapshotBuilder.CurrentSolution; 257var solution = workspace.CurrentSolution; 271var solution = workspace.CurrentSolution; 282var snapshot = workspace.CurrentSolution; 293var solution = workspace.CurrentSolution; 310var solution = workspace.CurrentSolution; 321var snapshot = workspace.CurrentSolution; 332var solution = workspace.CurrentSolution; 349var solution = workspace.CurrentSolution; 359Assert.Empty(workspace.CurrentSolution.Projects); 366var solution = workspace.CurrentSolution; 381var solution = workspace.CurrentSolution; 391Assert.Empty(workspace.CurrentSolution.Projects.Single().Documents); 400var solution = workspace.CurrentSolution; 408var snapshot = workspace.CurrentSolution; 419var solution = workspace.CurrentSolution; 430var snapshot = workspace.CurrentSolution; 443var solution = workspace.CurrentSolution; 454var snapshot = workspace.CurrentSolution; 467var solutionX = workspace.CurrentSolution; 478var solutionY = workspace.CurrentSolution; 496var solutionZ = workspace.CurrentSolution; 512var solutionX = workspace.CurrentSolution; 523var solutionY = workspace.CurrentSolution; 547var cs = workspace.CurrentSolution; 569var solutionX = workspace.CurrentSolution; 580var solutionY = workspace.CurrentSolution; 607var cs = workspace.CurrentSolution; 634var solution = workspace.CurrentSolution; 645solution = workspace.CurrentSolution; 670Assert.Equal(startText, (await workspace.CurrentSolution.GetDocument(document.Id).GetTextAsync()).ToString()); 673var oldSolution = workspace.CurrentSolution; 677Assert.Equal(startText, (await workspace.CurrentSolution.GetDocument(document.Id).GetTextAsync()).ToString()); 701var oldSolution = workspace.CurrentSolution; 707Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 722var oldSolution = workspace.CurrentSolution; 728Assert.Equal(0, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 994var project = workspace.CurrentSolution.Projects.Single(); 1018var project = workspace.CurrentSolution.Projects.Single(); 1046var project = workspace.CurrentSolution.Projects.Single(); 1050var oldSolution = workspace.CurrentSolution; 1059var doc = workspace.CurrentSolution.GetAdditionalDocument(additionalDoc.Id); 1079var project = workspace.CurrentSolution.Projects.Single(); 1083var oldSolution = workspace.CurrentSolution; 1092var doc = workspace.CurrentSolution.GetAnalyzerConfigDocument(analyzerConfigDoc.Id); 1165var project = workspace.CurrentSolution.Projects.Single(); 1169var oldSolution = workspace.CurrentSolution; 1172var doc = workspace.CurrentSolution.GetAdditionalDocument(additionalDoc.Id); 1176Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1177Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count()); 1181oldSolution = workspace.CurrentSolution; 1186Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1187Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count()); 1188Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Single().Name); 1201var project = workspace.CurrentSolution.Projects.Single(); 1205var oldSolution = workspace.CurrentSolution; 1208var doc = workspace.CurrentSolution.GetAnalyzerConfigDocument(analyzerConfigDoc.Id); 1212Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1213Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count()); 1217oldSolution = workspace.CurrentSolution; 1222Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1223Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count()); 1224Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Single().Name); 1237var project = workspace.CurrentSolution.Projects.Single(); 1243Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1244Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count()); 1247project = workspace.CurrentSolution.Projects.Single(); 1250Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1251Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count()); 1252Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Single().Name); 1265var project = workspace.CurrentSolution.Projects.Single(); 1271Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1272Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count()); 1275project = workspace.CurrentSolution.Projects.Single(); 1278Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1279Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count()); 1280Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Single().Name); 1293var documentIdsWithFilePath = workspace.CurrentSolution.GetDocumentIdsWithFilePath(docFilePath); 1297documentIdsWithFilePath = workspace.CurrentSolution.GetDocumentIdsWithFilePath(additionalDocFilePath); 1313var documentIdsWithFilePath = workspace.CurrentSolution.GetDocumentIdsWithFilePath(docFilePath); 1317documentIdsWithFilePath = workspace.CurrentSolution.GetDocumentIdsWithFilePath(analyzerConfigDocFilePath); 1392var solution = workspace1.CurrentSolution; 1406var currentOptionValue = workspace1.CurrentSolution.Options.GetOption(optionKey); 1429var beforeSolutionForPrimaryWorkspace = primaryWorkspace.CurrentSolution; 1430var beforeSolutionForSecondaryWorkspace = secondaryWorkspace.CurrentSolution; 1443Assert.NotEqual(beforeSolutionForPrimaryWorkspace, primaryWorkspace.CurrentSolution); 1444Assert.NotEqual(beforeSolutionForSecondaryWorkspace, secondaryWorkspace.CurrentSolution); 1456Assert.NotSame(beforeSolutionForPrimaryWorkspace, primaryWorkspace.CurrentSolution); 1457Assert.NotSame(beforeSolutionForSecondaryWorkspace, secondaryWorkspace.CurrentSolution);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
59var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
Formatting\FormattingMultipleSpanTests.cs (1)
164var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp);
OrganizeImports\OrganizeUsingsTests.cs (1)
32var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp);
Microsoft.CodeAnalysis.EditorFeatures (23)
CodeActions\CodeActionEditHandlerService.cs (4)
66var oldSolution = workspace.CurrentSolution; 129var oldSolution = workspace.CurrentSolution; 343var latestDocument = workspace.CurrentSolution.GetDocument(documentId); 356var openDocument = workspace.CurrentSolution.GetRequiredDocument(documentId);
EditAndContinue\EditAndContinueLanguageService.cs (4)
84return workspace.Services.GetRequiredService<ICompileTimeSolutionProvider>().GetCompileTimeSolution(currentDesignTimeSolution ?? workspace.CurrentSolution); 119var currentSolution = workspace.CurrentSolution; 311var newSolution = WorkspaceProvider.Value.Workspace.CurrentSolution; 331var designTimeSolution = workspace.CurrentSolution;
EditorConfigSettings\Aggregator\SettingsAggregator.cs (1)
83var solution = workspace.CurrentSolution;
EditorConfigSettings\DataProvider\SettingsProviderBase.cs (1)
54var solution = Workspace.CurrentSolution;
EditorConfigSettings\Updater\SettingsUpdaterBase.cs (1)
74var solution = Workspace.CurrentSolution;
InlineRename\InlineRenameSession.cs (2)
901var finalChanges = _workspace.CurrentSolution.GetChanges(_baseSolution); 922var finalSolution = workspace.CurrentSolution;
IntelliSense\Helpers.cs (1)
205var solution = workspace.CurrentSolution;
Remote\SolutionChecksumUpdater.cs (1)
145var solution = _workspace.CurrentSolution;
RenameTracking\RenameTrackingTaggerProvider.cs (1)
81var document = workspace.CurrentSolution.GetDocument(documentId);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
152var finalSolution = workspace.CurrentSolution;
Shared\Extensions\WorkspaceExtensions.cs (2)
22var oldSolution = workspace.CurrentSolution; 34var oldSolution = workspace.CurrentSolution;
Shared\Preview\PreviewWorkspace.cs (4)
56var document = this.CurrentSolution.GetTextDocument(documentId); 81var document = this.CurrentSolution.GetRequiredDocument(documentId); 90var document = this.CurrentSolution.GetRequiredAdditionalDocument(documentId); 99var document = this.CurrentSolution.GetRequiredAnalyzerConfigDocument(documentId);
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (1)
SuggestedActionsSource.cs (1)
93var project = workspace.CurrentSolution.GetProject(documentId.ProjectId);
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (24)
ChangeSignature\ChangeSignatureTestState.cs (1)
67InvocationDocument = Workspace.CurrentSolution.GetDocument(_testDocument.Id);
CodeActions\AbstractCodeActionOrUserDiagnosticTest.cs (11)
196var newSolution = workspace.CurrentSolution; 197foreach (var projectId in workspace.CurrentSolution.ProjectIds) 236var newSolution = workspace.CurrentSolution; 668var expectedSolution = expectedWorkspace.CurrentSolution; 760workspace.CurrentSolution, new ProgressTracker(), CancellationToken.None); 772result = Tuple.Create(workspace.CurrentSolution, applyChangesOperation.ChangedSolution); 776var oldSolution = workspace.CurrentSolution; 778var newSolution = workspace.CurrentSolution; 916document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 921document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 932return workspace.CurrentSolution.GetDocument(hostDocument.Id);
CodeActions\AbstractCodeActionTest.cs (3)
134await applyChangesOperation.TryApplyAsync(workspace, workspace.CurrentSolution, new ProgressTracker(), CancellationToken.None); 138var fixedRoot = await workspace.CurrentSolution.GetDocument(document.Id).GetSyntaxRootAsync(); 163=> workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
Diagnostics\AbstractSuppressionAllCodeTests.cs (2)
75workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 77var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
Diagnostics\AbstractUnncessarySuppressionDiagnosticTest.cs (1)
35workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference }));
Diagnostics\AbstractUserDiagnosticTest.cs (2)
107workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(analyzeReferences)); 114return workspace.CurrentSolution.GetDocument(hostDocument.Id);
Diagnostics\AbstractUserDiagnosticTest_GenerateTypeDialog.cs (1)
107workspace.CurrentSolution, new ProgressTracker(), CancellationToken.None);
MoveToNamespace\AbstractMoveToNamespaceTests.cs (1)
58.Select(action => action.GetOperationsAsync(workspace.CurrentSolution, action.GetOptions(CancellationToken.None), CancellationToken.None));
MoveToNamespace\AbstractMoveToNamespaceTests.TestState.cs (1)
27public Document InvocationDocument => Workspace.CurrentSolution.GetDocument(TestInvocationDocument.Id);
MoveType\AbstractMoveTypeTest.cs (1)
138workspace.CurrentSolution, new ProgressTracker(), CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (62)
BraceMatching\AbstractBraceMatcherTests.cs (1)
31var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
BracePairs\AbstractBracePairsTests.cs (1)
31var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
CodeLens\AbstractCodeLensTest.cs (8)
27var document = workspace.CurrentSolution.GetDocument(annotatedDocument.Id); 37var result = await new CodeLensReferencesService().GetReferenceCountAsync(workspace.CurrentSolution, annotatedDocument.Id, 57var document = workspace.CurrentSolution.GetDocument(annotatedDocument.Id); 66var result = await new CodeLensReferencesService().FindReferenceLocationsAsync(workspace.CurrentSolution, 85var document = workspace.CurrentSolution.GetDocument(annotatedDocument.Id); 94var result = await new CodeLensReferencesService().FindReferenceMethodsAsync(workspace.CurrentSolution, 113var document = workspace.CurrentSolution.GetDocument(annotatedDocument.Id); 122var actual = await new CodeLensReferencesService().GetFullyQualifiedNameAsync(workspace.CurrentSolution,
Completion\AbstractCompletionProviderTests.cs (6)
273var currentDocument = workspace.CurrentSolution.GetDocument(workspaceFixture.Target.CurrentDocument.Id); 808var solution = testWorkspace.CurrentSolution; 866var solution = testWorkspace.CurrentSolution; 897var solution = testWorkspace.CurrentSolution; 1051var document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 1098var document = workspace.CurrentSolution.GetDocument(documentId);
Diagnostics\DiagnosticTaggerWrapper.cs (1)
46workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference }));
Diagnostics\GenerateType\GenerateTypeTestState.cs (4)
39TriggeredProject = Workspace.CurrentSolution.GetProject(_testDocument.Project.Id); 44ProjectToBeModified = Workspace.CurrentSolution.GetProject(_testDocument.Project.Id); 48ProjectToBeModified = Workspace.CurrentSolution.Projects.FirstOrDefault(proj => proj.Name.Equals(projectToBeModified)); 52InvocationDocument = Workspace.CurrentSolution.GetDocument(_testDocument.Id);
ExtractInterface\ExtractInterfaceTestState.cs (3)
59OriginalSolution = Workspace.CurrentSolution; 67ExtractFromDocument = Workspace.CurrentSolution.GetDocument(_testDocument.Id); 129return Workspace.CurrentSolution;
Formatting\AbstractNewDocumentFormattingServiceTests.cs (2)
30var solution = workspace.CurrentSolution; 32var document = workspace.CurrentSolution.Projects.First().Documents.First();
Formatting\CoreFormatterTestsBase.cs (1)
184var document = workspace.CurrentSolution.GetDocument(hostdoc.Id);
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (2)
41var document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 67var document = workspace.CurrentSolution.GetDocument(hostDocument.Id);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
51var document = workspace.CurrentSolution.GetDocument(testDocument.Id);
LanguageServer\AbstractLanguageServerProtocolTests.cs (8)
320var solution = workspace.CurrentSolution; 360workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { CreateTestAnalyzersReference() })); 401var generatedDocumentId = DocumentId.CreateNewId(workspace.CurrentSolution.ProjectIds.First()); 412var newSolution = workspace.CurrentSolution.AddDocument(generatedDocumentInfo); 541var locations = await GetAnnotatedLocationsAsync(testWorkspace, testWorkspace.CurrentSolution); 563var locations = await GetAnnotatedLocationsAsync(testWorkspace, testWorkspace.CurrentSolution); 611var sourceText = await TestWorkspace.CurrentSolution.GetDocuments(documentUri).First().GetTextAsync(CancellationToken.None).ConfigureAwait(false); 667public Solution GetCurrentSolution() => TestWorkspace.CurrentSolution;
NavigateTo\AbstractNavigateToTests.cs (3)
250=> ImmutableArray.Create(_workspace.CurrentSolution.Projects.First().DocumentIds.First()); 281=> _workspace.CurrentSolution.Projects.First().DocumentIds.First(); 284=> ImmutableArray.Create(_workspace.CurrentSolution.Projects.First().DocumentIds.First());
ReassignedVariable\AbstractReassignedVariableTests.cs (1)
26var project = workspace.CurrentSolution.Projects.Single();
Rename\RenamerTests.cs (3)
41var solution = workspace.CurrentSolution; 176var solution = workspace.CurrentSolution; 215var solution = workspace.CurrentSolution;
SignatureHelp\AbstractSignatureHelpProviderTests.cs (3)
353var document = testWorkspace.CurrentSolution.GetDocument(documentId); 356document = testWorkspace.CurrentSolution.GetDocument(documentId); 472var document = testWorkspace.CurrentSolution.GetDocument(documentId);
SpellCheck\AbstractSpellCheckSpanTests.cs (1)
29var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
Squiggles\SquiggleUtilities.cs (1)
46var analyzerDiagnostics = await wrapper.AnalyzerService.GetDiagnosticsAsync(workspace.CurrentSolution);
Structure\AbstractSyntaxStructureProviderTests.cs (2)
52var document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 71var document = workspace.CurrentSolution.GetDocument(hostDocument.Id);
TaskList\AbstractTaskListTests.cs (1)
40var document = workspace.CurrentSolution.GetRequiredDocument(documentId);
Workspaces\TestHostDocument.cs (3)
65var project = workspace.CurrentSolution.GetRequiredProject(_project!.Id); 267foreach (var linkedId in workspace.CurrentSolution.GetDocumentIdsWithFilePath(FilePath).Concat(this.Id)) 277var document = threadingContext.JoinableTaskFactory.Run(() => workspace.CurrentSolution.GetSourceGeneratedDocumentAsync(testDocument.Id, CancellationToken.None).AsTask());
Workspaces\TestWorkspace.cs (5)
749var document = await CurrentSolution.GetSourceGeneratedDocumentAsync(documentId, CancellationToken.None); 761return ChangeDocumentAsync(documentId, this.CurrentSolution.WithDocumentText(documentId, text)); 775var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.CurrentSolution.AddDocument(documentInfo)); 782var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.CurrentSolution.WithAdditionalDocumentText(documentId, text)); 789var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.CurrentSolution.WithAnalyzerConfigDocumentText(documentId, text));
Workspaces\TestWorkspaceFixture.cs (1)
96return GetWorkspace().CurrentSolution.GetDocument(hostDocument.Id);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (2)
Intellisense\TestState.vb (2)
68Dim language = Me.Workspace.CurrentSolution.Projects.First().Language 468Dim document = Me.Workspace.CurrentSolution.Projects.First().Documents.First()
Microsoft.CodeAnalysis.EditorFeatures.Text (3)
Extensions.cs (3)
64/// Gets the <see cref="Document"/>s from the corresponding <see cref="Workspace.CurrentSolution"/> that are associated with the <see cref="ITextSnapshot"/>'s buffer, 72/// Gets the <see cref="Document"/> from the corresponding <see cref="Workspace.CurrentSolution"/> that is associated with the <see cref="ITextSnapshot"/>'s buffer 84/// Gets the <see cref="Document"/>s from the corresponding <see cref="Workspace.CurrentSolution"/> that are associated with the <see cref="ITextBuffer"/>.
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (284)
CodeFixes\CodeFixServiceTests.cs (6)
51workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 63var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference); 269var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference); 331workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 365var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference); 711var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference);
CodeGeneration\AbstractCodeGenerationTests.cs (1)
31var project = workspace.CurrentSolution
CodeGeneration\CodeGenerationTests.cs (3)
879this.Document = Workspace.CurrentSolution.Projects.Single().Documents.Single(); 890var semanticModel = await workspace.CurrentSolution.Projects.Single().Documents.Single().GetSemanticModelAsync(); 895public Solution Solution { get { return Workspace.CurrentSolution; } }
CodeRefactorings\CodeRefactoringServiceTest.cs (5)
51var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference); 95var document = workspace.CurrentSolution.Projects.Single().Documents.Single(); 115var project = workspace.CurrentSolution.Projects.Single(); 174var project = workspace.CurrentSolution.Projects.Single() 213var project = workspace.CurrentSolution.Projects.Single()
Completion\CompletionServiceTests.cs (1)
44var project = workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(reference);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (26)
72workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 107workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 121workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 136workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 156workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 175workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 289workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 348workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 431workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 466var solution = workspace.CurrentSolution; 523var project = workspace.CurrentSolution.Projects.Single(); 534var project = workspace.CurrentSolution.Projects.Single(); 545var project = workspace.CurrentSolution.Projects.Single(); 570var solution = workspace.CurrentSolution; 756workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 758var project = workspace.CurrentSolution.Projects.Single(); 886workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 888var project = workspace.CurrentSolution.Projects.Single(); 987workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 989var project = workspace.CurrentSolution.Projects.Single(); 1063workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 1064var project = workspace.CurrentSolution.Projects.Single(); 1109workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 1111var project = workspace.CurrentSolution.Projects.Single(); 1152Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(new TestGeneratorReference(generator)).Solution)); 1154var project = workspace.CurrentSolution.Projects.Single();
Diagnostics\DiagnosticDataTests.cs (4)
115var document = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).AddDocument("TestDocument", code); 142var additionalDocument = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 189var project = workspace.CurrentSolution.GetRequiredProject(documentId.ProjectId); 226var firstDocument = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
Diagnostics\DiagnosticServiceTests.cs (4)
40var document = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).AddDocument("TestDocument", string.Empty); 69var document = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).AddDocument("TestDocument", string.Empty); 111var document = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).AddDocument("TestDocument", string.Empty); 173DiagnosticsUpdatedArgs.DiagnosticsCreated(id, workspace, workspace.CurrentSolution, projectId, documentId, ImmutableArray.Create(diagnostic)));
Diagnostics\DiagnosticsSquiggleTaggerProviderTests.cs (3)
66var document = workspace.CurrentSolution.GetRequiredDocument(firstDocument.Id); 156var tree = await workspace.CurrentSolution.Projects.Single().Documents.Single().GetRequiredSyntaxTreeAsync(CancellationToken.None); 195var tree = await workspace.CurrentSolution.Projects.Single().Documents.Single().GetRequiredSyntaxTreeAsync(CancellationToken.None);
Diagnostics\MockDiagnosticService.cs (4)
62var document = workspace.CurrentSolution.Projects.Single().Documents.Single(); 69this, workspace, workspace.CurrentSolution, 75=> workspace.CurrentSolution.Projects.Single().Documents.Single().Id; 78=> workspace.CurrentSolution.Projects.Single().Id;
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (2)
62workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] 70var document = workspace.CurrentSolution.GetDocument(documentId);
EditAndContinue\ActiveStatementsMapTests.cs (3)
90var solution = workspace.CurrentSolution 145var solution = workspace.CurrentSolution 196var solution = workspace.CurrentSolution
EditAndContinue\CompileTimeSolutionProviderTests.cs (4)
47var designTimeSolution = workspace.CurrentSolution. 128_ = await workspace.CurrentSolution.GetRequiredProject(projectId).GetCompilationAsync(); 131var compileTimeSolution1 = provider.GetCompileTimeSolution(workspace.CurrentSolution); 146var compileTimeSolution2 = provider.GetCompileTimeSolution(workspace.CurrentSolution);
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (3)
78solution = workspace.CurrentSolution; 95solution = workspace.CurrentSolution; 4703solution = workspace.CurrentSolution;
EditAndContinue\EditSessionActiveStatementsTests.cs (1)
70var solution = workspace.CurrentSolution;
EditAndContinue\EmitSolutionUpdateResultsTests.cs (1)
31var document = workspace.CurrentSolution.
EditAndContinue\RemoteEditAndContinueServiceTests.cs (7)
83localWorkspace.ChangeSolution(localWorkspace.CurrentSolution 90var solution = localWorkspace.CurrentSolution; 160localWorkspace.CurrentSolution, 231var (updates, _, _, syntaxErrorData) = await sessionProxy.EmitSolutionUpdateAsync(localWorkspace.CurrentSolution, activeStatementSpanProvider, mockDiagnosticService, diagnosticUpdateSource, CancellationToken.None); 295localWorkspace.CurrentSolution, 308Assert.True(await sessionProxy.IsActiveStatementInExceptionRegionAsync(localWorkspace.CurrentSolution, instructionId1, CancellationToken.None)); 320var baseActiveSpans = await sessionProxy.GetBaseActiveStatementSpansAsync(localWorkspace.CurrentSolution, ImmutableArray.Create(documentId, inProcOnlyDocumentId), CancellationToken.None);
FindSymbols\SymbolTreeInfoTests.cs (4)
25var solution = workspace.CurrentSolution; 46var solution = workspace.CurrentSolution; 69var solution = workspace.CurrentSolution; 91var solution = workspace.CurrentSolution;
Formatting\InferredIndentationTests.cs (3)
27var options = await testWorkspace.CurrentSolution.Projects.Single().Documents.Single().GetLineFormattingOptionsAsync(testWorkspace.GlobalOptions, CancellationToken.None); 40var options = await testWorkspace.CurrentSolution.Projects.Single().Documents.Single().GetLineFormattingOptionsAsync(testWorkspace.GlobalOptions, CancellationToken.None); 54var options = await testWorkspace.CurrentSolution.Projects.Single().Documents.Single().GetLineFormattingOptionsAsync(testWorkspace.GlobalOptions, CancellationToken.None);
InheritanceMargin\InheritanceMarginTests.cs (3)
98var document = testWorkspace.CurrentSolution.GetRequiredDocument(testHostDocument.Id); 163var docSpan = await actualDocumentSpans[i].TryRehydrateAsync(workspace.CurrentSolution, CancellationToken.None); 335var document = testWorkspace.CurrentSolution.GetRequiredDocument(testHostDocument.Id);
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (5)
56var solution = workspace.CurrentSolution; 59var text = await workspace.CurrentSolution.GetDocument(documentId).GetTextAsync(); 62var linkedText = await workspace.CurrentSolution.GetDocument(linkedDocumentId).GetTextAsync(); 71Assert.Equal(expectedMergedText, (await workspace.CurrentSolution.GetDocument(documentId).GetTextAsync()).ToString()); 72Assert.Equal(expectedMergedText, (await workspace.CurrentSolution.GetDocument(linkedDocumentId).GetTextAsync()).ToString());
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (2)
66get { return Workspace.CurrentSolution; } 324var document = Workspace.CurrentSolution.GetRequiredDocument(testDocument.Id);
Preview\PreviewWorkspaceTests.cs (28)
40Assert.NotNull(previewWorkspace.CurrentSolution); 48Assert.NotNull(previewWorkspace.CurrentSolution); 55using var previewWorkspace = new PreviewWorkspace(custom.CurrentSolution); 56Assert.NotNull(previewWorkspace.CurrentSolution); 63var solution = previewWorkspace.CurrentSolution; 67var newSolution = previewWorkspace.CurrentSolution.RemoveProject(project.Id); 70Assert.Equal(0, previewWorkspace.CurrentSolution.ProjectIds.Count); 77var solution = previewWorkspace.CurrentSolution; 81var addedSolution = previewWorkspace.CurrentSolution.Projects.First() 85Assert.Equal(1, previewWorkspace.CurrentSolution.Projects.First().MetadataReferences.Count); 86Assert.Equal(1, previewWorkspace.CurrentSolution.Projects.First().DocumentIds.Count); 89var changedSolution = previewWorkspace.CurrentSolution.Projects.First().Documents.First().WithText(SourceText.From(text)).Project.Solution; 91Assert.Equal(previewWorkspace.CurrentSolution.Projects.First().Documents.First().GetTextAsync().Result.ToString(), text); 93var removedSolution = previewWorkspace.CurrentSolution.Projects.First() 94.RemoveMetadataReference(previewWorkspace.CurrentSolution.Projects.First().MetadataReferences[0]) 95.RemoveDocument(previewWorkspace.CurrentSolution.Projects.First().DocumentIds[0]).Solution; 98Assert.Equal(0, previewWorkspace.CurrentSolution.Projects.First().MetadataReferences.Count); 99Assert.Equal(0, previewWorkspace.CurrentSolution.Projects.First().DocumentIds.Count); 107var solution = previewWorkspace.CurrentSolution; 133await using var storage = await persistentService.GetStorageAsync(SolutionKey.ToSolutionKey(previewWorkspace.CurrentSolution), CancellationToken.None); 141using var previewWorkspace = new PreviewWorkspace(workspace.CurrentSolution); 146previewWorkspace.TryApplyChanges(previewWorkspace.CurrentSolution.WithAnalyzerReferences(new[] { DiagnosticExtensions.GetCompilerDiagnosticAnalyzerReference(LanguageNames.CSharp) })); 165workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { DiagnosticExtensions.GetCompilerDiagnosticAnalyzerReference(LanguageNames.CSharp) })); 170var oldDocument = workspace.CurrentSolution.GetRequiredDocument(hostDocument.Id); 229Assert.NotNull(previewWorkspace.CurrentSolution); 233var project = previewWorkspace.CurrentSolution.AddProject("project", "project.dll", LanguageNames.CSharp); 235return previewWorkspace.CurrentSolution; 267var project = previewWorkspace.CurrentSolution.Projects.Single();
RenameTracking\RenameTrackingTestState.cs (2)
174var document = this.Workspace.CurrentSolution.GetDocument(_hostDocument.Id); 204await operations[0].TryApplyAsync(this.Workspace, this.Workspace.CurrentSolution, new ProgressTracker(), CancellationToken.None);
Snippets\RoslynLSPSnippetConvertTests.cs (3)
405var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id); 416var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id); 498var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id);
SolutionCrawler\WorkCoordinatorTests.cs (33)
194var solution = workspace.CurrentSolution; 245var projectid = workspace.CurrentSolution.ProjectIds[0]; 264var project = workspace.CurrentSolution.Projects.First(); 266var solution = workspace.CurrentSolution.RemoveDocument(documentId); 284var project = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 312var project = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 340var project = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 370var project = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 378var newSolution = workspace.CurrentSolution.WithProjectOutputFilePath(project.Id, "/newPath"); 398var project = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 406var newSolution = workspace.CurrentSolution.WithProjectOutputRefFilePath(project.Id, "/newPath"); 426var project = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 434var newSolution = workspace.CurrentSolution.WithProjectCompilationOutputInfo(project.Id, new CompilationOutputInfo(assemblyPath: "/newPath")); 454var project = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 464var newSolution = workspace.CurrentSolution.WithRunAnalyzers(project.Id, false); 467project = workspace.CurrentSolution.GetProject(project.Id); 497MakeFirstDocumentActive(workspace.CurrentSolution.Projects.First()); 564var project = workspace.CurrentSolution.Projects.First(p => p.Name == "P1"); 573var document = w.CurrentSolution.GetDocument(info.Id); 596var document = workspace.CurrentSolution.Projects.First().Documents.First(); 629var document = workspace.CurrentSolution.GetDocument(info.Id); 655var document = workspace.CurrentSolution.GetDocument(info.Id); 671await TouchEverything(workspace.CurrentSolution); 675await TouchEverything(workspace.CurrentSolution); 698var document = workspace.CurrentSolution.Projects.First().Documents.First(); 724var project = workspace.CurrentSolution.Projects.First(); 767var project = workspace.CurrentSolution.Projects.First(); 807var document = workspace.CurrentSolution.Projects.First().Documents.First(); 862var document = workspace.CurrentSolution.Projects.First().Documents.First(); 921var id = workspace.CurrentSolution.Projects.First().DocumentIds[0]; 971var documents = workspace.CurrentSolution.Projects.First().Documents.ToArray(); 1573await TouchEverything(workspace.CurrentSolution); 1575await TouchEverything(workspace.CurrentSolution);
StackTraceExplorer\StackTraceExplorerTests.cs (5)
42var definition = await service.TryFindDefinitionAsync(workspace.CurrentSolution, stackFrame, StackFrameSymbolPart.Method, CancellationToken.None); 48var doc = workspace.CurrentSolution.GetRequiredDocument(cursorDoc.Id); 57var expectedDefinition = expectedSymbol.ToNonClassifiedDefinitionItem(workspace.CurrentSolution, includeHiddenLocations: true); 827var definition = await service.TryFindDefinitionAsync(workspace.CurrentSolution, parsedFame, StackFrameSymbolPart.Method, CancellationToken.None); 859var definition = await service.TryFindDefinitionAsync(workspace.CurrentSolution, frame, StackFrameSymbolPart.Method, CancellationToken.None);
Structure\BlockStructureServiceTests.cs (1)
99var document = workspace.CurrentSolution.GetDocument(hostDocument.Id);
Structure\StructureTaggerTests.cs (1)
335var document = workspace.CurrentSolution.GetDocument(hostdoc.Id);
SymbolFinder\DependentTypeFinderTests.cs (18)
53var solution = workspace.CurrentSolution; 94var solution = workspace.CurrentSolution; 141var solution = workspace.CurrentSolution; 186var solution = workspace.CurrentSolution; 227var solution = workspace.CurrentSolution; 269var solution = workspace.CurrentSolution; 311var solution = workspace.CurrentSolution; 351var solution = workspace.CurrentSolution; 392var solution = workspace.CurrentSolution; 432var solution = workspace.CurrentSolution; 463var solution = workspace.CurrentSolution; 512var solution = workspace.CurrentSolution; 564var solution = workspace.CurrentSolution; 591var solution = workspace.CurrentSolution; 638var solution = workspace.CurrentSolution; 664var solution = workspace.CurrentSolution; 728var solution = workspace.CurrentSolution; 771var solution = workspace.CurrentSolution;
SymbolFinder\FindSymbolAtPositionTests.cs (1)
22var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.Single().Id);
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
41var solution = workspace.CurrentSolution;
TextEditor\OpenDocumentTests.cs (4)
51Assert.Equal(documentIds, workspace.CurrentSolution.GetDocumentIdsWithFilePath(FilePath)); 52Assert.Equal(new[] { documentIds.Last() }, workspace.CurrentSolution.GetDocument(documentIds.First()).GetLinkedDocumentIds()); 63Assert.Same(workspace.CurrentSolution, newDocumentWithChanges.Project.Solution); 69Assert.NotSame(workspace.CurrentSolution, originalDocumentWithChanges.Project.Solution);
TextEditor\TryGetDocumentTests.cs (2)
27var document = workspace.CurrentSolution.GetDocument(workspace.GetDocumentId(hostDocument)); 55var document = workspace.CurrentSolution.GetDocument(workspace.GetDocumentId(hostDocument));
Utilities\SymbolEquivalenceComparerTests.cs (88)
53var type = (ITypeSymbol)(await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 125var csharpType = (ITypeSymbol)(await csharpWorkspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 126var vbType = (await vbWorkspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 195var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 196var type2_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 197var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 198var type2_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 246var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 247var type2_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 248var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 249var type2_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 285var typeC = (await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 286var typeD = (await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("D").Single(); 329var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 330var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 354var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 355var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 379var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 380var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 404var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 405var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 429var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 430var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 456var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 457var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 483var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 484var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 510var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 511var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 535var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 536var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 560var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 561var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 587var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 588var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 621var csharpType1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 622var vbType1 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 666var csharpType1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 667var vbType1 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 697var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 723var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 724var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 758var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 759var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 791var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 792var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 826var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 827var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 857var outer1 = (INamespaceSymbol)(await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetMembers("Outer").Single(); 858var outer2 = (INamespaceSymbol)(await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetMembers("Outer").Single(); 934var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 935var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 936var type2_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 937var type2_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 971var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 972var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 996var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 997var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1021var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1022var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1052var outer = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Outer").Single(); 1053var other = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Other").Single(); 1082var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1083var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1113var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1114var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1153var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1154var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1183var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1184var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1213var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1214var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1244var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1245var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1275var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1276var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1307var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1308var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1343var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1344var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1404var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1405var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1492var comp1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()); 1493var comp2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()); 1566var comp1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()); 1567var comp2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()); 1589var namespace1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M"); 1590var namespace2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M");
ValueTracking\AbstractBaseValueTrackingTests.cs (2)
30var document = testWorkspace.CurrentSolution.GetRequiredDocument(cursorDocument.Id); 40return await service.TrackValueSourceAsync(testWorkspace.CurrentSolution, item, cancellationToken);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (7)
InlineDiagnostics\InlineDiagnosticsTaggerProvider.cs (1)
88var project = workspace.CurrentSolution.GetProject(diagnostic.DocumentId.ProjectId);
Interactive\InteractiveDocumentNavigationService.cs (1)
53var document = interactiveWorkspace.CurrentSolution.GetDocument(documentId);
NavigateTo\NavigateToItemProvider.cs (3)
49=> NavigateToUtilities.GetKindsProvided(_workspace.CurrentSolution); 55foreach (var project in _workspace.CurrentSolution.Projects) 113_workspace.CurrentSolution,
Peek\DefinitionPeekableItem.cs (1)
71var solution = workspace.CurrentSolution;
Suggestions\SuggestedActionsSource.cs (1)
93var project = workspace.CurrentSolution.GetProject(documentId.ProjectId);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (171)
Classification\ClassificationTests.vb (6)
43Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single() 93Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single() 154Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single() 216Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single() 323Dim project = workspace.CurrentSolution.Projects.First(Function(p) p.Language = LanguageNames.CSharp) 326Dim wrongDocument = workspace.CurrentSolution.Projects.First(Function(p) p.Language = "NoCompilation").Documents.First()
Classification\SyntacticChangeRangeComputerTests.vb (1)
19Dim startingDocument = workspace.CurrentSolution.GetDocument(testDocument.Id)
CodeDefinitionWindow\AbstractCodeDefinitionWindowTests.vb (3)
51Dim document As Document = workspace.CurrentSolution.GetDocument(hostDocument.Id) 77Dim triggerDocument = workspace.CurrentSolution.GetDocument(triggerHostDocument.Id) 90Dim expectedDocument = workspace.CurrentSolution.GetDocument(expectedHostDocument.Id)
CodeDefinitionWindow\CrossLanguageCodeDefinitionWindowTests.vb (1)
111Dim document As Document = workspace.CurrentSolution.GetDocument(hostDocument.Id)
CodeFixes\CodeFixServiceTests.vb (4)
53workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 55Dim project = workspace.CurrentSolution.Projects(0) 132workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 134Dim project = workspace.CurrentSolution.Projects(0)
Compilation\CompilationTests.vb (1)
32Dim project = GetProject(workspace.CurrentSolution, "TestAssembly")
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (6)
83Dim oldSolution = workspace.CurrentSolution 92Dim updatedSolution = workspace.CurrentSolution 149workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(analyzeReferences)) 187Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id) 209Dim addedProjectReference = SolutionUtilities.GetSingleAddedProjectReference(workspace.CurrentSolution, edit.ChangedSolution) 234Assert.Equal(expectedProjectToReceiveReference, workspace.CurrentSolution.GetProject(postOp.ProjectId).Name)
Diagnostics\AddImport\AddImportCrossLanguageTests.vb (1)
408Dim project = workspace.CurrentSolution.Projects.Single(Function(p) p.AssemblyName = "CSAssembly1")
Diagnostics\AdditionalFileDiagnosticsTests.vb (2)
47Dim newSln = workspace.CurrentSolution.AddAdditionalDocument(DocumentId.CreateNewId(project.Id), "App.Config", SourceText.From("false")) 55Dim oldSolution = workspace.CurrentSolution
Diagnostics\DiagnosticProviderTests.vb (1)
293workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference}))
Diagnostics\DiagnosticServiceTests.vb (49)
76workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 78Dim solution = workspace.CurrentSolution 182workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 184Dim solution = workspace.CurrentSolution 224workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({hostAnalyzerReference})) 226Dim solution = workspace.CurrentSolution 264workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 266Dim solution = workspace.CurrentSolution 330Dim solution = workspace.CurrentSolution 382workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 387Dim descriptors = workspace.CurrentSolution.State.Analyzers.GetDiagnosticDescriptorsPerReference(diagnosticService2.AnalyzerInfoCache) 404Dim project = workspace.CurrentSolution.Projects.Single() 427workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference1})) 429Dim project = workspace.CurrentSolution.Projects.Single() 436Dim descriptorsMap = workspace.CurrentSolution.State.Analyzers.GetDiagnosticDescriptorsPerReference(diagnosticService.AnalyzerInfoCache, project) 458Dim project = workspace.CurrentSolution.Projects.Single() 481Dim solution = workspace.CurrentSolution 517Dim solution = workspace.CurrentSolution 553Dim project = workspace.CurrentSolution.Projects.Single() 584Dim solution = workspace.CurrentSolution 627Dim solution = workspace.CurrentSolution 658Dim solution = workspace.CurrentSolution 693Dim solution = workspace.CurrentSolution 770Dim solution = workspace.CurrentSolution 806Dim project = workspace.CurrentSolution.Projects.Single() 808Dim solution = workspace.CurrentSolution 867Dim project = workspace.CurrentSolution.Projects.Single() 892Dim project = workspace.CurrentSolution.Projects.Single() 924Dim solution = workspace.CurrentSolution 965Dim solution = workspace.CurrentSolution 1001Dim solution = workspace.CurrentSolution 1059Dim solution = workspace.CurrentSolution 1109Dim solution = workspace.CurrentSolution 1153Dim solution = workspace.CurrentSolution 1197Dim solution = workspace.CurrentSolution 1252Dim solution = workspace.CurrentSolution 1316Dim solution = workspace.CurrentSolution 1364Dim solution = workspace.CurrentSolution 1430Dim project = workspace.CurrentSolution.Projects.Single() 1985Dim solution = workspace.CurrentSolution 2047Dim solution = workspace.CurrentSolution 2114Dim solution = workspace.CurrentSolution 2154Dim solution = workspace.CurrentSolution 2209Dim solution = workspace.CurrentSolution 2257Dim solution = workspace.CurrentSolution 2298Dim solution = workspace.CurrentSolution 2354Dim solution = workspace.CurrentSolution 2425Dim solution = workspace.CurrentSolution 2474Dim solution = workspace.CurrentSolution
Expansion\AbstractExpansionTest.vb (2)
27Dim document = If(Not useLastProject, workspace.CurrentSolution.Projects.Single(), workspace.CurrentSolution.Projects.Last()).Documents.Single()
Extensions\ISymbolExtensionsTests.vb (1)
19Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id)
FindReferences\FindReferencesCommandHandlerTests.vb (1)
47Dim document = workspace.CurrentSolution.GetDocument(testDocument.Id)
FindReferences\FindReferencesTests.LinkedFiles.vb (10)
35Dim document = workspace.CurrentSolution.GetDocument(invocationDocument.Id) 67Dim document = workspace.CurrentSolution.GetDocument(invocationDocument.Id) 105Dim startingSolution = workspace.CurrentSolution 220Dim document = workspace.CurrentSolution.GetDocument(invocationDocument.Id) 258Dim document = workspace.CurrentSolution.GetDocument(invocationDocument.Id) 267Dim documents = references.Select(Function(r) workspace.CurrentSolution.GetDocument(r.Definition.Locations.Single().SourceTree)) 302Dim document = workspace.CurrentSolution.GetDocument(invocationDocument.Id) 345Dim document = workspace.CurrentSolution.GetDocument(invocationDocument.Id) 388Dim document = workspace.CurrentSolution.GetDocument(invocationDocument.Id) 431Dim document = workspace.CurrentSolution.GetDocument(invocationDocument.Id)
FindReferences\FindReferencesTests.vb (12)
73Dim startDocument = If(workspace.CurrentSolution.GetDocument(cursorDocument.Id), 74Await workspace.CurrentSolution.GetSourceGeneratedDocumentAsync(cursorDocument.Id, CancellationToken.None)) 285Dim document = If(workspace.CurrentSolution.GetDocument(cursorDocument.Id), 286Await workspace.CurrentSolution.GetSourceGeneratedDocumentAsync(cursorDocument.Id, CancellationToken.None)) 320Assert.True(False, PrintSpans(expected, actual, workspace.CurrentSolution.GetDocument(doc.Id), "{|Definition:", "|}")) 334If(workspace.CurrentSolution.GetDocument(doc.Id), 335Await workspace.CurrentSolution.GetSourceGeneratedDocumentAsync(doc.Id, CancellationToken.None)) 352Assert.True(False, PrintSpans(expectedSpans, actualSpans, workspace.CurrentSolution.GetDocument(doc.Id), $"{{|{key}:", "|}")) 371Assert.True(False, PrintSpans(expectedSpans, actualSpans, workspace.CurrentSolution.GetDocument(doc.Id), $"{{|{key}:", "|}")) 396Assert.True(False, PrintSpans(expectedSpans, actualSpans, workspace.CurrentSolution.GetDocument(doc.Id), $"{{|{annotationKey}:", "|}")) 543Dim solution = workspace.CurrentSolution 608Dim solution = workspace.CurrentSolution
GoToDefinition\GoToDefinitionTestsBase.vb (2)
21Dim solution = workspace.CurrentSolution 35Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id)
GoToHelpers\GoToHelpers.vb (1)
25Dim solution = workspace.CurrentSolution
InlineHints\AbstractInlineHintsTests.vb (4)
31Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id) 41Dim expectedDocument = outWorkspace.CurrentSolution.GetDocument(outWorkspace.Documents.Single().Id) 91Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id) 101Dim expectedDocument = outWorkspace.CurrentSolution.GetDocument(outWorkspace.Documents.Single().Id)
IntelliSense\AbstractIntellisenseQuickInfoBuilderTests.vb (4)
39Dim solution = workspace.CurrentSolution 43Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id) 62Dim solution = workspace.CurrentSolution 67Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id)
IntelliSense\CompletionServiceTests.vb (2)
36Dim document = workspace.CurrentSolution.Projects.First.Documents.First 101Dim document = workspace.CurrentSolution.Projects.First.Documents.First
IntelliSense\CompletionServiceTests_Exclusivitiy.vb (1)
41Dim document = workspace.CurrentSolution.Projects.First.Documents.First
IntelliSense\CSharpCompletionCommandHandlerTests.vb (2)
6881Dim document = state.Workspace.CurrentSolution.GetDocument(state.Workspace.Documents.Single(Function(d) d.Name = "C.cs").Id) 6933Dim document = state.Workspace.CurrentSolution.GetDocument(state.Workspace.Documents.Single(Function(d) d.Name = "C.cs").Id)
IntelliSense\SignatureHelpControllerTests.vb (1)
285Dim document = workspace.CurrentSolution.GetDocument(workspace.Documents.Single().Id)
KeywordHighlighting\AbstractKeywordHighlightingTests.vb (1)
29Dim document As Document = workspace.CurrentSolution.Projects.First.Documents.First
LanguageServices\SyntaxFactsServiceTests.vb (1)
210Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id)
NavigationBar\TestHelpers.vb (4)
37Dim document = workspace.CurrentSolution.Projects.First().Documents.First() 56Dim document = workspace.CurrentSolution.Projects.First().Documents.First() 89Dim document = workspace.CurrentSolution.Projects.First().Documents.First() 119Dim sourceDocument = workspace.CurrentSolution.Projects.First().Documents.First(Function(doc) doc.FilePath = startingDocumentFilePath)
PasteTracking\PasteTrackingTestState.vb (1)
83Dim document = Workspace.CurrentSolution.GetDocument(hostDocument.Id)
ReferenceHighlighting\AbstractReferenceHighlightingTests.vb (1)
43Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id)
ReferenceHighlighting\DocumentHighlightsServiceTests.vb (1)
41Dim solution = workspace.CurrentSolution
Rename\InlineRenameTests.vb (4)
273VerifyFileName(workspace.CurrentSolution.GetDocument(fileToRename), replacementText) 1281workspace.CurrentSolution.GetDocument(workspace.Documents.Single().Id), 1297workspace.CurrentSolution, 1298workspace.CurrentSolution.GetDocument(workspace.Documents.Single().Id),
Rename\RenameCommandHandlerTests.vb (1)
44Dim expectedTriggerToken = workspace.CurrentSolution.Projects.Single().Documents.Single().GetSyntaxRootAsync().Result.FindToken(view.Caret.Position.BufferPosition)
Rename\RenameEngineResult.vb (6)
73workspace.OnAnalyzerReferenceAdded(workspace.CurrentSolution.ProjectIds.Single(), New TestGeneratorReference(sourceGenerator)) 86Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id) 93Dim result = GetConflictResolution(renameTo, workspace.CurrentSolution, symbol, renameOptions, host) 153Dim oldSyntaxTree = _workspace.CurrentSolution.GetDocument(documentWithSpans.Id).GetSyntaxTreeAsync().Result 201Dim syntaxTree = _workspace.CurrentSolution.GetDocument(document.Id).GetSyntaxTreeAsync().Result 268Let document = _workspace.CurrentSolution.GetDocument(location.DocumentId)
Rename\RenameTestHelpers.vb (2)
40Dim solution = workspace.CurrentSolution 94VerifyFileName(workspace.CurrentSolution.GetDocument(documentId), newIdentifierName)
Rename\RenameViewModelTests.vb (2)
563Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id) 702Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id)
Simplification\AbstractSimplificationTests.vb (3)
31For Each project In workspace.CurrentSolution.Projects 32workspace.ChangeSolution(workspace.CurrentSolution.WithProjectParseOptions(project.Id, csharpParseOptions)) 70Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single()
Simplification\ParameterSimplificationTests.vb (1)
18Dim solution = workspace.CurrentSolution
Simplification\TypeNameSimplifierTest.vb (1)
4249Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single()
SyncNamespaces\SyncNamespacesServiceTests.vb (10)
40Dim project = workspace.CurrentSolution.Projects(0) 46Dim solutionChanges = workspace.CurrentSolution.GetChanges(newSolution) 75Dim projects = workspace.CurrentSolution.Projects.ToImmutableArray() 82Dim solutionChanges = workspace.CurrentSolution.GetChanges(newSolution) 133Dim projects = workspace.CurrentSolution.Projects.ToImmutableArray() 139Dim solutionChanges = workspace.CurrentSolution.GetChanges(newSolution) 183Dim projects = workspace.CurrentSolution.Projects.ToImmutableArray() 193Dim solutionChanges = workspace.CurrentSolution.GetChanges(newSolution) 244Dim projects = workspace.CurrentSolution.Projects.ToImmutableArray() 258Dim solutionChanges = workspace.CurrentSolution.GetChanges(newSolution)
UnitTesting\UnitTestingSearchHelpersTests.vb (1)
16Dim project = workspace.CurrentSolution.Projects.Single()
Workspaces\SymbolDescriptionServiceTests.vb (2)
19Dim solution = workspace.CurrentSolution 24Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id)
Workspaces\TryFindSourceDefinitionTests.vb (11)
57Dim snapshot = workspace.CurrentSolution 101Dim snapshot = workspace.CurrentSolution 141Dim compilation = Await GetProject(workspace.CurrentSolution, "VBAssembly").GetCompilationAsync() 147Dim mappedMember = Await SymbolFinder.FindSourceDefinitionAsync(member, workspace.CurrentSolution) 178Dim compilation = Await GetProject(workspace.CurrentSolution, "VBAssembly").GetCompilationAsync() 184Dim mappedMember = Await SymbolFinder.FindSourceDefinitionAsync(member, workspace.CurrentSolution) 215Dim compilation = Await GetProject(workspace.CurrentSolution, "VBAssembly").GetCompilationAsync() 221Dim mappedMember = Await SymbolFinder.FindSourceDefinitionAsync(member, workspace.CurrentSolution) 249Dim retargetedCompilation = Await GetProject(workspace.CurrentSolution, "CSharpAssembly").GetCompilationAsync() 251Dim retargetingCompilation = Await GetProject(workspace.CurrentSolution, "CSharpAssembly2").GetCompilationAsync() 259Dim mappedMember = Await SymbolFinder.FindSourceDefinitionAsync(retargetedClass, workspace.CurrentSolution)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (3)
LanguageServices\FSharpVisualStudioWorkspaceExtensions.cs (3)
24var projects = workspace.CurrentSolution.Projects.Where(p => string.Equals(p.OutputFilePath, filePath, StringComparison.OrdinalIgnoreCase)).ToList(); 44return workspace.CurrentSolution.Projects.FirstOrDefault(p => p.FilePath == filePath)?.Id ?? ProjectId.CreateNewId("ProjectNotFound"); 50return workspace.CurrentSolution.GetProject(projectId)?.FilePath;
Microsoft.CodeAnalysis.Features (20)
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
124var newSolution = workspace.CurrentSolution.WithDocumentText( 136var rolledBackSolution = workspace.CurrentSolution.WithDocumentText(
Diagnostics\AbstractHostDiagnosticUpdateSource.cs (3)
40var solution = Workspace.CurrentSolution; 116var project = Workspace.CurrentSolution.GetProject(projectId); 122var project = Workspace.CurrentSolution.GetProject(projectId);
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (1)
85compileTimeSolution, documentsToReanalyze, designTimeSolution: _workspace.CurrentSolution, cancellationToken).ConfigureAwait(false);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
37/// cref="Workspace.CurrentSolution"/> normally represents.
ExternalAccess\UnitTesting\UnitTestingStackTraceServiceAccessor.cs (2)
28=> _stackTraceExplorerService.GetDocumentAndLine(workspace.CurrentSolution, parsedFrame.UnderlyingObject); 32var definition = await _stackTraceExplorerService.TryFindDefinitionAsync(workspace.CurrentSolution, parsedFrame.UnderlyingObject, StackFrameSymbolPart.Method, cancellationToken).ConfigureAwait(false);
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
47var (project, symbol) = await TryResolveSymbolAsync(workspace.CurrentSolution, symbolKey, cancellationToken).ConfigureAwait(false);
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (3)
110var metadataSolution = metadataWorkspace.CurrentSolution; 188navigateLocation ??= await RelocateSymbol_NoLockAsync(metadataWorkspace.CurrentSolution, fileInfo, symbolId, cancellationToken).ConfigureAwait(false); 329var solution = fileInfo.Workspace.CurrentSolution;
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (3)
247var navigateProject = metadataWorkspace.CurrentSolution.GetRequiredProject(projectId); 253navigateProject = metadataWorkspace.CurrentSolution.GetRequiredProject(projectId); 409var solution = info.SourceWorkspace.CurrentSolution;
SolutionCrawler\SolutionCrawlerRegistrationService.cs (2)
169coordinator.Reanalyze(analyzer, new ReanalyzeScope(workspace.CurrentSolution.Id), highPriority); 321=> Workspace.CurrentSolution;
Workspace\BackgroundCompiler.cs (1)
86await AddCompilationsForVisibleDocumentsAsync(workspace.CurrentSolution, compilations, cancellationToken).ConfigureAwait(false);
Workspace\BackgroundParser.cs (1)
55=> Parse(_workspace.CurrentSolution.GetDocument(activeDocumentId));
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Features\Diagnostics\DiagnosticAnalyzerService.cs (2)
123return analyzer.GetCachedDiagnosticsAsync(workspace.CurrentSolution, projectId, documentId, includeSuppressedDiagnostics, cancellationToken); 133return analyzer.GetSpecificCachedDiagnosticsAsync(workspace.CurrentSolution, id, includeSuppressedDiagnostics, cancellationToken);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (1)
19var analyzerReferences = _workspace.CurrentSolution.State.Analyzers.HostAnalyzerReferences;
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_BuildSynchronization.cs (1)
36var solution = Workspace.CurrentSolution;
Workspaces\LspMiscellaneousFilesWorkspace.cs (3)
71return CurrentSolution.GetRequiredDocument(id); 85var matchingDocument = CurrentSolution.GetDocumentIdsWithFilePath(uriAbsolutePath).SingleOrDefault(); 92var project = CurrentSolution.GetRequiredProject(matchingDocument.ProjectId);
Workspaces\LspWorkspaceManager.cs (1)
248var workspaceCurrentSolution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (30)
CodeActions\RunCodeActionsTests.cs (1)
56var documentForB = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().Documents.Single(doc => doc.Name.Equals("B.cs", StringComparison.OrdinalIgnoreCase));
Completion\CompletionTests.cs (1)
210var solution = testLspServer.TestWorkspace.CurrentSolution;
Diagnostics\PullDiagnosticTests.cs (1)
323encDiagnosticsSource.ReportDiagnostics(testLspServer.TestWorkspace, testLspServer.TestWorkspace.CurrentSolution, ImmutableArray<DiagnosticData>.Empty, rudeEdits);
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (3)
153Assert.True(miscWorkspace.CurrentSolution.ContainsDocument(miscDocument.Id)); 172Assert.False(miscWorkspace.CurrentSolution.ContainsDocument(miscDocument.Id)); 219return testLspServer.GetManagerAccessor().GetLspMiscellaneousFilesWorkspace()!.CurrentSolution.Projects.SingleOrDefault()?.Documents.Single();
SpellCheck\SpellCheckTests.cs (5)
308var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().Documents.First(); 381var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().Documents.First(); 419var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().Documents.First(); 455var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().Documents.First(); 508var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().Documents.First();
Workspaces\LspWorkspaceManagerTests.cs (19)
69Assert.Same(testLspServer.TestWorkspace.CurrentSolution.GetDocument(firstDocument.Id), firstDocument); 70Assert.Same(testLspServer.TestWorkspace.CurrentSolution.GetDocument(secondDocument.Id), secondDocument); 89Assert.Equal(testLspServer.TestWorkspace.CurrentSolution.GetDocument(firstDocumentWithChange.Id), firstDocumentWithChange); 90Assert.Equal(testLspServer.TestWorkspace.CurrentSolution.GetDocument(secondDocumentUnchanged.Id), secondDocumentUnchanged); 119Assert.NotEqual(testLspServer.TestWorkspace.CurrentSolution.GetDocument(secondDocument.Id), secondDocument); 132Assert.Equal(testLspServer.TestWorkspace.CurrentSolution, openedDocument!.Project.Solution); 135var newProject = testLspServer.TestWorkspace.CurrentSolution.Projects.First().WithAssemblyName("NewCSProj1"); 143Assert.Equal(testLspServer.TestWorkspace.CurrentSolution, openedDocument.Project.Solution); 156Assert.NotEqual(testLspServer.TestWorkspace.CurrentSolution, openedDocument!.Project.Solution); 159var newProject = testLspServer.TestWorkspace.CurrentSolution.Projects.First().WithAssemblyName("NewCSProj1"); 167Assert.NotEqual(testLspServer.TestWorkspace.CurrentSolution, openedDocument.Project.Solution); 181var newDocumentId = DocumentId.CreateNewId(testLspServer.TestWorkspace.CurrentSolution.ProjectIds[0]); 182var newSolution = testLspServer.TestWorkspace.CurrentSolution.AddDocument(newDocumentId, "NewDoc.cs", SourceText.From("New Doc", System.Text.Encoding.UTF8, SourceHashAlgorithms.Default), filePath: @"C:\NewDoc.cs"); 190Assert.Equal(testLspServer.TestWorkspace.CurrentSolution, lspDocument.Project.Solution); 202var newDocumentId = DocumentId.CreateNewId(testLspServer.TestWorkspace.CurrentSolution.ProjectIds[0]); 403var newProjectWorkspaceTwo = testWorkspaceTwo.CurrentSolution.Projects.First().WithAssemblyName("NewCSProj1"); 433var documentUri = testWorkspace.CurrentSolution.Projects.First().Documents.First().GetURI(); 453var newProject = testWorkspace.CurrentSolution.Projects.First().WithAssemblyName(newAssemblyName); 481Assert.Same(testLspServer.TestWorkspace.CurrentSolution, lspDocument.Project.Solution);
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (1)
CompilerInvocation.cs (1)
99var solution = workspace.CurrentSolution.AddProject(projectInfo);
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.UnitTests (8)
FoldingRangeTests.vb (2)
56Dim annotatedLocations = Await AbstractLanguageServerProtocolTests.GetAnnotatedLocationsAsync(workspace, workspace.CurrentSolution) 59Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single()
ProjectStructureTests.vb (3)
45workspace.OnAnalyzerReferenceAdded(workspace.CurrentSolution.ProjectIds.Single(), 60Dim compilation = Await workspace.CurrentSolution.Projects.Single().GetCompilationAsync() 79Dim generatedDocument = Assert.Single(Await workspace.CurrentSolution.Projects.Single().GetSourceGeneratedDocumentsAsync())
SemanticTokensTests.vb (1)
44Dim document = semanticTokensWorkspace.CurrentSolution.Projects.Single().Documents.Single()
Utilities\TestLsifOutput.vb (2)
52For Each project In workspace.CurrentSolution.Projects 97Dim document = _workspace.CurrentSolution.GetDocument(testDocument.Id)
Microsoft.CodeAnalysis.Remote.ServiceHub (8)
Host\RemoteWorkspace.cs (4)
67var currentSolutionChecksum = await this.CurrentSolution.State.GetChecksumAsync(cancellationToken).ConfigureAwait(false); 228/// cref="Workspace.CurrentSolution"/> of this <see cref="RemoteWorkspace"/> is the responsibility of any 236/// fork off of <see cref="Workspace.CurrentSolution"/> if possible. The latter is almost always what will 249var updater = new SolutionCreator(Services.HostServices, assetProvider, this.CurrentSolution);
Host\RemoteWorkspace.SolutionCreator.cs (1)
593await TestUtils.AssertChecksumsAsync(_assetProvider, checksumFromRequest, workspace.CurrentSolution, incrementalSolutionBuilt).ConfigureAwait(false);
Host\RemoteWorkspaceManager.cs (1)
40/// cref="Workspace.CurrentSolution"/> of the workspace it is created against. This ensures that the assets
Host\SolutionAssetCache.cs (1)
220var checksums = await _remoteWorkspace.CurrentSolution.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (1)
92var document = workspace.CurrentSolution.GetDocument(documentId);
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (47)
CaseCorrecting\CaseCorrectionServiceTests.vb (1)
34Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id)
Classification\SemanticClassifierTests.vb (1)
19Dim document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id)
Classification\SyntacticClassifierTests.vb (1)
18Dim document = workspace.CurrentSolution.Projects.First().Documents.First()
Completion\CompletionProviders\AbstractVisualBasicCompletionProviderTests.vb (1)
118Dim document = workspace.CurrentSolution.GetDocument(documentId)
Completion\CompletionProviders\CrefCompletionProviderTests.vb (1)
422Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id)
Completion\CompletionProviders\ImplementsClauseCompletionProviderTests.vb (1)
625Dim document = workspace.CurrentSolution.GetDocument(workspace.Documents.Single().Id)
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.vb (1)
452Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id)
Completion\CompletionProviders\OverrideCompletionProviderTests.vb (1)
1853Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id)
Completion\CompletionProviders\SymbolCompletionProviderTests.vb (1)
7655Dim document = workspace.CurrentSolution.GetDocument(workspace.DocumentWithCursor.Id)
Debugging\DataTipInfoGetterTests.vb (1)
54Await continuation(workspace.CurrentSolution.Projects.First.Documents.First, position)
Debugging\LocationInfoGetterTests.vb (1)
27workspace.CurrentSolution.Projects.Single().Documents.Single(),
Debugging\NameResolverTests.vb (1)
27Dim nameResolver = New BreakpointResolver(workspace.CurrentSolution, searchText)
Debugging\ProximityExpressionsGetterTests.vb (3)
55Dim document = workspace.CurrentSolution.GetDocument(hostdoc.Id) 153Dim document = workspace.CurrentSolution.GetDocument(testDocument.Id) 229Dim document = workspace.CurrentSolution.GetDocument(hostdoc.Id)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.vb (10)
27Dim newSolution = workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference}). 31Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single() 55ideEngineWorkspace.TryApplyChanges(ideEngineWorkspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 57Dim ideEngineDocument = ideEngineWorkspace.CurrentSolution.Projects.Single().Documents.Single() 68Dim compilerEngineCompilation = CType(compilerEngineWorkspace.CurrentSolution.Projects.Single().GetCompilationAsync().Result, VisualBasicCompilation) 85workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 87Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single() 108Dim projectId = workspace.CurrentSolution.Projects.Single().Id 116workspace.TryApplyChanges(workspace.CurrentSolution. 120Dim sourceDocument = workspace.CurrentSolution.GetProject(projectId).Documents.Single()
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (7)
471Dim oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1) 527Dim oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source) 557Dim oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1) 583Dim oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source) 615Dim oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1) 647Dim oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1) 678Dim oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1)
EncapsulateField\EncapsulateFieldTestState.vb (1)
25TargetDocument = workspace.CurrentSolution.GetDocument(_testDocument.Id)
ExtractMethod\ExtractMethodTests.vb (3)
102Dim document = workspace.CurrentSolution.GetDocument(testDocument.Id) 138Dim document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id) 166Dim document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id)
Formatting\CodeCleanUpTests.vb (4)
513Dim project = workspace.CurrentSolution.Projects.Single() 536Dim document = workspace.CurrentSolution.GetDocument(hostdoc.Id) 574Dim solution = workspace.CurrentSolution.WithAnalyzerReferences( 588Dim document = workspace.CurrentSolution.GetDocument(hostdoc.Id)
Formatting\Indentation\SmartTokenFormatter_FormatTokenTests.vb (1)
189Dim document = workspace.CurrentSolution.GetDocument(hostdoc.Id)
Formatting\VisualBasicFormatterTestBase.vb (1)
50Dim document = workspace.CurrentSolution.GetDocument(hostdoc.Id)
LineSeparators\LineSeparatorTests.vb (1)
292Dim document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id)
Organizing\AbstractOrganizerTests.vb (1)
17Dim document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id)
QuickInfo\SemanticQuickInfoSourceTests.vb (2)
30Dim document = workspace.CurrentSolution.Projects.First().Documents.First() 44workspace.CurrentSolution.Projects.First().Documents.First(),
Recommendations\RecommendationTestHelpers.vb (1)
28Dim solution = workspace.CurrentSolution
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (6)
CaseCorrection\VisualBasicCaseCorrectionTestBase.vb (1)
16Dim project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
Formatting\FormattingTests.vb (2)
3015Dim project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.VisualBasic) 4197Dim solution = New AdhocWorkspace().CurrentSolution
Formatting\VisualBasicFormattingTestBase.vb (1)
57Dim project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
OrganizeImports\OrganizeImportsTests.vb (2)
27Dim project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.VisualBasic) 48Dim project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
Microsoft.CodeAnalysis.Workspaces (78)
CodeActions\CodeAction.cs (1)
307originalSolution ??= changedSolution.Workspace.CurrentSolution;
CodeActions\Operations\ApplyChangesOperation.cs (1)
59var currentSolution = workspace.CurrentSolution;
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
121var solution = _workspace.CurrentSolution; 250foreach (var projectId in _services._workspace.CurrentSolution.ProjectIds)
Formatting\Formatter.cs (1)
322return syntaxFormattingService.GetFormattingOptions(optionSet ?? workspace.CurrentSolution.Options, fallbackOptions: null);
Recommendations\Recommender.cs (1)
26var solution = workspace.CurrentSolution;
Workspace\AdhocWorkspace.cs (9)
62return this.CurrentSolution; 88return this.CurrentSolution.GetProject(projectInfo.Id); 148return this.CurrentSolution.GetDocument(documentInfo.Id); 156var doc = this.CurrentSolution.GetDocument(documentId); 169var doc = this.CurrentSolution.GetDocument(documentId); 184var doc = this.CurrentSolution.GetAdditionalDocument(documentId); 197var doc = this.CurrentSolution.GetAdditionalDocument(documentId); 212var doc = this.CurrentSolution.GetAnalyzerConfigDocument(documentId); 225var doc = this.CurrentSolution.GetAnalyzerConfigDocument(documentId);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (3)
286if (_documentAlreadyInWorkspace(_project._projectSystemProjectFactory.Workspace.CurrentSolution, documentId)) 338if (_project._projectSystemProjectFactory.Workspace.CurrentSolution.GetDocument(documentId) != null) 482var attributes = w.CurrentSolution.GetRequiredDocument(documentId).State.Attributes;
Workspace\ProjectSystem\ProjectSystemProject.cs (9)
254TryReportCompilationThrownAway(_projectSystemProjectFactory.Workspace.CurrentSolution.State, Id); 456private bool HasBeenRemoved => !_projectSystemProjectFactory.Workspace.CurrentSolution.ContainsProject(Id); 573var metadataReference = _projectSystemProjectFactory.Workspace.CurrentSolution.GetRequiredProject(Id).MetadataReferences.Cast<PortableExecutableReference>() 1134var metadataReference = w.CurrentSolution.GetRequiredProject(Id).MetadataReferences.Cast<PortableExecutableReference>() 1204return _projectSystemProjectFactory.Workspace.CurrentSolution.GetRequiredProject(Id).AllProjectReferences.Contains(projectReference); 1212var projectReferencesInWorkspace = _projectSystemProjectFactory.Workspace.CurrentSolution.GetRequiredProject(Id).AllProjectReferences; 1262if (!_projectSystemProjectFactory.Workspace.CurrentSolution.ContainsProject(Id)) 1288remainingMetadataReferences = w.CurrentSolution.GetRequiredProject(Id).MetadataReferences; 1292if (w.CurrentSolution.ProjectIds.Count == 1)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (7)
117if (w.CurrentSolution.ProjectIds.Count == 0) 125analyzerReferences: w.CurrentSolution.AnalyzerReferences) 229var solutionChanges = new SolutionChangeAccumulator(Workspace.CurrentSolution); 274var project = Workspace.CurrentSolution.GetRequiredProject(projectId); 280var solutionChanges = new SolutionChangeAccumulator(Workspace.CurrentSolution); 532if (CanConvertMetadataReferenceToProjectReference(Workspace.CurrentSolution, referencingProject, projectIdToReference)) 624foreach (var project in Workspace.CurrentSolution.Projects)
Workspace\TextExtensions.cs (4)
29var solution = workspace.CurrentSolution; 65var solution = workspace.CurrentSolution; 116var solution = workspace.CurrentSolution; 137return workspace.CurrentSolution.GetDocument(id);
Workspace\Workspace.cs (37)
149/// Sets the <see cref="CurrentSolution"/> of this workspace. This method does not raise a <see cref="WorkspaceChanged"/> event. 159/// Sets the <see cref="CurrentSolution"/> of this workspace. This method does not raise a <see 174var oldSolution = this.CurrentSolution; 206/// Applies specified transformation to <see cref="CurrentSolution"/>, updates <see cref="CurrentSolution"/> to 218/// <returns>True if <see cref="CurrentSolution"/> was set to the transformed solution, false if the 321/// Applies specified transformation to <see cref="CurrentSolution"/>, updates <see cref="CurrentSolution"/> to 326/// <param name="onBeforeUpdate">Action to perform immediately prior to updating <see cref="CurrentSolution"/>. 327/// The action will be passed the old <see cref="CurrentSolution"/> that will be replaced and the exact solution 331/// <param name="onAfterUpdate">Action to perform once <see cref="CurrentSolution"/> has been updated. The 332/// action will be passed the old <see cref="CurrentSolution"/> that was just replaced and the exact solution it 385/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>. 391return this.CurrentSolution.Options; 1288var oldSolution = this.CurrentSolution; 1339if (this.CurrentSolution.Options != newSolution.Options) 1345if (!CurrentSolution.AnalyzerReferences.SequenceEqual(newSolution.AnalyzerReferences)) 1815var oldProject = CurrentSolution.GetRequiredProject(projectId); 1833var oldProject = CurrentSolution.GetRequiredProject(projectId); 2047=> CheckSolutionIsEmpty(this.CurrentSolution); 2061=> CheckProjectIsInSolution(this.CurrentSolution, projectId); 2077=> CheckProjectIsNotInSolution(this.CurrentSolution, projectId); 2094if (!this.CurrentSolution.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference)) 2107if (this.CurrentSolution.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference)) 2120var transitiveReferences = this.CurrentSolution.GetProjectDependencyGraph().GetProjectsThatThisProjectTransitivelyDependsOn(toProjectId); 2134if (!this.CurrentSolution.GetProject(projectId)!.MetadataReferences.Contains(metadataReference)) 2145if (this.CurrentSolution.GetProject(projectId)!.MetadataReferences.Contains(metadataReference)) 2156if (!this.CurrentSolution.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference)) 2167if (this.CurrentSolution.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference)) 2199=> CheckDocumentIsInSolution(this.CurrentSolution, documentId); 2215=> CheckAdditionalDocumentIsInSolution(this.CurrentSolution, documentId); 2231=> CheckAnalyzerConfigDocumentIsInSolution(this.CurrentSolution, documentId); 2248if (this.CurrentSolution.ContainsDocument(documentId)) 2260=> CheckAdditionalDocumentIsNotInSolution(this.CurrentSolution, documentId); 2276=> CheckAnalyzerConfigDocumentIsNotInSolution(this.CurrentSolution, documentId); 2293var project = this.CurrentSolution.GetProject(projectId); 2303var document = this.CurrentSolution.GetTextDocument(documentId);
Workspace\Workspace_Editor.cs (2)
217/// Gets the ids for documents in the <see cref="CurrentSolution"/> snapshot associated with the given <paramref name="container"/>. 233return CurrentSolution.GetRelatedDocumentIds(documentId);
Workspace\Workspace_Events.cs (1)
231var currentSolution = this.CurrentSolution;
Microsoft.CodeAnalysis.Workspaces.MSBuild (11)
MSBuild\MSBuildWorkspace.cs (10)
211return this.CurrentSolution; 250var projectMap = ProjectMap.Create(this.CurrentSolution); 261var projectResult = this.CurrentSolution.GetProject(projects[0].Id); 369var document = this.CurrentSolution.GetDocument(documentId); 387var document = this.CurrentSolution.GetAdditionalDocument(documentId); 435var project = this.CurrentSolution.GetProject(info.Id.ProjectId); 497var document = this.CurrentSolution.GetDocument(documentId); 561var project = this.CurrentSolution.GetProject(projectId); 586var project = this.CurrentSolution.GetProject(projectReference.ProjectId); 599var 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.CodeAnalysis.Workspaces.MSBuild.UnitTests (47)
NetCoreTests.cs (20)
85Assert.Single(workspace.CurrentSolution.ProjectIds); 111Assert.Single(workspace.CurrentSolution.ProjectIds); 122Assert.Equal(2, workspace.CurrentSolution.ProjectIds.Count); 129Assert.Equal(libraryProject.FilePath, workspace.CurrentSolution.GetProject(projectRefId).FilePath); 151Assert.Equal(2, workspace.CurrentSolution.ProjectIds.Count); 162Assert.Equal(3, workspace.CurrentSolution.ProjectIds.Count); 195Assert.Equal(3, workspace.CurrentSolution.ProjectIds.Count); 200foreach (var project in workspace.CurrentSolution.Projects) 213foreach (var project in workspace.CurrentSolution.Projects) 239Assert.Equal(3, workspace.CurrentSolution.ProjectIds.Count); 243foreach (var project in workspace.CurrentSolution.Projects) 289Assert.Equal(4, workspace.CurrentSolution.ProjectIds.Count); 294foreach (var project in workspace.CurrentSolution.Projects) 316foreach (var project in workspace.CurrentSolution.Projects) 352var projects = workspace.CurrentSolution.Projects.Where(p => p.FilePath.EndsWith("Project.csproj")); 357var referencedProject = workspace.CurrentSolution.GetProject(projectReference.ProjectId); 450Assert.Equal(2, workspace.CurrentSolution.ProjectIds.Count); 452Assert.Contains(workspace.CurrentSolution.Projects, p => p.Name == "Library(net6)"); 453Assert.Contains(workspace.CurrentSolution.Projects, p => p.Name == "Library(net5)"); 475Assert.Equal(2, workspace.CurrentSolution.ProjectIds.Count);
VisualStudioMSBuildWorkspaceTests.cs (27)
1433vbProject = workspace.CurrentSolution.GetProject(vbProject.Id); 2006var solution2 = workspace.CurrentSolution; 2026var projectB = workspaceB.CurrentSolution.GetProjectsByName("CSharpProject").FirstOrDefault(); 2049var solution2 = workspace.CurrentSolution; 2082var solution2 = workspace.CurrentSolution; 2111var solution2 = workspace.CurrentSolution; 2138var solution2 = workspace.CurrentSolution; 2164var solution2 = workspace.CurrentSolution; 2194workspace.TryApplyChanges(workspace.CurrentSolution.AddAdditionalDocument(DocumentId.CreateNewId(csProjectId), "foo.xaml", SourceText.From("<foo></foo>"))); 2197var xaml = workspace.CurrentSolution.GetProject(csProjectId).AdditionalDocuments.FirstOrDefault(d => d.Name == "XamlFile.xaml"); 2204workspace.TryApplyChanges(workspace.CurrentSolution.RemoveAdditionalDocument(xaml.Id)); 2217var originalSolution = workspace.CurrentSolution; 2226var doc = workspace.CurrentSolution.Projects.First().Documents.First(); 2230workspace.TryApplyChanges(workspace.CurrentSolution.WithDocumentText(doc.Id, SourceText.From(newText), PreservationMode.PreserveIdentity)); 2247var originalSolution = workspace.CurrentSolution; 2256var doc = workspace.CurrentSolution.Projects.First().Documents.First(); 2262.CurrentSolution 2292Assert.Equal(2, workspace.CurrentSolution.Projects.Count()); 2322Assert.Equal(2, workspace.CurrentSolution.Projects.Count()); 2552var csproject = workspace.CurrentSolution.Projects.First(p => p.Language == LanguageNames.CSharp); 2560var vbproject = workspace.CurrentSolution.Projects.First(p => p.Language == LanguageNames.VisualBasic); 2911workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).RemoveAnalyzerReference(aref).Solution); 2932workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).RemoveProjectReference(pref).Solution); 2933Assert.Empty(workspace.CurrentSolution.GetProject(project.Id).ProjectReferences); 2939workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).AddProjectReference(pref).Solution); 2940Assert.Single(workspace.CurrentSolution.GetProject(project.Id).ProjectReferences); 3226Assert.Equal(0, workspace.CurrentSolution.ProjectIds.Count);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (4)
Formatting\FormattingTestBase.cs (1)
48var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", language);
WorkspaceExtensions.cs (3)
18var oldSolution = workspace.CurrentSolution; 26var oldSolution = workspace.CurrentSolution; 33var oldSolution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.Workspaces.UnitTests (290)
CodeCleanup\AddMissingTokensTests.cs (1)
2729var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\CodeCleanupTests.cs (1)
421var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\FixIncorrectTokenTests.cs (1)
754var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\NormalizeModifiersOrOperatorsTests.cs (1)
1030var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\ReduceTokenTests.cs (1)
2018var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\RemoveUnnecessaryLineContinuationTests.cs (1)
1388var solution = new AdhocWorkspace().CurrentSolution;
CommandLineProject\CommandLineProjectWorkspaceTests.cs (2)
31var project = ws.CurrentSolution.GetProject(info.Id); 59var project = ws.CurrentSolution.GetProject(info.Id);
FindAllDeclarationsTests.cs (3)
133var solution = workspace.CurrentSolution; 156var solution = workspace.CurrentSolution; 699var solution = workspace.CurrentSolution
FindAllDeclarationsTests.TestSolutionsAndProject.cs (2)
96solution = workspace.CurrentSolution 111solution = workspace.CurrentSolution;
FindReferencesTests.cs (8)
46return workspace.CurrentSolution 56var solution = workspace.CurrentSolution 105var solution = workspace.CurrentSolution 155var sln = CreateWorkspace().CurrentSolution 194var sln = CreateWorkspace().CurrentSolution 258var sln = CreateWorkspace().CurrentSolution 346var solution = CreateWorkspace().CurrentSolution; 439var solution = CreateWorkspace().CurrentSolution;
Formatter\FormatterTests.cs (3)
73var solutionOptions = workspace.CurrentSolution.Options. 127var updatedSolutionOptions = OptionsTestHelpers.GetOptionSetWithChangedOptions(workspace.CurrentSolution.Options, OptionsTestHelpers.PublicFormattingOptionsWithNonDefaultValues); 128var solutionWithUpdatedOptions = workspace.CurrentSolution.WithOptions(updatedSolutionOptions);
GeneratedCodeRecognitionTests.cs (1)
101return new AdhocWorkspace().CurrentSolution
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (1)
20var solution = workspace.CurrentSolution;
SemanticModelReuse\SemanticModelReuseTests.cs (1)
24var solution = new AdhocWorkspace().CurrentSolution;
SerializationTests.cs (1)
30var solution = new AdhocWorkspace().CurrentSolution
Simplifier\SimplifierTests.cs (2)
83var updatedOptions = GetOptionSetWithChangedPublicOptions(workspace.CurrentSolution.Options); 92var solutionWithUpdatedOptions = workspace.CurrentSolution.WithOptions(updatedOptions);
SolutionTests\ProjectDependencyGraphTests.cs (1)
741=> new AdhocWorkspace().CurrentSolution;
SolutionTests\ProjectSemanticVersionTests.cs (18)
22var project = AddEmptyProject(workspace.CurrentSolution); 31var project = AddEmptyProject(workspace.CurrentSolution) 41var document = AddEmptyProject(workspace.CurrentSolution) 55var document = AddEmptyProject(workspace.CurrentSolution) 69var document = AddEmptyProject(workspace.CurrentSolution) 83var document = AddEmptyProject(workspace.CurrentSolution) 97var document = AddEmptyProject(workspace.CurrentSolution) 111var document = AddEmptyProject(workspace.CurrentSolution) 125var document = AddEmptyProject(workspace.CurrentSolution) 139var document = AddEmptyProject(workspace.CurrentSolution) 153var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 167var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 181var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 195var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 209var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 223var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 237var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 251var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic)
SolutionTests\SolutionTests.cs (142)
54Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution 76Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution 113var solution = workspace.CurrentSolution; 122var solution = workspace.CurrentSolution; 132var solution = workspace.CurrentSolution; 141var solution = workspace.CurrentSolution; 151var solution = workspace.CurrentSolution; 160var solution = workspace.CurrentSolution; 170var solution = workspace.CurrentSolution; 190var solution = workspace.CurrentSolution; 221var solution = workspace.CurrentSolution; 248var solution = workspace.CurrentSolution; 266var solution = workspace.CurrentSolution; 277var solution = workspace.CurrentSolution; 307var solution = workspace.CurrentSolution 323var solution = workspace.CurrentSolution; 348var solution = workspace.CurrentSolution; 372var solution = workspace.CurrentSolution; 405var solution = workspace.CurrentSolution; 452solution = workspace.CurrentSolution; 493var solution = workspace.CurrentSolution; 540solution = workspace.CurrentSolution; 572var solution = workspace.CurrentSolution; 626solution = workspace.CurrentSolution; 658var solution = workspace.CurrentSolution; 706solution = workspace.CurrentSolution; 735var solution = workspace.CurrentSolution; 782solution = workspace.CurrentSolution; 806var solution = workspace.CurrentSolution; 828var solution = workspace.CurrentSolution; 852var solution = workspace.CurrentSolution; 874var solution = workspace.CurrentSolution; 898var solution = workspace.CurrentSolution; 920var solution = workspace.CurrentSolution; 942var solution = workspace.CurrentSolution; 966var solution = workspace.CurrentSolution 988var solution = workspace.CurrentSolution 1011var solution = workspace.CurrentSolution 1034var solution = workspace.CurrentSolution 1057var solution = workspace.CurrentSolution. 1080var solution = workspace.CurrentSolution. 1116var solution = workspace.CurrentSolution 1170var solution = workspace.CurrentSolution 1193var solution = workspace.CurrentSolution 1216var solution = workspace.CurrentSolution 1233var solution = workspace.CurrentSolution 1258var solution = workspace.CurrentSolution 1281var document = workspace.CurrentSolution 1315var document = workspace.CurrentSolution 1346var solution = workspace.CurrentSolution; 1379var solution = workspace.CurrentSolution; 1395var solution = workspace.CurrentSolution; 1437var solution = workspace.CurrentSolution; 1472var solution = workspace.CurrentSolution; 1508var solution = workspace.CurrentSolution; 1526var solution = workspace.CurrentSolution; 1551var solution = workspace.CurrentSolution; 1578var solution = workspace.CurrentSolution; 1596var solution = workspace.CurrentSolution; 1624var solution = workspace.CurrentSolution; 1651var solution = workspace.CurrentSolution; 1665var solution = workspace.CurrentSolution; 1691var solution = workspace.CurrentSolution; 1714var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 1740var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 1770var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 1799var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 1828var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 1859var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 1882var solution = workspace.CurrentSolution; 1895var solution = workspace.CurrentSolution; 1907var solution = workspace.CurrentSolution; 1922var solution = workspace.CurrentSolution 1968var solution = workspace.CurrentSolution 1992var solution = workspace.CurrentSolution 2020var solution = workspace.CurrentSolution 2030var solution = workspace.CurrentSolution; 2044var solution = workspace.CurrentSolution 2065var solution = workspace.CurrentSolution 2086var solution = workspace.CurrentSolution 2105var solution = workspace.CurrentSolution 2124var solution = workspace.CurrentSolution 2139var solution = workspace.CurrentSolution 2158var solution = workspace.CurrentSolution 2175var solution = workspace.CurrentSolution 2274var solution = workspace.CurrentSolution; 2295var solution = workspace.CurrentSolution; 2333var solution = workspace.CurrentSolution; 2391var solution = workspace.CurrentSolution; 2409var sol = workspace.CurrentSolution; 2428var sol = workspace.CurrentSolution; 2454var sol = workspace.CurrentSolution; 2490var sol = workspace.CurrentSolution 2511var solution1 = workspace.CurrentSolution 2534var sol = workspace.CurrentSolution 2575var sol = workspace.CurrentSolution 2616var solution = workspace.CurrentSolution 2647var sol = workspace.CurrentSolution; 2688var sol = workspace.CurrentSolution 2710var sol = workspace.CurrentSolution 2731var sol = workspace.CurrentSolution 2755var sol = workspace.CurrentSolution 2777var sol = workspace.CurrentSolution 2798var sol = workspace.CurrentSolution 2818var sol = workspace.CurrentSolution 2838var sol = workspace.CurrentSolution 2858var sol = workspace.CurrentSolution 2877var sol = workspace.CurrentSolution 2908var sol = workspace.CurrentSolution 2940var sol = workspace.CurrentSolution 2966var sol = workspace.CurrentSolution 3000var sol = workspace.CurrentSolution 3030var sol = workspace.CurrentSolution 3081var sol = workspace.CurrentSolution 3106var sol = workspace.CurrentSolution 3133var sol = workspace.CurrentSolution 3267var solution = workspace.CurrentSolution; 3319var solution = new AdhocWorkspace().CurrentSolution 3434var project = workspace.CurrentSolution.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp); 3459var project = workspace.CurrentSolution.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp); 3504var project = workspace.CurrentSolution.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp); 3582var project = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 3600var project = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 3617var project = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 3639var project = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 3663var document = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 3680var solution = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).Solution; 3793var solution = workspace.CurrentSolution; 3809var solution = workspace.CurrentSolution; 3880var solution = workspace.CurrentSolution; 3918var solution = workspace.CurrentSolution; 3955var solution = workspace.CurrentSolution; 3997var solution = workspace.CurrentSolution; 4043var solution = workspace.CurrentSolution; 4074var solution = workspace.CurrentSolution; 4125var solution = workspace.CurrentSolution; 4146var solution = workspace.CurrentSolution; 4164var solution = workspace.CurrentSolution; 4257var s0 = workspace.CurrentSolution; 4303var solution = workspace.CurrentSolution.AddProject(projInfo); 4332var solution = workspace.CurrentSolution; 4386var solution = workspace.CurrentSolution
SolutionTests\SolutionWithSourceGeneratorTests.cs (33)
39var project = AddEmptyProject(workspace.CurrentSolution) 80var project = AddEmptyProject(workspace.CurrentSolution) 128var project = AddEmptyProject(workspace.CurrentSolution) 155var project = AddEmptyProject(workspace.CurrentSolution) 172var project = AddEmptyProject(workspace.CurrentSolution) 244var project = AddEmptyProject(workspace.CurrentSolution) 284var project = AddEmptyProject(workspace.CurrentSolution) 327var project = AddEmptyProject(workspace.CurrentSolution) 348var projectBeforeChange = AddEmptyProject(workspace.CurrentSolution) 371var solutionWithProjects = AddProjectWithReference(workspace.CurrentSolution, analyzerReference); 400var solution = AddEmptyProject(workspace.CurrentSolution) 425var project = AddEmptyProject(workspace.CurrentSolution) 439var project = AddEmptyProject(workspace.CurrentSolution) 462var project = AddEmptyProject(workspace.CurrentSolution) 482var project = AddEmptyProject(workspace.CurrentSolution) 509var project = AddEmptyProject(workspace.CurrentSolution) 557var project = AddEmptyProject(workspace.CurrentSolution); 570var project = AddEmptyProject(workspace.CurrentSolution) 582Assert.NotSame(workspace.CurrentSolution, generatedDocument.Project.Solution); 594var project = AddEmptyProject(workspace.CurrentSolution) 599var generatedDocument = Assert.Single(await workspace.CurrentSolution.Projects.Single().GetSourceGeneratedDocumentsAsync()); 605Assert.Same(workspace.CurrentSolution, generatedDocument!.Project.Solution); 613var originalAdditionalFile = AddEmptyProject(workspace.CurrentSolution) 626Assert.Empty(await workspace.CurrentSolution.Projects.Single().GetSourceGeneratedDocumentsAsync()); 641var solution = AddEmptyProject(workspace.CurrentSolution) 650var generatedDocument = Assert.Single(await workspace.CurrentSolution.GetRequiredProject(projectIdWithGenerator).GetSourceGeneratedDocumentsAsync()); 672var project = AddEmptyProject(workspace.CurrentSolution) 684var document = await workspace.CurrentSolution.GetSourceGeneratedDocumentAsync(generatedDocument.Identity.DocumentId, CancellationToken.None); 700var project = AddEmptyProject(workspace.CurrentSolution) 706var documentToFreeze = workspace.CurrentSolution.Projects.Single().Documents.Single(); 731var project = AddEmptyProject(workspace.CurrentSolution) 760var originalDocument1 = AddEmptyProject(workspace.CurrentSolution, name: "Project1") 796var project = AddEmptyProject(workspace.CurrentSolution);
SolutionTests\SourceGeneratorTelemetryCollectorWorkspaceServiceTests.cs (1)
32var project = AddEmptyProject(workspace.CurrentSolution)
SolutionTests\TryApplyChangesTests.cs (7)
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)
806document = workspace.CurrentSolution.GetDocument(document.Id); 853document = workspace.CurrentSolution.GetDocument(document.Id);
SyntaxNodeTests.cs (1)
87var sol = new AdhocWorkspace().CurrentSolution
SyntaxReferenceTests.cs (6)
58var solution = AddSingleFileCSharpProject(workspace.CurrentSolution, @" 81var solution = AddSingleFileVisualBasicProject(workspace.CurrentSolution, @" 103var solution = AddSingleFileCSharpProject(workspace.CurrentSolution, @" 126var solution = AddSingleFileVisualBasicProject(workspace.CurrentSolution, @" 149var solution = AddSingleFileCSharpProject(workspace.CurrentSolution, @" 177var solution = AddSingleFileVisualBasicProject(workspace.CurrentSolution, @"
WorkspaceServiceTests\GlobalOptionServiceTests.cs (15)
75var newSolution1 = workspace1.CurrentSolution.WithOptions(newSet); 80var oldSolution2 = workspace2.CurrentSolution; 86var newSolution2 = workspace2.CurrentSolution; 106var newSolution1 = workspace1.CurrentSolution.WithOptions(newSet); 110var oldSolution2 = workspace2.CurrentSolution; 115Assert.Equal("EOLN", workspace1.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey)); 116Assert.Equal("EOLN", workspace2.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey)); 122Assert.Equal("EOLN", workspace1.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey)); 123Assert.Equal("EOLN", workspace2.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey)); 130Assert.Equal("NEW_LINE", workspace1.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey)); 131Assert.Equal("NEW_LINE", workspace2.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey)); 136Assert.Equal("NEW_LINE", workspace1.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey)); 137Assert.Equal("NEW_LINE", workspace2.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey)); 141Assert.Equal("NEW_LINE2", workspace1.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey)); 142Assert.Equal("NEW_LINE2", workspace2.CurrentSolution.Options.GetOption<string>(perLanguageOptionKey));
WorkspaceTests\AdhocWorkspaceTests.cs (30)
40Assert.Equal(project, ws.CurrentSolution.Projects.FirstOrDefault()); 52Assert.Same(project, ws.CurrentSolution.Projects.FirstOrDefault()); 65Assert.Equal(ws.CurrentSolution.GetDocument(info.Id), doc); 97Assert.Same(ws.CurrentSolution, solution); 131var solution = ws.CurrentSolution; 168var newSolution = ws.CurrentSolution.AddProject(projInfo); 170Assert.Equal(0, ws.CurrentSolution.Projects.Count()); 175Assert.Equal(1, ws.CurrentSolution.Projects.Count()); 176var proj = ws.CurrentSolution.Projects.First(); 201Assert.Equal(1, ws.CurrentSolution.Projects.Count()); 203var newSolution = ws.CurrentSolution.RemoveProject(pid); 209Assert.Equal(0, ws.CurrentSolution.Projects.Count()); 229var doc = ws.CurrentSolution.GetDocument(docInfo.Id); 234doc = ws.CurrentSolution.GetDocument(docInfo.Id); 242doc = ws.CurrentSolution.GetDocument(docInfo.Id); 263var doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.Id); 268doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.Id); 276doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.Id); 303var doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.Id); 308doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.Id); 316doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.Id); 357var doc = ws.CurrentSolution.GetDocument(docInfo.Id); 405var pws = new WorkspaceWithPartialSemantics(ws.CurrentSolution); 406var proj = pws.CurrentSolution.GetProject(projid); 414var frozen = pws.CurrentSolution.GetDocument(docid1).WithFrozenPartialSemantics(CancellationToken.None); 458var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id); 491var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id); 525var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id); 556var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id); 586var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id);
WorkspaceTests\WorkspaceTests.cs (4)
109var newSolution = ws.CurrentSolution.WithAnalyzerReferences(new[] { new TestAnalyzerReference() }); 147return this.CurrentSolution.GetProject(projectInfo.Id); 185return this.CurrentSolution.GetDocument(documentInfo.Id); 193var solution = workspace1.CurrentSolution;
Microsoft.VisualStudio.LanguageServices (124)
AnalyzerDependency\AnalyzerDependencyCheckingService.cs (1)
80var solution = _workspace.CurrentSolution;
AnalyzerDependency\AnalyzerFileWatcherService.cs (2)
66var project = _workspace.CurrentSolution.GetProject(projectId); 157foreach (var project in _workspace.CurrentSolution.Projects)
CallHierarchy\CallHierarchyDetail.cs (2)
38_documentId = workspace.CurrentSolution.GetDocumentId(location.SourceTree); 76var solution = _workspace.CurrentSolution;
CallHierarchy\Finders\AbstractCallFinder.cs (1)
94var project = workspace.CurrentSolution.GetProject(_projectId);
CodeCleanup\AbstractCodeCleanUpFixer.cs (3)
77return await FixSolutionAsync(_workspace.CurrentSolution, context).ConfigureAwait(true); 108var project = _workspace.CurrentSolution.GetProject(projectId); 130var solution = _workspace.CurrentSolution;
CodeLens\CodeLensCallbackListener.cs (5)
64var solution = _workspace.CurrentSolution; 81var solution = _workspace.CurrentSolution; 107var solution = _workspace.CurrentSolution; 129var solution = _workspace.CurrentSolution; 229return _workspace.CurrentSolution.GetDocumentAsync(documentId, includeSourceGenerated: true).AsTask();
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
114var solution = _workspace.CurrentSolution;
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (4)
90var currentSolution = _workspace.CurrentSolution; 191command.Text = GetBackgroundAnalysisScope(_workspace.CurrentSolution, _globalOptions) switch 307var solution = _workspace.CurrentSolution; 418return _workspace.CurrentSolution.GetProject(projectId);
Diagnostics\VisualStudioVenusSpanMappingService.cs (1)
87var solution = _workspace.CurrentSolution;
EditorConfigSettings\SettingsEditorControl.xaml.cs (1)
83var solution = _workspace.CurrentSolution;
EditorConfigSettings\SettingsEditorFactory.cs (2)
84if (!_workspace.CurrentSolution.Projects.Any(p => p.Language is LanguageNames.CSharp or LanguageNames.VisualBasic)) 91if (!_workspace.CurrentSolution.Projects.Any(p => p.AnalyzerConfigDocuments.Any(editorconfig => StringComparer.OrdinalIgnoreCase.Equals(editorconfig.FilePath, filePath))))
Extensions\VisualStudioWorkspaceImplExtensions.cs (1)
70var document = workspace.CurrentSolution.GetDocument(id);
Implementation\AbstractEditorFactory.cs (1)
295var solution = workspace.CurrentSolution;
Implementation\HierarchyItemToProjectIdMap.cs (1)
37var candidateProjects = _workspace.CurrentSolution.Projects
Implementation\VisualStudioSupportsFeatureService.cs (1)
62return SupportsRenameWorker(workspace.CurrentSolution.GetRelatedDocumentIds(documentId));
Implementation\VsRefactorNotifyService.cs (1)
191var document = visualStudioWorkspace.CurrentSolution.GetDocument(documentId);
InheritanceMargin\MarginGlyph\InheritanceMarginContextMenu.xaml.cs (1)
67var rehydrated = await viewModel.DefinitionItem.TryRehydrateAsync(_workspace.CurrentSolution, cancellationToken).ConfigureAwait(false);
Interactive\VsResetInteractive.cs (1)
166=> _workspace.CurrentSolution.Projects.FirstOrDefault(proj => _workspace.GetHierarchy(proj.Id) == hierarchy);
LanguageService\AbstractCreateServicesOnTextViewConnection.cs (1)
86else if (Workspace.CurrentSolution.GetProject(projectId) is Project project)
LanguageService\AbstractLanguageService`2.VsLanguageDebugInfo.cs (1)
211var solution = _languageService.Workspace.CurrentSolution;
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (4)
188=> this.Workspace.CurrentSolution.GetProject(projectId); 313var projectAndAssemblySet = this.GetAssemblySet(this.Workspace.CurrentSolution, _languageName, CancellationToken.None); 324return new ObjectList(ObjectListKind.Projects, flags, this, this.GetProjectListItems(this.Workspace.CurrentSolution, _languageName, flags)); 483var project = this.Workspace.CurrentSolution.GetProject(symbolListItem.ProjectId);
Library\ObjectBrowser\ObjectList.cs (3)
683var project = this.LibraryManager.Workspace.CurrentSolution.GetProject(symbolListItem.ProjectId); 757var project = this.LibraryManager.Workspace.CurrentSolution.GetProject(symbolItem.ProjectId); 915var project = this.LibraryManager.Workspace.CurrentSolution.GetProject(projectListItem.ProjectId);
Library\ObjectBrowser\ObjectListItem.cs (1)
89var project = workspace.CurrentSolution.GetProject(_projectId);
NavigateTo\RoslynSearchItemsSource.cs (1)
73_provider._workspace.CurrentSolution,
Packaging\PackageInstallerServiceFactory.cs (1)
482var solution = Workspace.CurrentSolution;
Preview\PreviewUpdater.cs (2)
59var existingDocument = _previewWorkspace.CurrentSolution.GetRequiredTextDocument(_currentDocumentId); 70var currentDocument = _previewWorkspace.CurrentSolution.GetRequiredTextDocument(_currentDocumentId);
Progression\GraphNavigatorExtension.cs (1)
57var solution = _workspace.CurrentSolution;
Progression\GraphQueryManager.cs (2)
63var solution = _workspace.CurrentSolution; 104var solution = _workspace.CurrentSolution;
ProjectSystem\Legacy\AbstractLegacyProject.cs (1)
95foreach (var projectId in Workspace.CurrentSolution.ProjectIds)
ProjectSystem\VisualStudioWorkspace.cs (1)
101=> CurrentSolution.GetTextDocument(documentId)?.FilePath;
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
30var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (2)
32var currentSolution = Workspace.CurrentSolution; 45var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
30var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (2)
30var currentSolution = Workspace.CurrentSolution; 45var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.cs (10)
304var document = _threadingContext.JoinableTaskFactory.Run(() => CurrentSolution.GetDocumentAsync(documentId, includeSourceGenerated: true).AsTask()); 329var currentSolution = this.CurrentSolution; 502var originalProject = CurrentSolution.GetRequiredProject(projectId); 520var parseOptionsService = CurrentSolution.GetRequiredProject(projectId).Services.GetRequiredService<IParseOptionsChangingService>(); 953var document = this.CurrentSolution.GetTextDocument(documentId); 1034var document = this.CurrentSolution.GetTextDocument(documentId); 1150var textBuffer = this.CurrentSolution.GetTextDocument(documentId)!.GetTextSynchronously(CancellationToken.None).Container.TryGetTextBuffer(); 1167var document = CurrentSolution.GetRequiredDocument(documentId); 1261return CurrentSolution.GetRequiredProject(documentId.ProjectId).Language switch 1535uiContext.IsActive = this.CurrentSolution.Projects.Any(p => p.Language == language);
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (8)
139var documentIds = _projectSystemProjectFactory.Workspace.CurrentSolution.GetDocumentIdsWithFilePath(moniker); 170if (workspace.CurrentSolution.ContainsDocument(documentId)) 174else if (workspace.CurrentSolution.ContainsAdditionalDocument(documentId)) 180Debug.Assert(workspace.CurrentSolution.ContainsAnalyzerConfigDocument(documentId)); 213var solution = _workspace.CurrentSolution; 280var documentIds = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(moniker); 322var documentIds = w.CurrentSolution.GetDocumentIdsWithFilePath(moniker); 332var solution = w.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
31var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (2)
28var currentSolution = Workspace.CurrentSolution; 43var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs (2)
32var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(_filePath).FirstOrDefault(); 35var updatedSolution = _workspace.CurrentSolution.WithDocumentName(documentId, _toName);
StackTraceExplorer\StackFrameViewModel.cs (2)
218(_cachedDocument, _cachedLineNumber) = _stackExplorerService.GetDocumentAndLine(_workspace.CurrentSolution, _frame); 229_definitionCache[symbolPart] = await _stackExplorerService.TryFindDefinitionAsync(_workspace.CurrentSolution, _frame, symbolPart, cancellationToken).ConfigureAwait(false);
SyncNamespaces\SyncNamespacesCommandHandler.cs (5)
81visible = _workspace.CurrentSolution.Projects 110var projects = _workspace.CurrentSolution.Projects 122var solution = _workspace.CurrentSolution; 146if (_workspace.CurrentSolution.GetChanges(solution).GetProjectChanges().Any()) 156oldSolution: _workspace.CurrentSolution,
TableDataSource\AbstractTableEntriesSnapshot.cs (1)
184var solution = workspace.CurrentSolution;
TableDataSource\Extensions.cs (1)
25var solution = workspace.CurrentSolution;
TableDataSource\MiscellaneousDiagnosticListTable.cs (1)
55AddInitialTableSource(workspace.CurrentSolution, _source);
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
256foreach (var p in _workspace.CurrentSolution.Projects)
TableDataSource\Suppression\VisualStudioDiagnosticListTableCommandHandler.cs (1)
260project = _workspace.CurrentSolution.GetProject(selectedDiagnostic.ProjectId);
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (7)
161var solution = _workspace.CurrentSolution; 259var originalSolution = _workspace.CurrentSolution; 276var newSolution = _workspace.CurrentSolution; 368if (newSolution == _workspace.CurrentSolution) 377_workspace.CurrentSolution, 538var project = _workspace.CurrentSolution.GetProject(projectId); 628var project = _workspace.CurrentSolution.GetProject(projectId);
TableDataSource\TableItem.cs (1)
41projectName = (projectId == null) ? null : workspace.CurrentSolution.GetProject(projectId)?.Name ?? ServicesVSResources.Unknown2;
TableDataSource\TaskList\VisualStudioTaskListTable.cs (1)
41AddInitialTableSource(workspace.CurrentSolution, _source);
TableDataSource\VisualStudioDiagnosticListTable.BuildTableDataSource.cs (1)
239var solution = item.Workspace.CurrentSolution;
TableDataSource\VisualStudioDiagnosticListTable.cs (4)
101AddInitialTableSource(Workspace.CurrentSolution, GetCurrentDataSource()); 130AddInitialTableSource(workspace.CurrentSolution, new LiveTableDataSource(workspace, globalOptions, threadingContext, diagnosticService, IdentifierString)); 141AddInitialTableSource(workspace.CurrentSolution, new BuildTableDataSource(workspace, threadingContext, errorSource)); 197AddTableSourceIfNecessary(this.Workspace.CurrentSolution);
TaskList\ExternalErrorDiagnosticUpdateSource.cs (2)
183await ClearErrorsCoreAsync(projectId, _workspace.CurrentSolution, state).ConfigureAwait(false); 531_stateDoNotAccessDirectly = new InProgressState(this, _workspace.CurrentSolution, _activeCancellationSeriesDoNotAccessDirectly.CreateNext(_disposalToken));
TaskList\ProjectExternalErrorReporter.cs (3)
89var project = _workspace.CurrentSolution.GetProject(_projectId); 135return _workspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath) 327if (workspace.CurrentSolution.GetDocument(documentId) is Document document &&
TaskList\VisualStudioTaskListService.cs (1)
221TaskListUpdated?.Invoke(this, new TaskListUpdatedArgs(documentId, _workspace.CurrentSolution, documentId, newItems));
UnusedReferences\RemoveUnusedReferencesCommandHandler.cs (1)
182var solution = _workspace.CurrentSolution;
Utilities\IVsEditorAdaptersFactoryServiceExtensions.cs (1)
31var document = workspace.CurrentSolution.GetDocument(contextDocumentId);
Venus\ContainedDocument.cs (4)
187foreach (var document in _workspace.CurrentSolution.GetProject(_project.Id).Documents) 208return hierarchy.TryGetItemId(_workspace.CurrentSolution.GetDocument(document.Id).FilePath); 245var originalDocument = _workspace.CurrentSolution.GetDocument(this.Id); 766var document = _workspace.CurrentSolution.GetDocument(this.Id);
Venus\ContainedLanguage.cs (1)
159if (Workspace.CurrentSolution.ContainsDocument(ContainedDocument.Id))
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
62var solution = visualStudioWorkspace.CurrentSolution;
Workspace\SourceGeneratedFileManager.cs (1)
317var project = _workspace.CurrentSolution.GetProject(_documentIdentity.DocumentId.ProjectId);
Workspace\VisualStudioDocumentNavigationService.cs (5)
70var document = workspace.CurrentSolution.GetRequiredDocument(documentId); 88var document = workspace.CurrentSolution.GetRequiredDocument(documentId); 106var document = workspace.CurrentSolution.GetRequiredDocument(documentId); 242var solution = workspace.CurrentSolution; 311var document = workspace.CurrentSolution.GetDocument(documentId);
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService.cs (1)
648var project = state.Workspace.CurrentSolution.GetProject(projectId);
ProjectSystemShim\CSharpProjectShim.ICSharpProjectSite.cs (1)
123var project = Workspace.CurrentSolution.GetRequiredProject(ProjectSystemProject.Id);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (64)
CodeModel\AbstractFileCodeElementTests.cs (1)
52=> GetWorkspace().CurrentSolution;
CodeModel\FileCodeModelTestHelpers.cs (1)
36var project = workspace.CurrentSolution.Projects.Single();
DesignerAttribute\DesignerAttributeServiceTests.cs (1)
87var document = workspace.CurrentSolution.GetRequiredDocument(documentId);
DocumentOutline\DocumentOutlineTestsBase.cs (1)
117var solution = workspace.CurrentSolution;
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (1)
29Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution
EditorConfigSettings\DataProvider\DataProviderTests.cs (1)
29Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution
F1Help\F1HelpTests.cs (1)
32var actualText = await service.GetHelpTermAsync(workspace.CurrentSolution.Projects.First().Documents.First(), workspace.Documents.First().SelectedSpans.First(), CancellationToken.None);
Interactive\Commands\ResetInteractiveTests.cs (2)
54var project = workspace.CurrentSolution.Projects.FirstOrDefault(p => p.AssemblyName == "ResetInteractiveTestsAssembly"); 148workspace.CurrentSolution.GetProject(p.ProjectId)));
PersistentStorage\AbstractPersistentStorageTests.cs (3)
851var location = configuration.TryGetStorageLocation(SolutionKey.ToSolutionKey(workspace.CurrentSolution)); 990var solution = workspace.CurrentSolution; 1004return workspace.CurrentSolution;
ProjectSystemShim\CPS\AdditionalPropertiesTests.cs (5)
40=> environment.Workspace.CurrentSolution.Projects.Single().DefaultNamespace; 58var project = environment.Workspace.CurrentSolution.Projects.Single(); 87var project = environment.Workspace.CurrentSolution.Projects.Single(); 136Assert.Equal(expectedRunAnalyzers, environment.Workspace.CurrentSolution.Projects.Single().State.RunAnalyzers); 156Assert.Equal(expectedRunAnalyzers, environment.Workspace.CurrentSolution.Projects.Single().State.RunAnalyzers);
ProjectSystemShim\CPS\AnalyzersTests.cs (3)
34var workspaceProject = environment.Workspace.CurrentSolution.Projects.Single(); 41workspaceProject = environment.Workspace.CurrentSolution.Projects.Single(); 67var ca1012DiagnosticOption = environment.Workspace.CurrentSolution.Projects.Single().CompilationOptions.SpecificDiagnosticOptions["CA1012"];
ProjectSystemShim\CPS\CSharpCompilerOptionsTests.cs (5)
32var parseOptions = environment.Workspace.CurrentSolution.Projects.Single().ParseOptions; 41var parseOptions = environment.Workspace.CurrentSolution.Projects.Single().ParseOptions; 177Assert.Equal(SourceHashAlgorithms.Default, environment.Workspace.CurrentSolution.Projects.Single().State.ChecksumAlgorithm); 181var project = environment.Workspace.CurrentSolution.Projects.Single(); 182Assert.Equal(SourceHashAlgorithm.Sha1, environment.Workspace.CurrentSolution.Projects.Single().State.ChecksumAlgorithm);
ProjectSystemShim\CPS\CSharpReferencesTests.cs (7)
52.CurrentSolution.GetProject(project3.Id).ProjectReferences; 57return environment.Workspace.CurrentSolution.GetProject(project3.Id) 101Assert.Single(environment.Workspace.CurrentSolution.GetProject(project2.Id).AllProjectReferences); 105Assert.Empty(environment.Workspace.CurrentSolution.GetProject(project2.Id).AllProjectReferences); 106Assert.Single(environment.Workspace.CurrentSolution.GetProject(project2.Id).MetadataReferences); 122Assert.Empty(environment.Workspace.CurrentSolution.GetProject(project1.Id).AllProjectReferences); 139return environment.Workspace.CurrentSolution.Projects.Single()
ProjectSystemShim\CPS\SourceFileHandlingTests.cs (11)
30IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 49IEnumerable<TextDocument> GetCurrentAdditionalDocuments() => environment.Workspace.CurrentSolution.Projects.Single().AdditionalDocuments; 67IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 68VersionStamp GetVersion() => environment.Workspace.CurrentSolution.Projects.Single().Version; 117IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 158IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 211IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 250IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 289IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 325IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 374IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents;
ProjectSystemShim\LegacyProject\AnalyzersTests.cs (4)
61var projectId = environment.Workspace.CurrentSolution.ProjectIds.Single(); 80var workspaceProject = environment.Workspace.CurrentSolution.Projects.Single(); 87workspaceProject = environment.Workspace.CurrentSolution.Projects.Single(); 214var workspaceProject = environment.Workspace.CurrentSolution.Projects.Single();
ProjectSystemShim\LegacyProject\CSharpCompilerOptionsTests.cs (7)
36var workspaceProject = environment.Workspace.CurrentSolution.Projects.Single(); 50var workspaceProject = environment.Workspace.CurrentSolution.Projects.Single(); 64var workspaceProject = environment.Workspace.CurrentSolution.Projects.Single(); 114=> environment.Workspace.CurrentSolution.GetRequiredProject(project.Test_ProjectSystemProject.Id).CompilationOutputInfo.AssemblyPath; 147=> environment.Workspace.CurrentSolution.GetRequiredProject(project.Test_ProjectSystemProject.Id).CompilationOutputInfo.AssemblyPath; 190var project = environment.Workspace.CurrentSolution.Projects.Single(); 221var project = environment.Workspace.CurrentSolution.Projects.Single();
ProjectSystemShim\LegacyProject\OutputPathTests.cs (1)
35var workspaceProject = environment.Workspace.CurrentSolution.Projects.Single();
ProjectSystemShim\LegacyProject\SourceFileHandlingTests.cs (7)
30Assert.Empty(environment.Workspace.CurrentSolution.Projects.Single().Documents); 44var document = environment.Workspace.CurrentSolution.Projects.Single().Documents.Single(); 57var document = environment.Workspace.CurrentSolution.Projects.Single().Documents.Single(); 67var projectFolder = Path.GetDirectoryName(environment.Workspace.CurrentSolution.Projects.Single().FilePath); 71var document = environment.Workspace.CurrentSolution.Projects.Single().Documents.Single(); 81var projectFolder = Path.GetDirectoryName(environment.Workspace.CurrentSolution.Projects.Single().FilePath); 85var document = environment.Workspace.CurrentSolution.Projects.Single().Documents.Single();
ProjectSystemShim\LifetimeTests.cs (2)
25Assert.Single(environment.Workspace.CurrentSolution.Projects); 30Assert.Empty(environment.Workspace.CurrentSolution.Projects);
Microsoft.VisualStudio.LanguageServices.Implementation (38)
CodeModel\AbstractCodeModelService.cs (3)
272var project = state.Workspace.CurrentSolution.GetProject(projectId); 323var project = workspace.CurrentSolution.GetProject(projectId); 498var oldSolution = workspace.CurrentSolution;
CodeModel\CodeModelProjectCache.cs (1)
111var solution = State.Workspace.CurrentSolution;
CodeModel\CodeTypeRef.cs (1)
78var project = Workspace.CurrentSolution.GetProject(_projectId);
CodeModel\Collections\ExternalMemberCollection.cs (1)
47var project = this.State.Workspace.CurrentSolution.GetProject(_projectId);
CodeModel\Collections\ExternalNamespaceEnumerator.cs (1)
61var project = state.Workspace.CurrentSolution.GetProject(projectId);
CodeModel\Collections\OverloadsCollection.cs (1)
61var solution = this.Workspace.CurrentSolution;
CodeModel\Collections\PartialTypeCollection.cs (1)
52var solution = this.Workspace.CurrentSolution;
CodeModel\ExternalElements\AbstractExternalCodeElement.cs (1)
36var project = this.State.Workspace.CurrentSolution.GetProject(this.ProjectId);
CodeModel\FileCodeModel.cs (4)
119_previousDocument = Workspace.CurrentSolution.GetDocument(_documentId); 166var project = this.State.Workspace.CurrentSolution.GetProject(_incomingProjectId); 420() => Workspace.CurrentSolution.GetSourceGeneratedDocumentAsync(GetDocumentId(), CancellationToken.None).AsTask()); 424document = Workspace.CurrentSolution.GetDocument(GetDocumentId());
CodeModel\ProjectCodeModel.cs (1)
64var workspaceProject = _visualStudioWorkspace.CurrentSolution.GetProject(_projectId);
CodeModel\ProjectCodeModelFactory.cs (1)
95foreach (var (_, projectState) in _visualStudioWorkspace.CurrentSolution.State.ProjectStates)
CodeModel\RootCodeModel.cs (1)
40=> Workspace.CurrentSolution.GetProject(_projectId);
Options\AbstractOptionPreviewViewModel.cs (1)
119var project = workspace.CurrentSolution.AddProject(fileName, "assembly.dll", Language);
ProjectSystem\CPS\CPSProjectFactory.cs (1)
151ImmutableInterlocked.Update(ref _solutionsWithMissingChecksumAlgorithm, static (set, solutionPath) => set.Add(solutionPath), _workspace.CurrentSolution.FilePath ?? "");
ProjectSystem\CPS\TempPECompiler.cs (1)
42var project = _workspace.CurrentSolution.GetRequiredProject(context.Id);
RoslynVisualStudioWorkspace.cs (3)
62var textDocument = this.CurrentSolution.GetTextDocument(documentId); 99var currentProject = project.Solution.Workspace.CurrentSolution.GetProject(project.Id); 149var project = this.CurrentSolution.GetProject(projectId);
SolutionExplorer\AnalyzerItem\AnalyzerItemSource.cs (3)
86.CurrentSolution 141.CurrentSolution 162.CurrentSolution
SolutionExplorer\AnalyzersCommandHandler.cs (3)
280var project = workspace.CurrentSolution.GetProject(group.Key); 434var originalSolution = workspace.CurrentSolution; 444var project = workspace.CurrentSolution.GetProject(projectId);
SolutionExplorer\DiagnosticItem\BaseDiagnosticAndGeneratorItemSource.cs (2)
62var project = Workspace.CurrentSolution.GetProject(ProjectId); 80var project = Workspace.CurrentSolution.GetRequiredProject(ProjectId);
SolutionExplorer\DiagnosticItem\CpsDiagnosticItemSource.cs (3)
34_analyzerReference = TryGetAnalyzerReference(Workspace.CurrentSolution); 40if (workspace.CurrentSolution.ContainsProject(projectId)) 46var analyzerReference = TryGetAnalyzerReference(Workspace.CurrentSolution);
SolutionExplorer\SourceGeneratedFileItems\SourceGeneratedFileItemSource.cs (4)
173var solution = _workspace.CurrentSolution; 185if (_workspace.CurrentSolution != solution) 191new WorkspaceChangeEventArgs(WorkspaceChangeKind.SolutionChanged, solution, _workspace.CurrentSolution)); 248return UpdateSourceGeneratedFileItemsAsync(_workspace.CurrentSolution, cancellationToken);
Microsoft.VisualStudio.LanguageServices.LiveShare (11)
Client\RemoteDiagnosticListTable.cs (1)
44AddInitialTableSource(workspace.CurrentSolution, _source);
Client\RemoteLanguageServiceWorkspace.cs (10)
257var docId = CurrentSolution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(); 260return CurrentSolution.GetDocument(docId); 295var docId = CurrentSolution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(); 298return CurrentSolution.GetDocument(docId); 333var project = CurrentSolution.Projects.FirstOrDefault(p => p.Name == projectName && p.Language == language); 347project = CurrentSolution.GetRequiredProject(projectInfo.Id); 357return CurrentSolution.GetRequiredDocument(docInfo.Id); 386if (CurrentSolution.ContainsProject(id.ProjectId)) 402var doc = CurrentSolution.GetDocument(documentId); 492var document = CurrentSolution.GetDocument(documentId);
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (11)
CallHierarchy\CallHierarchyTestState.vb (1)
125Dim documents = Workspace.CurrentSolution.Projects.SelectMany(Function(p) p.Documents).Where(Function(d) documentNames.Contains(d.Name))
CodeModel\CodeModelTestHelpers.vb (2)
57Dim project = workspace.CurrentSolution.Projects.Single() 134Dim document = state.Workspace.CurrentSolution.GetDocument(cursorDocument.Id)
CodeModel\CodeModelTestState.vb (1)
91Dim projectId = Workspace.CurrentSolution.ProjectIds.Single()
CodeModel\Mocks\MockVisualStudioWorkspace.vb (6)
38SetCurrentSolutionEx(testWorkspace.CurrentSolution) 49Assert.True(_workspace.TryApplyChanges(_workspace.CurrentSolution.WithDocumentText(documentId, newText))) 50SetCurrentSolutionEx(_workspace.CurrentSolution) 55SetCurrentSolutionEx(_workspace.CurrentSolution) 59Assert.True(_workspace.TryApplyChanges(_workspace.CurrentSolution.RemoveDocument(documentId))) 60SetCurrentSolutionEx(_workspace.CurrentSolution)
ProjectSystemShim\Framework\TestEnvironment.vb (1)
167Return Workspace.CurrentSolution.Projects.Single().CompilationOptions
Microsoft.VisualStudio.LanguageServices.UnitTests (232)
CallHierarchy\CallHierarchyTests.vb (1)
324Dim document = testState.Workspace.CurrentSolution.GetRequiredDocument(mockNavigationService.ProvidedDocumentId)
ChangeSignature\AddParameterViewModelTests.vb (1)
301Dim workspaceDoc = workspace.CurrentSolution.GetDocument(doc.Id)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
460Dim workspaceDoc = workspace.CurrentSolution.GetDocument(doc.Id)
CodeModel\AbstractEventCollectorTests.vb (3)
104Dim project = workspace.CurrentSolution.Projects.First() 108Dim codeDocument = workspace.CurrentSolution.GetDocument(workspace.Documents(0).Id) 111Dim changeDocument = workspace.CurrentSolution.GetDocument(workspace.Documents(1).Id)
CodeModel\CSharp\FileCodeModelTests.vb (8)
976Dim project = state.VisualStudioWorkspace.CurrentSolution.Projects.First() 979Dim newSolution = state.VisualStudioWorkspace.CurrentSolution.RemoveDocument(documentId) 1019Dim originalDocument = originalWorkspaceAndFileCodeModel.Workspace.CurrentSolution.GetDocument(originalWorkspaceAndFileCodeModel.Workspace.Documents(0).Id) 1022Dim changeDocument = changedWorkspace.CurrentSolution.GetDocument(changedWorkspace.Documents(0).Id) 1208Dim docId = workspace.CurrentSolution.Projects(0).DocumentIds(0) 1209Dim textBeforeOperation = Await workspace.CurrentSolution.GetDocument(docId).GetTextAsync() 1222Dim solution = workspace.CurrentSolution 1301Dim projectCodeModel = projectCodeModelFactory.GetProjectCodeModel(workspace.CurrentSolution.ProjectIds.Single())
CodeModel\CSharp\SyntaxNodeKeyTests.vb (2)
231Dim project = workspace.CurrentSolution.Projects.First() 238Dim document = workspace.CurrentSolution.GetDocument(cursorDocument.Id)
CodeModel\VisualBasic\FileCodeModelTests.vb (3)
1016Dim originalDocument = originalWorkspaceAndFileCodeModel.Workspace.CurrentSolution.GetDocument(originalWorkspaceAndFileCodeModel.Workspace.Documents(0).Id) 1020Dim changeDocument = changedworkspace.CurrentSolution.GetDocument(changedworkspace.Documents.First(Function(d) d.Name.Equals("File1.vb")).Id) 1036changeDocument = changedworkspace.CurrentSolution.GetDocument(changedworkspace.Documents.First(Function(d) d.Name.Equals("File2.vb")).Id)
CommonControls\MemberSelectionViewModelTests.vb (1)
177Dim workspaceDoc = workspace.CurrentSolution.GetDocument(doc.Id)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
230Dim workspaceDoc = workspace.CurrentSolution.GetDocument(doc.Id)
DebuggerIntelliSense\TestState.vb (1)
38Dim language = Workspace.CurrentSolution.Projects.First().Language
Debugging\VisualBasicBreakpointResolutionServiceTests.vb (1)
28Dim document = workspace.CurrentSolution.Projects.First.Documents.First
Diagnostics\DefaultDiagnosticUpdateSourceTests.vb (16)
43workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 60Await analyzer.AnalyzeSyntaxAsync(workspace.CurrentSolution.Projects.First().Documents.First(), InvocationReasons.Empty, CancellationToken.None) 90workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 97Dim document = workspace.CurrentSolution.Projects.First().Documents.First() 129workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 136Dim document = workspace.CurrentSolution.Projects.First().Documents.First() 168workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 175Dim document = workspace.CurrentSolution.Projects.First().Documents.First() 208workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 215Dim document = workspace.CurrentSolution.Projects.First().Documents.First() 239workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 254Await analyzer.AnalyzeSyntaxAsync(workspace.CurrentSolution.Projects.First().Documents.First(), InvocationReasons.Empty, CancellationToken.None) 268workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 283Await analyzer.AnalyzeSyntaxAsync(workspace.CurrentSolution.Projects.First().Documents.First(), InvocationReasons.Empty, CancellationToken.None) 310workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 319Dim document = workspace.CurrentSolution.Projects.First().Documents.First()
Diagnostics\DiagnosticTableDataSourceTests.vb (47)
69Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 70Dim provider = New TestDiagnosticService(CreateItem(workspace.CurrentSolution, documentId)) 90Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 102provider.Items = New DiagnosticData() {CreateItem(workspace.CurrentSolution, documentId)} 117Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 119Dim item = CreateItem(workspace.CurrentSolution, documentId) 160Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 162Dim item = CreateItem(workspace.CurrentSolution, documentId) 210Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 212Dim item = CreateItem(workspace.CurrentSolution, documentId) 242Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 244Dim item = CreateItem(workspace.CurrentSolution, documentId, DiagnosticSeverity.Error) 245Dim item2 = CreateItem(workspace.CurrentSolution, documentId, DiagnosticSeverity.Hidden) 271Dim projectId = workspace.CurrentSolution.Projects.First().Id 273Dim item = CreateItem(workspace.CurrentSolution, projectId, Nothing, DiagnosticSeverity.Error) 298Dim documentId = workspace1.CurrentSolution.Projects.First().DocumentIds.First() 301Dim item1 = CreateItem(workspace1.CurrentSolution, projectId, documentId, DiagnosticSeverity.Error) 319Dim item2 = CreateItem(workspace2.CurrentSolution, projectId, documentId, DiagnosticSeverity.Error) 323Dim item3 = CreateItem(workspace1.CurrentSolution, projectId, Nothing, DiagnosticSeverity.Error) 336Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 339Dim item1 = CreateItem(workspace.CurrentSolution, projectId, documentId, DiagnosticSeverity.Error) 375Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 378Dim item1 = CreateItem(workspace.CurrentSolution, projectId, documentId, DiagnosticSeverity.Error, "http://link") 409Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 412Dim item1 = CreateItem(workspace.CurrentSolution, projectId, documentId, DiagnosticSeverity.Error) 443Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 446Dim item1 = CreateItem(workspace.CurrentSolution, projectId, documentId, DiagnosticSeverity.Error, "http://link/") 474Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 477Dim item1 = CreateItem(workspace.CurrentSolution, projectId, documentId, DiagnosticSeverity.Error, "http://link/") 478Dim item2 = CreateItem(workspace.CurrentSolution, projectId, documentId, DiagnosticSeverity.Error, customTags:={WellKnownDiagnosticCustomTags.DoesNotSupportF1Help}) 507Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 510Dim item1 = CreateItem(workspace.CurrentSolution, projectId, documentId, DiagnosticSeverity.Error, "http://link/") 538Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 541Dim item1 = CreateItem(workspace.CurrentSolution, Nothing, Nothing, DiagnosticSeverity.Error, "http://link/") 570Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 573Dim item1 = CreateItem(workspace.CurrentSolution, projectId, Nothing, DiagnosticSeverity.Error, "http://link/") 591Assert.Equal(workspace.CurrentSolution.GetProject(projectId).FilePath, filename) 616workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 678Dim document1 = workspace.CurrentSolution.Projects.First(Function(p) p.Name = "Proj1").Documents.First() 679Dim document2 = workspace.CurrentSolution.Projects.First(Function(p) p.Name = "Proj2").Documents.First() 681Dim diagnostic1 = CreateItem(workspace.CurrentSolution, document1.Id) 682Dim diagnostic2 = CreateItem(workspace.CurrentSolution, document2.Id) 755Dim snapshot = workspace.CurrentSolution 877New ErrorId(Me, id), workspace, workspace.CurrentSolution, item.ProjectId, item.DocumentId, items.ToImmutableArray())) 885New ErrorId(Me, group.Key), workspace, workspace.CurrentSolution, group.Key.ProjectId, group.Key, group.ToImmutableArrayOrEmpty())) 892New ErrorId(Me, group.Key), workspace, workspace.CurrentSolution, group.Key, Nothing, group.ToImmutableArrayOrEmpty())) 898New ErrorId(Me, documentId), workspace, workspace.CurrentSolution, projectId, documentId))
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (21)
54Dim project = workspace.CurrentSolution.Projects.First() 86workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 92Dim project = workspace.CurrentSolution.Projects.First() 109Dim project = workspace.CurrentSolution.Projects.First() 123Dim project = workspace.CurrentSolution.Projects.First() 157Dim project = workspace.CurrentSolution.Projects.First() 198Dim project = workspace.CurrentSolution.Projects.First() 247Dim project = workspace.CurrentSolution.Projects.First() 279workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 283Dim project = workspace.CurrentSolution.Projects.First() 331workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 335Dim project = workspace.CurrentSolution.Projects.First() 371workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 374Dim project = workspace.CurrentSolution.Projects.First() 408Dim projectId1 = workspace.CurrentSolution.ProjectIds(0) 409Dim projectId2 = workspace.CurrentSolution.ProjectIds(1) 445workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 450Dim project = workspace.CurrentSolution.Projects.First() 499workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 504Dim project = workspace.CurrentSolution.Projects.First() 565oldSolution:=workspace.CurrentSolution, newSolution:=document.Project.Solution, project.Id, document.Id))
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
293Dim workspaceDoc = workspace.CurrentSolution.GetDocument(doc.Id)
GenerateType\GenerateTypeViewModelTests.vb (1)
841Dim document = workspace.CurrentSolution.GetDocument(testDoc.Id)
GoToDefinition\GoToDefinitionApiTests.vb (1)
22Dim solution = workspace.CurrentSolution
Help\HelpTests.vb (1)
21Assert.Equal(expected, Await service.GetHelpTermAsync(workspace.CurrentSolution.Projects.First().Documents.First(), workspace.Documents.First().SelectedSpans.First(), CancellationToken.None))
InheritanceMargin\InheritanceMarginViewModelTests.vb (1)
81Dim document = workspace.CurrentSolution.GetDocument(testDocument.Id)
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (1)
27Dim workspaceDoc = workspace.CurrentSolution.GetDocument(doc.Id)
Preview\PreviewChangesTests.vb (11)
39Dim document = workspace.CurrentSolution.GetDocument(documentId) 51workspace.CurrentSolution, 93Dim document = workspace.CurrentSolution.GetDocument(docId) 112workspace.CurrentSolution, 136Dim document = workspace.CurrentSolution.GetDocument(documentId) 148workspace.CurrentSolution, 190Dim document = workspace.CurrentSolution.GetDocument(docId) 214workspace.CurrentSolution, 274Dim document1 = workspace.CurrentSolution.GetDocument(documentId1) 277Dim document2 = workspace.CurrentSolution.GetDocument(documentId2) 295workspace.CurrentSolution,
Progression\ProgressionTestState.vb (7)
29Dim graphBuilder As New GraphBuilder(Workspace.CurrentSolution) 31Assert.NotNull(graphBuilder.TryAddNodeForDocument(Workspace.CurrentSolution.GetDocument(documentId), CancellationToken.None)) 37Dim document = Workspace.CurrentSolution.GetDocument(hostDocument.Id) 44Dim graphBuilder As New GraphBuilder(Workspace.CurrentSolution) 51Dim graphBuilder = Await graphQuery.GetGraphAsync(Workspace.CurrentSolution, graphContext, CancellationToken.None) 79Dim document = Workspace.CurrentSolution.GetDocument(hostDocument.Id) 84Return Workspace.CurrentSolution
ProjectSystemShim\VisualBasicCodeModelLifetimeTests.vb (2)
28Dim originalDocumentId = environment.Workspace.CurrentSolution.Projects.Single().DocumentIds.Single() 38Dim newDocumentId = environment.Workspace.CurrentSolution.Projects.Single().DocumentIds.Single()
ProjectSystemShim\VisualBasicCompilerOptionsTests.vb (10)
25Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 44Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 63Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 86Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 109Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 129Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 149Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 168Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 188Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 196workspaceProject = environment.Workspace.CurrentSolution.Projects.Single()
ProjectSystemShim\VisualBasicProjectTests.vb (3)
20Assert.Equal(environment.Workspace.CurrentSolution.Projects.Single().Name, "Test") 24Assert.Equal(environment.Workspace.CurrentSolution.Projects.Single().Name, "Test2") 35Assert.Single(environment.Workspace.CurrentSolution.Projects)
ProjectSystemShim\VisualBasicSpecialReferencesTests.vb (10)
22Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 41Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 60Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 77Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 84workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 92workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 107Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 122Dim workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 128workspaceProject = environment.Workspace.CurrentSolution.Projects.Single() 134workspaceProject = environment.Workspace.CurrentSolution.Projects.Single()
ProjectSystemShim\VisualStudioProjectTests\AnalyzerReferenceTests.vb (11)
37Assert.Single(environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences) 52Dim analyzers = environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences.Single().GetAnalyzers(LanguageNames.CSharp) 76Dim analyzers = environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences.Single().GetAnalyzers(LanguageNames.CSharp) 98Dim analyzers = environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences.Single().GetAnalyzers(LanguageNames.CSharp) 138Assert.Empty(environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences) 143Assert.Empty(environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences) 158}, environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath)) 172}, environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath)) 182}, environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath)) 192}, environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath)) 217AssertEx.Equal({path1, path2}, environment.Workspace.CurrentSolution.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
ProjectSystemShim\VisualStudioProjectTests\DynamicFileTests.vb (4)
39Dim dynamicSourceFile = environment.Workspace.CurrentSolution.Projects.Single().Documents.Single() 47Assert.Empty(environment.Workspace.CurrentSolution.Projects.Single().Documents) 89Assert.Empty(environment.Workspace.CurrentSolution.Projects.Single().Documents) 93Assert.Empty(environment.Workspace.CurrentSolution.Projects.Single().Documents)
ProjectSystemShim\VisualStudioProjectTests\MetadataToProjectReferenceConversionTests.vb (10)
30Dim getProject2 = Function() environment.Workspace.CurrentSolution.GetProject(project2.Id) 67Dim getProject2 = Function() environment.Workspace.CurrentSolution.GetProject(project2.Id) 102Dim getReferencingProject = Function() environment.Workspace.CurrentSolution.GetProject(referencingProject.Id) 138Dim getReferencingProject = Function() environment.Workspace.CurrentSolution.GetProject(referencingProject.Id) 175Dim getReferencingProject = Function() environment.Workspace.CurrentSolution.GetProject(referencingProject.Id) 203Dim getReferencingProject = Function() environment.Workspace.CurrentSolution.GetProject(referencingProject.Id) 249Dim getReferencingProject = Function() environment.Workspace.CurrentSolution.GetProject(referencingProject.Id) 264Dim getReferencingProject = Function() environment.Workspace.CurrentSolution.GetProject(referencingProject.Id) 300Dim getReferencingProject = Function() environment.Workspace.CurrentSolution.GetProject(referencingProject.Id) 369Assert.Single(environment.Workspace.CurrentSolution.Projects.Single().MetadataReferences)
ProjectSystemShim\VisualStudioProjectTests\SolutionIdTests.vb (4)
19Dim solutionId = environment.Workspace.CurrentSolution.Id 27Assert.NotEqual(solutionId, environment.Workspace.CurrentSolution.Id) 36Dim solutionId = environment.Workspace.CurrentSolution.Id 40Assert.Equal(solutionId, environment.Workspace.CurrentSolution.Id)
ProjectSystemShim\VisualStudioProjectTests\WorkspaceChangedEventTests.vb (4)
31Assert.Equal(environment.Workspace.CurrentSolution.Projects.Single().DocumentIds.Single(), change.DocumentId) 71Assert.Equal(environment.Workspace.CurrentSolution.Projects.Single().AdditionalDocumentIds.Single(), change.DocumentId) 101Dim startingSolution = environment.Workspace.CurrentSolution 106Assert.Same(startingSolution, environment.Workspace.CurrentSolution)
PullMemberUp\PullMemberUpViewModelTest.vb (1)
249Dim workspaceDoc = workspace.CurrentSolution.GetDocument(doc.Id)
RQName\RQNameTests.vb (1)
245Dim workspaceDoc = workspace.CurrentSolution.GetDocument(doc.Id)
Snippets\CSharpSnippetExpansionClientTests.vb (1)
398Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single()
Snippets\SnippetCompletionProviderTests.vb (1)
30Dim document = testState.Workspace.CurrentSolution.Projects.First().Documents.First()
Snippets\VisualBasicSnippetExpansionClientTests.vb (1)
414Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single()
SolutionExplorer\SourceGeneratorItemTests.vb (4)
86Dim sourceGeneratedDocument = Assert.Single(Await workspace.CurrentSolution.GetProject(projectId).GetSourceGeneratedDocumentsAsync()) 117Dim expectedNames = Aggregate document In workspace.CurrentSolution.GetProject(projectId).AdditionalDocuments 146workspace.OnAdditionalDocumentRemoved(workspace.CurrentSolution.GetProject(projectId).AdditionalDocumentIds.Single()) 217workspace.OnAdditionalDocumentTextChanged(workspace.CurrentSolution.Projects.Single().AdditionalDocumentIds.Single(),
TaskList\TaskListTableDataSourceTests.vb (11)
60Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 80Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 106Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 148Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 197Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 228Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 266Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 304Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First() 342Dim projects = workspace.CurrentSolution.Projects.ToArray() 414Me, workspace.CurrentSolution, group.Key, group.ToImmutableArrayOrEmpty())) 420Me, workspace.CurrentSolution, documentId, ImmutableArray(Of TaskListItem).Empty))
Venus\AbstractContainedLanguageCodeSupportTests.vb (2)
40Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single() 58Return workspace.CurrentSolution.Projects.Single().Documents.Single()
Venus\DocumentService_IntegrationTests.vb (12)
77Dim startDocument = workspace.CurrentSolution.GetDocument(cursorDocument.Id) 84Dim definitionText = Await workspace.CurrentSolution.GetDocument(definitionDocument.Id).GetTextAsync() 142Dim startDocument = workspace.CurrentSolution.GetDocument(originalDocument.Id) 147Dim results = Await codelensService.FindReferenceLocationsAsync(workspace.CurrentSolution, startDocument.Id, node, CancellationToken.None) 151Dim definitionText = Await workspace.CurrentSolution.GetDocument(definitionDocument.Id).GetTextAsync() 182Dim document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id) 200Dim currentDocument = workspace.CurrentSolution.GetDocument(document.Id) 222workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference})) 224Dim document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id) 241Dim diagnostics = Await diagnosticService.GetDiagnosticsAsync(workspace.CurrentSolution, documentId:=document.Id) 275Dim mappedDocument = testWorkspace.CurrentSolution.GetDocument(mappedTestDocument.Id) 313Dim mappedDocument = testWorkspace.CurrentSolution.GetDocument(mappedTestDocument.Id)
Venus\DocumentServiceTests.vb (7)
41Dim spans = Await spanMapper.MapSpansAsync(workspace.CurrentSolution.GetDocument(subjectDocument.Id), {New TextSpan(position, length:=0)}, CancellationToken.None) 65Dim spans = Await spanMapper.MapSpansAsync(workspace.CurrentSolution.GetDocument(subjectDocument.Id), {New TextSpan(position, length:=0), New TextSpan(start:=1, length:=0), New TextSpan(position + 1, length:=0)}, CancellationToken.None) 116Dim document = Assert.IsType(Of SourceGeneratedDocument)(Await workspace.CurrentSolution.GetDocumentAsync(sourceGeneratedDocumentId, includeSourceGenerated:=True)) 140Dim result = Await excerptService.TryExcerptAsync(workspace.CurrentSolution.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.SingleLine, ClassificationOptions.Default, CancellationToken.None) 179Dim result = Await excerptService.TryExcerptAsync(workspace.CurrentSolution.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.Tooltip, ClassificationOptions.Default, CancellationToken.None) 226Dim result = Await excerptService.TryExcerptAsync(workspace.CurrentSolution.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.Tooltip, ClassificationOptions.Default, CancellationToken.None) 279Dim result = Await excerptService.TryExcerptAsync(workspace.CurrentSolution.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.SingleLine, ClassificationOptions.Default, CancellationToken.None)
VsNavInfo\VsNavInfoTests.vb (2)
829Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id) 867Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id)
Microsoft.VisualStudio.LanguageServices.VisualBasic (7)
CodeModel\VisualBasicCodeModelService.vb (1)
710Dim project = state.Workspace.CurrentSolution.GetProject(projectId)
LanguageService\VisualBasicPackage.IVbEntryPointProvider.vb (2)
23For Each projectId In workspace.CurrentSolution.ProjectIds 26Dim compilation = workspace.CurrentSolution.GetProject(projectId).GetCompilationAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None)
ProjectSystemShim\VisualBasicCodeModelInstanceFactory.vb (1)
34Dim document = _project.Workspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(Function(d) d.ProjectId Is _project.ProjectSystemProject.Id)
ProjectSystemShim\VisualBasicProject.vb (1)
201Dim project = Workspace.CurrentSolution.GetProject(ProjectSystemProject.Id)
Venus\ContainedLanguageStaticEventBinding.vb (2)
75targetDocument = visualStudioWorkspace.CurrentSolution.GetDocument(targetDocument.Id) 103targetDocument = visualStudioWorkspace.CurrentSolution.GetDocument(targetDocument.Id)
Microsoft.VisualStudio.LanguageServices.Xaml (4)
Implementation\XamlProjectService.cs (4)
165var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath).Single(d => d.ProjectId == project.Id); 169var document = _workspace.CurrentSolution.GetRequiredDocument(documentId); 201var document = _workspace.CurrentSolution.GetDocument(documentId); 255var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(newMoniker).Single(d => d.ProjectId == project.Id);
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\WorkspacePanel.xaml.cs (1)
77var solution = workspace.CurrentSolution;
Roslyn.VisualStudio.Next.UnitTests (73)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
69Assert.True(workspace.CurrentSolution.State.TryGetStateChecksums(out _));
Remote\SnapshotSerializationTests.cs (13)
55var solution = workspace.CurrentSolution; 85var solution = workspace.CurrentSolution; 108var solution = workspace.CurrentSolution; 119var solution = workspace.CurrentSolution; 145var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp); 159var document = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp).AddDocument("Document", SourceText.From(code)); 181var solution = workspace.CurrentSolution; 475var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp); 500var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", LanguageNames.CSharp); 519var project = workspace.CurrentSolution.AddProject("Project", "Project.dll", NoCompilationConstants.LanguageName); 531var document = CreateWorkspace().CurrentSolution.AddProject("empty", "empty", LanguageNames.CSharp).AddDocument("empty", SourceText.From("")); 546var project = CreateWorkspace().CurrentSolution.AddProject("empty", "empty", LanguageNames.VisualBasic); 579var solution = workspace.CurrentSolution
Services\AssetProviderTests.cs (3)
72var solution = workspace.CurrentSolution; 100var solution = workspace.CurrentSolution; 125var project = workspace.CurrentSolution.Projects.First();
Services\ServiceHubServicesTests.cs (22)
50var solution = workspace.CurrentSolution; 59await remoteWorkpace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None)); 72var solution = workspace.CurrentSolution; 132var solution = workspace.CurrentSolution; 178var solution = workspace.CurrentSolution.AddProject("unknown", "unknown", NoCompilationConstants.LanguageName).Solution; 188Assert.Empty(remoteWorkspace.CurrentSolution.Projects); 193await remoteWorkspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None)); 199await remoteWorkspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None)); 212var solution = Populate(workspace.CurrentSolution); 216solution = workspace.CurrentSolution; 222await remoteWorkspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None)); 230await remoteWorkspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None)); 238await remoteWorkspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None)); 249var solution = workspace.CurrentSolution; 267await remoteWorkspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None)); 273solution = workspace.CurrentSolution; 278await remoteWorkspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None)); 284solution = workspace.CurrentSolution; 289await remoteWorkspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None)); 333var remoteSolution = remoteWorkspace.CurrentSolution; 369solution = localWorkspace.CurrentSolution; 372var currentRemoteSolution = remoteWorkspace.CurrentSolution;
Services\SolutionAssetCacheTests.cs (1)
70var solution = workspace.CurrentSolution;
Services\SolutionServiceTests.cs (24)
46var solution = workspace.CurrentSolution; 64var solution = workspace.CurrentSolution; 87var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, workspace.CurrentSolution); 89var solutionChecksum = await workspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None); 116var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, workspace.CurrentSolution); 118var solutionChecksum = await workspace.CurrentSolution.State.GetChecksumAsync(CancellationToken.None); 139var solution = workspace.CurrentSolution; 243var projectId = workspace.CurrentSolution.ProjectIds.First(); 274var projectId = workspace.CurrentSolution.ProjectIds.First(); 307var projectId = workspace.CurrentSolution.ProjectIds.First(); 344var solution = workspace.CurrentSolution; 387var solution1 = workspace.CurrentSolution; 439Assert.True(expectRemoteSolutionToCurrent == (remoteSolution == remoteWorkspace.CurrentSolution)); 451var solution = workspace.CurrentSolution; 487var solution = workspace.CurrentSolution 526var solution = workspace.CurrentSolution; 560var solution = workspace.CurrentSolution; 601var solution = workspace.CurrentSolution; 634var solution = workspace.CurrentSolution; 675var solution = workspace.CurrentSolution; 713var solution = workspace.CurrentSolution; 751var solution = workspace.CurrentSolution; 784var solution = workspace.CurrentSolution; 811var solution = workspace.CurrentSolution;
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (9)
59var analyzerResult = await AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, 82analyzerResult = await AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, ideOptions); 112var analyzerResult = await AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, ideAnalyzerOptions); 124analyzerResult = await AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, ideAnalyzerOptions); 147var task = Task.Run(() => AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, ideAnalyzerOptions, source.Token)); 181workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); 187var project = workspace.CurrentSolution.Projects.First(); 227var project = workspace.CurrentSolution.Projects.First().AddAnalyzerReference(analyzerReference); 255var project = workspace.CurrentSolution.GetProject(projectId).AddAnalyzerReference(analyzerReference);