1744 references to CurrentSolution
Analyzer.Utilities.UnitTests (2)
FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisTests.cs (1)
1233
Project project = new AdhocWorkspace().
CurrentSolution
Options\SymbolNamesWithValueOptionTests.cs (1)
428
var project = new AdhocWorkspace().
CurrentSolution
AnalyzerRunner (6)
CodeRefactoringRunner.cs (1)
53
var solution = _workspace.
CurrentSolution
;
DiagnosticAnalyzerRunner.cs (2)
66
var solution = _workspace.
CurrentSolution
;
80
var solution = _workspace.
CurrentSolution
;
IncrementalAnalyzerRunner.cs (1)
46
var persistentStorage = await persistentStorageService.GetStorageAsync(SolutionKey.ToSolutionKey(_workspace.
CurrentSolution
), cancellationToken).ConfigureAwait(false);
Program.cs (2)
93
ShowSolutionStatistics(workspace.
CurrentSolution
, cancellationToken);
99
await ShowCompilerDiagnosticsAsync(workspace.
CurrentSolution
, cancellationToken).ConfigureAwait(false);
IdeBenchmarks (6)
FormatterBenchmarks.cs (2)
44
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
57
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
InheritanceMargin\InheritanceMarginGlyphBenchmarks.cs (1)
129
var items = await BenchmarksHelpers.GenerateInheritanceMarginItemsAsync(workspace.
CurrentSolution
, cancellationToken).ConfigureAwait(false);
RegexClassifierBenchmarks.cs (1)
71
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
SQLitePersistentStorageBenchmark.cs (2)
67
var solution = _workspace.
CurrentSolution
;
71
_document = _workspace.
CurrentSolution
.Projects.Single().Documents.Single();
IdeCoreBenchmarks (13)
FindReferencesBenchmarks.cs (1)
87
var storage = await storageService.GetStorageAsync(SolutionKey.ToSolutionKey(_workspace.
CurrentSolution
), CancellationToken.None);
FormatterBenchmarks.cs (1)
48
var solution = new AdhocWorkspace().
CurrentSolution
IncrementalSourceGeneratorBenchmarks.cs (1)
139
var project = _workspace.
CurrentSolution
.Projects.Single(p => p.Name == "Microsoft.CodeAnalysis.Workspaces(netstandard2.0)");
NavigateToBenchmarks.cs (7)
84
var docCount = _workspace.
CurrentSolution
.Projects.SelectMany(p => p.Documents).Count();
109
foreach (var project in _workspace.
CurrentSolution
.Projects)
143
foreach (var project in _workspace.
CurrentSolution
.Projects)
162
foreach (var project in _workspace.
CurrentSolution
.Projects)
184
var storage = await storageService.GetStorageAsync(SolutionKey.ToSolutionKey(_workspace.
CurrentSolution
), CancellationToken.None);
189
var tasks = _workspace.
CurrentSolution
.Projects.SelectMany(p => p.Documents).Select(d => Task.Run(
213
var solution = _workspace.
CurrentSolution
;
ProjectOperationBenchmarks.cs (1)
58
var solution = _workspace.
CurrentSolution
;
RenameBenchmarks.cs (1)
42
_solution = new AdhocWorkspace().
CurrentSolution
SwitchStatementBenchmarks.cs (1)
67
var solution = workspace.
CurrentSolution
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticProject.cs (1)
42
.
CurrentSolution
DiagnosticVerifier.cs (1)
160
Solution = Solution ?? new AdhocWorkspace().
CurrentSolution
;
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
152
.
CurrentSolution
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
152
.
CurrentSolution
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
320
var project = new AdhocWorkspace().
CurrentSolution
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
177
var updatedDocument = workspace.
CurrentSolution
.GetRequiredDocument(document.Id);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (228)
Classification\SemanticClassifierTests.cs (2)
35
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
3583
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
Classification\SyntacticClassifierTests.cs (3)
25
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
5786
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
5816
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
Classification\TotalClassifierTests.cs (1)
37
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
CodeActions\ApplyChangesOperationTests.cs (1)
227
var originalSolution = workspace.
CurrentSolution
;
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
846
var documentToModify = workspace.
CurrentSolution
.GetDocument(documentToModifyId);
CodeGeneration\SyntaxGeneratorTests.cs (2)
35
var solution = workspace.
CurrentSolution
;
69
var solution = workspace.
CurrentSolution
;
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
184
var document = workspace.
CurrentSolution
.GetDocument(documentId);
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
399
var document = workspace.
CurrentSolution
.GetRequiredDocument(hostDocument.Id);
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
660
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
1299
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (10)
2588
var solution = testWorkspace.
CurrentSolution
;
3014
var solution = testWorkspace.
CurrentSolution
;
3072
var solution = testWorkspace.
CurrentSolution
;
3347
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
3469
var compilation = await workspace.
CurrentSolution
.Projects.First(p => p.Name == "P3").GetCompilationAsync();
3474
var p1 = workspace.
CurrentSolution
.Projects.First(p => p.Name == "P1");
3480
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
3516
var origComp = await workspace.
CurrentSolution
.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None);
3521
var project = workspace.
CurrentSolution
.Projects.Single();
3527
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (2)
333
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
344
var currentDocument = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
Completion\CompletionServiceTests.cs (7)
51
var document = workspace.
CurrentSolution
109
var document = workspace.
CurrentSolution
135
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithOptions(
136
workspace.
CurrentSolution
.Options.WithChangedOption(new OptionKey(ThirdPartyOption.Instance, LanguageNames.CSharp), 1))));
138
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
206
var project = SolutionUtilities.AddEmptyProject(workspace.
CurrentSolution
)
212
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
Debugging\LocationInfoGetterTests.cs (1)
29
workspace.
CurrentSolution
.Projects.Single().Documents.Single(),
Debugging\NameResolverTests.cs (2)
24
var nameResolver = new BreakpointResolver(workspace.
CurrentSolution
, searchText);
36
var results = await debugInfo.ResolveBreakpointsAsync(workspace.
CurrentSolution
, "goo", CancellationToken.None);
Debugging\ProximityExpressionsGetterTests.cs (1)
78
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
DecompiledSource\DecompiledSourceFormattingTests.cs (1)
242
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (18)
49
var newSolution = workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference])
53
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
80
ideEngineWorkspace.TryApplyChanges(ideEngineWorkspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
82
var ideEngineDocument = ideEngineWorkspace.
CurrentSolution
.Projects.Single().Documents.Single();
95
var compilerEngineCompilation = (CSharpCompilation)compilerEngineWorkspace.
CurrentSolution
.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None).Result;
116
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
118
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
154
var additionalDocId = DocumentId.CreateNewId(workspace.
CurrentSolution
.Projects.Single().Id);
160
workspace.TryApplyChanges(workspace.
CurrentSolution
164
var sourceDocument = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
192
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
194
var ideEngineDocument = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
248
ideEngineWorkspace.TryApplyChanges(ideEngineWorkspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
250
var ideEngineDocument = ideEngineWorkspace.
CurrentSolution
.Projects.Single().Documents.Single();
269
var compilerEngineCompilation = (CSharpCompilation)compilerEngineWorkspace.
CurrentSolution
.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None).Result;
328
var compilerEngineCompilation = (CSharpCompilation)(await compilerEngineWorkspace.
CurrentSolution
.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None));
747
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences(
752
var project = workspace.
CurrentSolution
.Projects.Single();
EditAndContinue\ActiveStatementTrackingServiceTests.cs (1)
66
var solution = workspace.
CurrentSolution
;
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (3)
39
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
53
var solution = workspace.
CurrentSolution
;
347
var solution = workspace.
CurrentSolution
;
EncapsulateField\EncapsulateFieldTestState.cs (1)
35
TargetDocument = Workspace.
CurrentSolution
.GetDocument(_testDocument.Id);
ExtractMethod\ExtractMethodBase.cs (3)
124
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
164
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
189
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
ExtractMethod\ExtractMethodTests.cs (1)
10050
var solution = new AdhocWorkspace().
CurrentSolution
;
Formatting\CodeCleanupTests.cs (5)
815
var project = workspace.
CurrentSolution
.Projects.Single();
835
var document = workspace.
CurrentSolution
.GetRequiredDocument(hostdoc.Id);
852
var document = workspace.
CurrentSolution
.GetRequiredDocument(hostdoc.Id);
918
var solution = workspace.
CurrentSolution
.WithAnalyzerReferences(
940
var document = workspace.
CurrentSolution
.GetRequiredDocument(hostdoc.Id);
Formatting\FormattingEngineTests.cs (1)
342
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
Formatting\Indentation\SmartIndenterEnterOnTokenTests.cs (2)
1320
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
1361
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (1)
3111
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
Intents\IntentTestsBase.cs (2)
106
var priorDocument = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
117
var textDiffService = workspace.
CurrentSolution
.Services.GetRequiredService<IDocumentTextDifferencingService>();
LineSeparators\LineSeparatorTests.cs (1)
500
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
MoveToNamespace\MoveToNamespaceTests.cs (1)
1425
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
NavigateTo\NavigateToSearcherTests.cs (11)
145
workspace.
CurrentSolution
,
185
workspace.
CurrentSolution
,
222
workspace.
CurrentSolution
,
259
workspace.
CurrentSolution
,
290
workspace.
CurrentSolution
,
348
workspace.
CurrentSolution
,
391
var project = workspace.
CurrentSolution
.Projects.Single();
399
workspace.
CurrentSolution
,
451
var project = workspace.
CurrentSolution
.Projects.Single();
459
workspace.
CurrentSolution
,
537
public INavigableItem.NavigableDocument Document => INavigableItem.NavigableDocument.FromDocument(workspace.
CurrentSolution
.Projects.Single().Documents.Single());
OnTheFlyDocs\OnTheFlyDocsUtilitiesTests.cs (3)
32
var solution = workspace.
CurrentSolution
;
68
var solution = workspace.
CurrentSolution
;
114
var solution = workspace.
CurrentSolution
;
Organizing\AbstractOrganizerTests.cs (1)
29
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
160
var document = masWorkspace!.
CurrentSolution
.GetRequiredDocument(info.DocumentId);
218
var project = workspace.
CurrentSolution
.Projects.First();
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (10)
152
var implProject = workspace.
CurrentSolution
.Projects.First();
215
var implProject = workspace.
CurrentSolution
.Projects.First();
272
var implProject = workspace.
CurrentSolution
.Projects.First();
323
var implProject = workspace.
CurrentSolution
.Projects.First();
370
var implProject = workspace.
CurrentSolution
.Projects.First();
428
var implProject = workspace.
CurrentSolution
.Projects.First();
490
var implProject = workspace.
CurrentSolution
.Projects.First();
497
implProject = workspace.
CurrentSolution
.Projects.First().AddMetadataReference(MetadataReference.CreateFromFile(dllFilePath));
505
implProject = workspace.
CurrentSolution
.Projects.First();
511
implProject = workspace.
CurrentSolution
.Projects.First().AddMetadataReference(MetadataReference.CreateFromFile(realImplementationDllFilePath));
PdbSourceDocument\PdbSourceDocumentTests.cs (3)
395
var implProject = workspace.
CurrentSolution
.Projects.First();
436
var implProject = workspace.
CurrentSolution
.Projects.First();
836
var project = workspace.
CurrentSolution
.Projects.First();
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (2)
196
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
200
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
QuickInfo\SemanticQuickInfoSourceTests.cs (3)
51
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
132
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
301
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
QuickInfo\SyntacticQuickInfoSourceTests.cs (1)
628
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
Rename\CSharpInlineRenameServiceTests.cs (2)
63
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
117
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
StringIndentation\StringIndentationTests.cs (1)
30
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
SymbolKey\SymbolKeyTests.cs (5)
43
var solution = workspace.
CurrentSolution
;
78
var solution = workspace.
CurrentSolution
;
117
var solution = workspace.
CurrentSolution
;
163
var solution = workspace.
CurrentSolution
;
194
var solution = workspace.
CurrentSolution
;
Workspaces\WorkspaceTests_EditorFeatures.cs (106)
62
var solution = workspace.
CurrentSolution
;
74
Assert.Equal(solution, workspace.
CurrentSolution
);
84
var solution = workspace.
CurrentSolution
;
91
solution = workspace.
CurrentSolution
;
100
var solution = workspace.
CurrentSolution
;
106
solution = workspace.
CurrentSolution
;
115
var solution = workspace.
CurrentSolution
;
120
solution = workspace.
CurrentSolution
;
122
solution = workspace.
CurrentSolution
;
131
var solution = workspace.
CurrentSolution
;
142
var solution = workspace.
CurrentSolution
;
156
var solution = workspace.
CurrentSolution
;
183
var solution = workspace.
CurrentSolution
;
222
workspace.TryApplyChanges(workspace.
CurrentSolution
);
225
var tree1 = await workspace.
CurrentSolution
232
var tree2 = await workspace.
CurrentSolution
241
var currentSnapshot = workspaceSnapshotBuilder.
CurrentSolution
;
259
var solution = workspace.
CurrentSolution
;
273
var solution = workspace.
CurrentSolution
;
284
var snapshot = workspace.
CurrentSolution
;
295
var solution = workspace.
CurrentSolution
;
312
var solution = workspace.
CurrentSolution
;
323
var snapshot = workspace.
CurrentSolution
;
334
var solution = workspace.
CurrentSolution
;
351
var solution = workspace.
CurrentSolution
;
361
Assert.Empty(workspace.
CurrentSolution
.Projects);
368
var solution = workspace.
CurrentSolution
;
383
var solution = workspace.
CurrentSolution
;
393
Assert.Empty(workspace.
CurrentSolution
.Projects.Single().Documents);
402
var solution = workspace.
CurrentSolution
;
410
var snapshot = workspace.
CurrentSolution
;
421
var solution = workspace.
CurrentSolution
;
432
var snapshot = workspace.
CurrentSolution
;
445
var solution = workspace.
CurrentSolution
;
460
var snapshot = workspace.
CurrentSolution
;
478
var solutionX = workspace.
CurrentSolution
;
497
var solutionY = workspace.
CurrentSolution
;
515
var solutionZ = workspace.
CurrentSolution
;
536
var solutionX = workspace.
CurrentSolution
;
555
var solutionY = workspace.
CurrentSolution
;
579
var cs = workspace.
CurrentSolution
;
608
var solutionX = workspace.
CurrentSolution
;
627
var solutionY = workspace.
CurrentSolution
;
654
var cs = workspace.
CurrentSolution
;
676
var cs = workspace.
CurrentSolution
;
704
var solution = workspace.
CurrentSolution
;
715
solution = workspace.
CurrentSolution
;
740
Assert.Equal(startText, (await workspace.
CurrentSolution
.GetDocument(document.Id).GetTextAsync()).ToString());
743
var oldSolution = workspace.
CurrentSolution
;
747
Assert.Equal(startText, (await workspace.
CurrentSolution
.GetDocument(document.Id).GetTextAsync()).ToString());
771
var oldSolution = workspace.
CurrentSolution
;
777
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
792
var oldSolution = workspace.
CurrentSolution
;
798
Assert.Equal(0, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1066
var project = workspace.
CurrentSolution
.Projects.Single();
1090
var project = workspace.
CurrentSolution
.Projects.Single();
1122
var project = workspace.
CurrentSolution
.Projects.Single();
1126
var oldSolution = workspace.
CurrentSolution
;
1135
var doc = workspace.
CurrentSolution
.GetAdditionalDocument(additionalDoc.Id);
1155
var project = workspace.
CurrentSolution
.Projects.Single();
1159
var oldSolution = workspace.
CurrentSolution
;
1168
var doc = workspace.
CurrentSolution
.GetAnalyzerConfigDocument(analyzerConfigDoc.Id);
1245
var project = workspace.
CurrentSolution
.Projects.Single();
1249
var oldSolution = workspace.
CurrentSolution
;
1252
var doc = workspace.
CurrentSolution
.GetAdditionalDocument(additionalDoc.Id);
1256
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1257
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Count());
1261
oldSolution = workspace.
CurrentSolution
;
1266
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1267
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Count());
1268
Assert.Equal("original.config", workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Single().Name);
1281
var project = workspace.
CurrentSolution
.Projects.Single();
1285
var oldSolution = workspace.
CurrentSolution
;
1288
var doc = workspace.
CurrentSolution
.GetAnalyzerConfigDocument(analyzerConfigDoc.Id);
1292
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1293
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1297
oldSolution = workspace.
CurrentSolution
;
1302
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1303
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1304
Assert.Equal("original.config", workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Single().Name);
1319
var project = workspace.
CurrentSolution
.Projects.Single();
1325
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1326
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Count());
1329
project = workspace.
CurrentSolution
.Projects.Single();
1332
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1333
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Count());
1334
Assert.Equal("original.config", workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Single().Name);
1347
var project = workspace.
CurrentSolution
.Projects.Single();
1353
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1354
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1357
project = workspace.
CurrentSolution
.Projects.Single();
1360
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1361
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1362
Assert.Equal("original.config", workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Single().Name);
1377
var documentIdsWithFilePath = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(docFilePath);
1381
documentIdsWithFilePath = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(additionalDocFilePath);
1397
var documentIdsWithFilePath = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(docFilePath);
1401
documentIdsWithFilePath = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(analyzerConfigDocFilePath);
1477
var solution = workspace1.
CurrentSolution
;
1491
var currentOptionValue = workspace1.
CurrentSolution
.Options.GetOption(optionKey);
1514
var beforeSolutionForPrimaryWorkspace = primaryWorkspace.
CurrentSolution
;
1515
var beforeSolutionForSecondaryWorkspace = secondaryWorkspace.
CurrentSolution
;
1528
Assert.NotEqual(beforeSolutionForPrimaryWorkspace, primaryWorkspace.
CurrentSolution
);
1529
Assert.NotEqual(beforeSolutionForSecondaryWorkspace, secondaryWorkspace.
CurrentSolution
);
1541
Assert.NotSame(beforeSolutionForPrimaryWorkspace, primaryWorkspace.
CurrentSolution
);
1542
Assert.NotSame(beforeSolutionForSecondaryWorkspace, secondaryWorkspace.
CurrentSolution
);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
62
var solution = workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (22)
Diagnostics\Suppression\SuppressionTests.cs (3)
477
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
801
var solution = workspace.
CurrentSolution
;
1047
var solution = workspace.
CurrentSolution
;
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (14)
293
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
360
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
388
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source);
423
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
455
var oldSolution = workspace.
CurrentSolution
.
505
var oldSolution = workspace.
CurrentSolution
;
510
var newSolution = workspace.
CurrentSolution
.WithDocumentText(documentId, SourceText.From(source2));
536
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source);
575
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
615
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
656
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
703
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
737
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
793
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
Testing\CSharpTestMethodFinderTests.cs (5)
468
var testMethodFinder = workspace.
CurrentSolution
.Projects.Single().GetRequiredLanguageService<ITestMethodFinder>();
469
var testMethods = await testMethodFinder.GetPotentialTestMethodsAsync(workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id), span, CancellationToken.None);
482
var testMethodFinder = workspace.
CurrentSolution
.Projects.Single().GetRequiredLanguageService<ITestMethodFinder>();
483
var testMethods = await testMethodFinder.GetPotentialTestMethodsAsync(workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id), span, CancellationToken.None);
484
var semanticModel = await workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id).GetRequiredSemanticModelAsync(CancellationToken.None);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
Formatting\FormattingMultipleSpanTests.cs (1)
153
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp);
OrganizeImports\OrganizeUsingsTests.cs (2)
29
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp);
79
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp);
Microsoft.CodeAnalysis.EditorFeatures (31)
CodeActions\CodeActionEditHandlerService.cs (5)
56
var oldSolution = workspace.
CurrentSolution
;
119
var oldSolution = workspace.
CurrentSolution
;
312
var openDocument = workspace.
CurrentSolution
.GetRequiredDocument(renameOperation.DocumentId);
346
var latestDocument = workspace.
CurrentSolution
.GetDocument(documentId);
359
var openDocument = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
EditAndContinue\EditAndContinueLanguageService.cs (1)
76
=> workspaceProvider.Value.Workspace.
CurrentSolution
;
EditorConfigSettings\Aggregator\SettingsAggregator.cs (2)
38
var currentSolution = _workspace.
CurrentSolution
.SolutionState;
96
UpdateProviders(_workspace.
CurrentSolution
.SolutionState);
EditorConfigSettings\DataProvider\SettingsProviderBase.cs (1)
56
var solution = Workspace.
CurrentSolution
;
EditorConfigSettings\Updater\SettingsUpdaterBase.cs (1)
74
var solution = Workspace.
CurrentSolution
;
InlineDiagnostics\InlineDiagnosticsTaggerProvider.cs (1)
64
var project = workspace.
CurrentSolution
.GetProject(diagnostic.DocumentId.ProjectId);
InlineRename\InlineRenameSession.cs (2)
915
var finalChanges = Workspace.
CurrentSolution
.GetChanges(_baseSolution);
937
var finalSolution = Workspace.
CurrentSolution
;
IntelliSense\NavigationActionFactory.cs (1)
60
var solution = workspace.
CurrentSolution
;
Interactive\InteractiveDocumentNavigationService.cs (1)
46
var document = interactiveWorkspace.
CurrentSolution
.GetDocument(documentId);
NavigateTo\NavigateToItemDisplay.cs (1)
80
if (document.TryGetTextSynchronously(document.Workspace.
CurrentSolution
, CancellationToken.None) is { } sourceText)
NavigateTo\NavigateToItemProvider.cs (3)
47
=> NavigateToUtilities.GetKindsProvided(_workspace.
CurrentSolution
);
53
foreach (var project in _workspace.
CurrentSolution
.Projects)
112
var solution = _workspace.
CurrentSolution
;
Navigation\IDocumentNavigationServiceExtensions.cs (1)
78
var document = workspace.
CurrentSolution
.GetTextDocument(documentId);
Peek\DefinitionPeekableItem.cs (1)
70
var solution = workspace.
CurrentSolution
;
Remote\SolutionChecksumUpdater.cs (2)
141
var solution = _workspace.
CurrentSolution
;
172
var solution = _workspace.
CurrentSolution
;
RenameTracking\RenameTrackingTaggerProvider.cs (1)
67
var document = workspace.
CurrentSolution
.GetDocument(documentId);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
154
var finalSolution = workspace.
CurrentSolution
;
Shared\Extensions\WorkspaceExtensions.cs (2)
24
var oldSolution = workspace.
CurrentSolution
;
41
var oldSolution = workspace.
CurrentSolution
;
Shared\Preview\PreviewWorkspace.cs (4)
76
var document = this.
CurrentSolution
.GetTextDocument(documentId);
101
var document = this.
CurrentSolution
.GetRequiredDocument(documentId);
110
var document = this.
CurrentSolution
.GetRequiredAdditionalDocument(documentId);
119
var document = this.
CurrentSolution
.GetRequiredAnalyzerConfigDocument(documentId);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (49)
BraceMatching\AbstractBraceMatcherTests.cs (1)
27
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
BracePairs\AbstractBracePairsTests.cs (1)
30
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
CodeLens\AbstractCodeLensTest.cs (8)
25
var document = workspace.
CurrentSolution
.GetDocument(annotatedDocument.Id);
35
var result = await workspace.Services.GetRequiredService<ICodeLensReferencesService>().GetReferenceCountAsync(workspace.
CurrentSolution
, annotatedDocument.Id,
53
var document = workspace.
CurrentSolution
.GetDocument(annotatedDocument.Id);
62
var result = await workspace.Services.GetRequiredService<ICodeLensReferencesService>().FindReferenceLocationsAsync(workspace.
CurrentSolution
,
79
var document = workspace.
CurrentSolution
.GetDocument(annotatedDocument.Id);
88
var result = await workspace.Services.GetRequiredService<ICodeLensReferencesService>().FindReferenceMethodsAsync(workspace.
CurrentSolution
,
105
var document = workspace.
CurrentSolution
.GetDocument(annotatedDocument.Id);
114
var actual = await workspace.Services.GetRequiredService<ICodeLensReferencesService>().GetFullyQualifiedNameAsync(workspace.
CurrentSolution
,
Completion\AbstractCompletionProviderTests.cs (7)
370
var currentDocument = workspace.
CurrentSolution
.GetDocument(workspaceFixture.Target.CurrentDocument.Id);
689
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspaceFixture.Target.CurrentDocument.Id);
962
var solution = testWorkspace.
CurrentSolution
;
1019
var solution = testWorkspace.
CurrentSolution
;
1048
var solution = testWorkspace.
CurrentSolution
;
1265
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
1310
var document = workspace.
CurrentSolution
.GetDocument(documentId);
Debugging\AbstractDataTipInfoGetterTests.cs (1)
67
workspace.
CurrentSolution
.Projects.First().Documents.First(),
Diagnostics\DiagnosticTaggerWrapper.cs (1)
37
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
Diagnostics\GenerateType\GenerateTypeTestState.cs (4)
37
TriggeredProject = Workspace.
CurrentSolution
.GetProject(_testDocument.Project.Id);
42
ProjectToBeModified = Workspace.
CurrentSolution
.GetProject(_testDocument.Project.Id);
46
ProjectToBeModified = Workspace.
CurrentSolution
.Projects.FirstOrDefault(proj => proj.Name.Equals(projectToBeModified));
50
InvocationDocument = Workspace.
CurrentSolution
.GetDocument(_testDocument.Id);
DocumentTracking\FirstDocumentIsActiveAndVisibleDocumentTrackingService.cs (1)
25
=> _workspace.
CurrentSolution
.Projects.First().DocumentIds.First();
ExtractInterface\ExtractInterfaceTestState.cs (3)
56
OriginalSolution = Workspace.
CurrentSolution
;
64
ExtractFromDocument = Workspace.
CurrentSolution
.GetDocument(_testDocument.Id);
122
return Workspace.
CurrentSolution
;
Formatting\AbstractNewDocumentFormattingServiceTests.cs (2)
28
var solution = workspace.
CurrentSolution
;
30
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
Formatting\CoreFormatterTestsBase.cs (1)
182
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (2)
38
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
62
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
50
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
NavigateTo\AbstractNavigateToTests.cs (1)
242
=> [_workspace.
CurrentSolution
.Projects.First().DocumentIds.First()];
ObsoleteSymbol\AbstractObsoleteSymbolTests.cs (1)
27
var project = workspace.
CurrentSolution
.Projects.Single();
ReassignedVariable\AbstractReassignedVariableTests.cs (1)
26
var project = workspace.
CurrentSolution
.Projects.Single();
Rename\RenamerTests.cs (3)
41
var solution = workspace.
CurrentSolution
;
176
var solution = workspace.
CurrentSolution
;
215
var solution = workspace.
CurrentSolution
;
SignatureHelp\AbstractSignatureHelpProviderTests.cs (3)
346
var document = testWorkspace.
CurrentSolution
.GetDocument(documentId);
349
document = testWorkspace.
CurrentSolution
.GetDocument(documentId);
466
var document = testWorkspace.
CurrentSolution
.GetDocument(documentId);
SpellCheck\AbstractSpellCheckSpanTests.cs (1)
28
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
Structure\AbstractSyntaxStructureProviderTests.cs (2)
50
var document = workspace.
CurrentSolution
.GetRequiredDocument(hostDocument.Id);
69
var document = workspace.
CurrentSolution
.GetRequiredDocument(hostDocument.Id);
TaskList\AbstractTaskListTests.cs (1)
38
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
Workspaces\EditorTestHostDocument.cs (2)
160
foreach (var linkedId in workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(FilePath).Concat(this.Id))
170
var document = threadingContext.JoinableTaskFactory.Run(() => workspace.
CurrentSolution
.GetSourceGeneratedDocumentAsync(testDocument.Id, CancellationToken.None).AsTask());
Workspaces\TestWorkspaceFixture.cs (1)
97
return GetWorkspace().
CurrentSolution
.GetDocument(hostDocument.Id);
Microsoft.CodeAnalysis.EditorFeatures.Text (3)
Extensions.cs (3)
63
/// Gets the <see cref="Document"/>s from the corresponding <see cref="Workspace.
CurrentSolution
"/> that are associated with the <see cref="ITextSnapshot"/>'s buffer,
71
/// Gets the <see cref="Document"/> from the corresponding <see cref="Workspace.
CurrentSolution
"/> that is associated with the <see cref="ITextSnapshot"/>'s buffer
83
/// 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 (242)
CodeFixes\CodeFixServiceTests.cs (7)
51
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
58
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
279
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
342
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
366
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
747
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
1047
sourceDocument = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
CodeGeneration\AbstractCodeGenerationTests.cs (1)
31
var project = workspace.
CurrentSolution
CodeGeneration\CodeGenerationTests.cs (3)
882
this.Document = Workspace.
CurrentSolution
.Projects.Single().Documents.Single();
893
var semanticModel = await workspace.
CurrentSolution
.Projects.Single().Documents.Single().GetSemanticModelAsync();
898
public Solution Solution { get { return Workspace.
CurrentSolution
; } }
CodeRefactorings\CodeRefactoringServiceTest.cs (6)
49
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
87
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
106
var project = workspace.
CurrentSolution
.Projects.Single();
163
var project = workspace.
CurrentSolution
.Projects.Single()
202
var project = workspace.
CurrentSolution
.Projects.Single()
242
var project = workspace.
CurrentSolution
.Projects.Single()
Completion\CompletionServiceTests.cs (1)
43
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (32)
61
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
68
workspace.
CurrentSolution
.Projects.Single(), documentIds: default, diagnosticIds: null, AnalyzerFilter.All,
83
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
97
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
112
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
132
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
151
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
234
var solution = workspace.
CurrentSolution
;
269
var project = workspace.
CurrentSolution
.Projects.Single();
280
var project = workspace.
CurrentSolution
.Projects.Single();
291
var project = workspace.
CurrentSolution
.Projects.Single();
315
var solution = workspace.
CurrentSolution
;
445
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
447
var project = workspace.
CurrentSolution
.Projects.Single();
557
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
559
var project = workspace.
CurrentSolution
.Projects.Single();
631
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
632
var project = workspace.
CurrentSolution
.Projects.Single();
654
workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference])
657
var project = workspace.
CurrentSolution
.Projects.Single();
686
workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerHostReference])
689
var project = workspace.
CurrentSolution
.Projects.Single();
716
workspace.
CurrentSolution
.WithAnalyzerReferences(AddExtraReferenceIfNeeded(analyzerHostReference, includeExtraHostReference))
719
var project = workspace.
CurrentSolution
.Projects.Single();
767
workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerHostReference])
770
var project = workspace.
CurrentSolution
.Projects.Single();
804
var project = workspace.
CurrentSolution
.Projects.Single();
814
project = workspace.
CurrentSolution
.Projects.Single();
878
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
880
var project = workspace.
CurrentSolution
.Projects.Single();
915
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(new TestGeneratorReference(generator)).Solution));
917
var project = workspace.
CurrentSolution
.Projects.Single();
Diagnostics\DiagnosticDataTests.cs (5)
121
var document = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp).AddDocument("TestDocument", code);
148
var additionalDocument = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
184
var additionalDocument = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
234
var project = workspace.
CurrentSolution
.GetRequiredProject(documentId.ProjectId);
271
var firstDocument = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (2)
57
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences(
65
var document = workspace.
CurrentSolution
.GetDocument(documentId);
EditAndContinue\EditAndContinueLanguageServiceTests.cs (4)
73
solution = workspace.
CurrentSolution
;
121
await localWorkspace.ChangeSolutionAsync(localWorkspace.
CurrentSolution
125
var solution = localWorkspace.
CurrentSolution
;
382
solution = workspace.
CurrentSolution
;
FindSymbols\SymbolTreeInfoTests.cs (4)
21
var solution = workspace.
CurrentSolution
;
42
var solution = workspace.
CurrentSolution
;
65
var solution = workspace.
CurrentSolution
;
87
var solution = workspace.
CurrentSolution
;
Formatting\InferredIndentationTests.cs (3)
26
var options = await testWorkspace.
CurrentSolution
.Projects.Single().Documents.Single().GetLineFormattingOptionsAsync(CancellationToken.None);
39
var options = await testWorkspace.
CurrentSolution
.Projects.Single().Documents.Single().GetLineFormattingOptionsAsync(CancellationToken.None);
53
var options = await testWorkspace.
CurrentSolution
.Projects.Single().Documents.Single().GetLineFormattingOptionsAsync(CancellationToken.None);
InheritanceMargin\InheritanceMarginTests.cs (3)
104
var document = testWorkspace.
CurrentSolution
.GetRequiredDocument(testHostDocument.Id);
169
var docSpan = await actualDocumentSpans[i].TryRehydrateAsync(workspace.
CurrentSolution
, CancellationToken.None);
346
var document = testWorkspace.
CurrentSolution
.GetRequiredDocument(testHostDocument.Id);
LanguageServer\VSTypeScriptHandlerTests.cs (1)
113
var locations = await GetAnnotatedLocationsAsync(testWorkspace, testWorkspace.
CurrentSolution
);
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (5)
75
var solution = workspace.
CurrentSolution
;
78
var text = await workspace.
CurrentSolution
.GetRequiredDocument(documentId).GetTextAsync();
81
var linkedText = await workspace.
CurrentSolution
.GetRequiredDocument(linkedDocumentId).GetTextAsync();
91
Assert.Equal(s_expectedCode, (await workspace.
CurrentSolution
.GetRequiredDocument(documentId).GetTextAsync()).ToString());
92
Assert.Equal(s_expectedCode, (await workspace.
CurrentSolution
.GetRequiredDocument(linkedDocumentId).GetTextAsync()).ToString());
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (2)
77
get { return Workspace.
CurrentSolution
; }
315
var document = Workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
Preview\PreviewWorkspaceTests.cs (24)
31
Assert.NotNull(previewWorkspace.
CurrentSolution
);
39
Assert.NotNull(previewWorkspace.
CurrentSolution
);
46
using var previewWorkspace = new PreviewWorkspace(custom.
CurrentSolution
);
47
Assert.NotNull(previewWorkspace.
CurrentSolution
);
54
var solution = previewWorkspace.
CurrentSolution
;
58
var newSolution = previewWorkspace.
CurrentSolution
.RemoveProject(project.Id);
61
Assert.Equal(0, previewWorkspace.
CurrentSolution
.ProjectIds.Count);
68
var solution = previewWorkspace.
CurrentSolution
;
72
var addedSolution = previewWorkspace.
CurrentSolution
.Projects.First()
76
Assert.Equal(1, previewWorkspace.
CurrentSolution
.Projects.First().MetadataReferences.Count);
77
Assert.Equal(1, previewWorkspace.
CurrentSolution
.Projects.First().DocumentIds.Count);
80
var changedSolution = previewWorkspace.
CurrentSolution
.Projects.First().Documents.First().WithText(SourceText.From(text)).Project.Solution;
82
Assert.Equal(previewWorkspace.
CurrentSolution
.Projects.First().Documents.First().GetTextAsync().Result.ToString(), text);
84
var removedSolution = previewWorkspace.
CurrentSolution
.Projects.First()
85
.RemoveMetadataReference(previewWorkspace.
CurrentSolution
.Projects.First().MetadataReferences[0])
86
.RemoveDocument(previewWorkspace.
CurrentSolution
.Projects.First().DocumentIds[0]).Solution;
89
Assert.Equal(0, previewWorkspace.
CurrentSolution
.Projects.First().MetadataReferences.Count);
90
Assert.Equal(0, previewWorkspace.
CurrentSolution
.Projects.First().DocumentIds.Count);
97
var solution = previewWorkspace.
CurrentSolution
;
119
var storage = await persistentService.GetStorageAsync(SolutionKey.ToSolutionKey(previewWorkspace.
CurrentSolution
), CancellationToken.None);
129
Assert.NotNull(previewWorkspace.
CurrentSolution
);
133
var project = previewWorkspace.
CurrentSolution
.AddProject("project", "project.dll", LanguageNames.CSharp);
135
return previewWorkspace.
CurrentSolution
;
166
var project = previewWorkspace.
CurrentSolution
.Projects.Single();
RenameTracking\RenameTrackingTestState.cs (2)
169
var document = this.Workspace.
CurrentSolution
.GetDocument(HostDocument.Id);
199
await operations[0].TryApplyAsync(this.Workspace, this.Workspace.
CurrentSolution
, CodeAnalysisProgress.None, CancellationToken.None);
Snippets\RoslynLSPSnippetConvertTests.cs (3)
318
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
329
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
399
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
StackTraceExplorer\StackTraceExplorerTests.cs (7)
40
var definition = await service.TryFindDefinitionAsync(workspace.
CurrentSolution
, stackFrame, StackFrameSymbolPart.Method, CancellationToken.None);
46
var doc = workspace.
CurrentSolution
.GetRequiredDocument(cursorDoc.Id);
56
workspace.
CurrentSolution
, includeHiddenLocations: true, CancellationToken.None);
819
var definition = await service.TryFindDefinitionAsync(workspace.
CurrentSolution
, parsedFrame, StackFrameSymbolPart.Method, CancellationToken.None);
849
var definition = await service.TryFindDefinitionAsync(workspace.
CurrentSolution
, frame, StackFrameSymbolPart.Method, CancellationToken.None);
887
var (document, line) = service.GetDocumentAndLine(workspace.
CurrentSolution
, frame);
926
var (document, line) = service.GetDocumentAndLine(workspace.
CurrentSolution
, frame);
Structure\BlockStructureServiceTests.cs (1)
119
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
Structure\StructureTaggerTests.cs (1)
411
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
SymbolFinder\FindSymbolAtPositionTests.cs (1)
21
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.Single().Id);
SymbolFinder\SymbolFinderTests.cs (20)
58
var solution = workspace.
CurrentSolution
;
99
var solution = workspace.
CurrentSolution
;
146
var solution = workspace.
CurrentSolution
;
191
var solution = workspace.
CurrentSolution
;
232
var solution = workspace.
CurrentSolution
;
274
var solution = workspace.
CurrentSolution
;
316
var solution = workspace.
CurrentSolution
;
356
var solution = workspace.
CurrentSolution
;
397
var solution = workspace.
CurrentSolution
;
437
var solution = workspace.
CurrentSolution
;
468
var solution = workspace.
CurrentSolution
;
517
var solution = workspace.
CurrentSolution
;
569
var solution = workspace.
CurrentSolution
;
596
var solution = workspace.
CurrentSolution
;
644
var solution = workspace.
CurrentSolution
;
670
var solution = workspace.
CurrentSolution
;
734
var solution = workspace.
CurrentSolution
;
777
var solution = workspace.
CurrentSolution
;
805
var solution = workspace.
CurrentSolution
;
843
var solution = workspace.
CurrentSolution
;
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
42
var solution = workspace.
CurrentSolution
;
Tagging\AsynchronousTaggerTests.cs (2)
166
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
221
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
TextEditor\OpenDocumentTests.cs (5)
51
AssertEx.SetEqual(documentIds, workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(FilePath));
52
Assert.Equal(documentIds.Last(), workspace.
CurrentSolution
.GetDocument(documentIds.First()).GetLinkedDocumentIds().Single());
53
Assert.Equal(documentIds.First(), workspace.
CurrentSolution
.GetDocument(documentIds.Last()).GetLinkedDocumentIds().Single());
64
Assert.Same(workspace.
CurrentSolution
, newDocumentWithChanges.Project.Solution);
70
Assert.NotSame(workspace.
CurrentSolution
, originalDocumentWithChanges.Project.Solution);
TextEditor\TryGetDocumentTests.cs (2)
28
var document = workspace.
CurrentSolution
.GetDocument(workspace.GetDocumentId(hostDocument));
55
var document = workspace.
CurrentSolution
.GetDocument(workspace.GetDocumentId(hostDocument));
Utilities\SymbolEquivalenceComparerTests.cs (92)
53
var type = (ITypeSymbol)(await workspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
129
var csharpType = (ITypeSymbol)(await csharpWorkspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
130
var vbType = (await vbWorkspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
203
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
204
var type2_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
205
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
206
var type2_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
258
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
259
var type2_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
260
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
261
var type2_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
298
var typeC = (await workspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
299
var typeD = (await workspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("D").Single();
346
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
347
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
375
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
376
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
404
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
405
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
433
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
434
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
462
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
463
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
493
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
494
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
524
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
525
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
555
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
556
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
584
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
585
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
613
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
614
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
644
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
645
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
680
var csharpType1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
681
var vbType1 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
727
var csharpType1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
728
var vbType1 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
760
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
790
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
791
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
827
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
828
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
862
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
863
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
899
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
900
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
931
var outer1 = (INamespaceSymbol)(await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetMembers("Outer").Single();
932
var outer2 = (INamespaceSymbol)(await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetMembers("Outer").Single();
1009
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1010
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1011
var type2_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
1012
var type2_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
1048
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1049
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
1075
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1076
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1102
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1103
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1135
var outer = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Outer").Single();
1136
var other = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Other").Single();
1167
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1168
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1200
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1201
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1242
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1243
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1274
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1275
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1306
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1307
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1339
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1340
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1372
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1373
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1406
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1407
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1445
var t1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1446
var t2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1511
var t1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1512
var t2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1576
var t1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1577
var t2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1641
var t1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1642
var t2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1729
var comp1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync());
1730
var comp2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync());
1803
var comp1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync());
1804
var comp2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync());
1828
var namespace1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M");
1829
var namespace2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M");
ValueTracking\AbstractBaseValueTrackingTests.cs (2)
29
var document = testWorkspace.
CurrentSolution
.GetRequiredDocument(cursorDocument.Id);
39
return await service.TrackValueSourceAsync(testWorkspace.
CurrentSolution
, item, cancellationToken);
Microsoft.CodeAnalysis.ExternalAccess.Copilot (2)
Internal\SemanticSearch\CopilotSemanticSearchQueryExecutor.cs (2)
86
var services = _workspace.
CurrentSolution
.Services;
117
_workspace.
CurrentSolution
,
Microsoft.CodeAnalysis.ExternalAccess.FSharp (3)
LanguageServices\FSharpVisualStudioWorkspaceExtensions.cs (3)
24
var projects = workspace.
CurrentSolution
.Projects.Where(p => string.Equals(p.OutputFilePath, filePath, StringComparison.OrdinalIgnoreCase)).ToList();
44
return workspace.
CurrentSolution
.Projects.FirstOrDefault(p => p.FilePath == filePath)?.Id ?? ProjectId.CreateNewId("ProjectNotFound");
50
return workspace.
CurrentSolution
.GetProject(projectId)?.FilePath;
Microsoft.CodeAnalysis.ExternalAccess.HotReload (2)
Api\HotReloadMSBuildWorkspace.cs (2)
68
var oldSolution =
CurrentSolution
;
144
var updatedSolution =
CurrentSolution
;
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Options\OmniSharpSolutionAnalyzerConfigOptionsUpdater.cs (1)
23
var oldSolution = workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.Features (18)
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
110
var newSolution = workspace.
CurrentSolution
.WithDocumentText(
122
var rolledBackSolution = workspace.
CurrentSolution
.WithDocumentText(
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
37
/// cref="Workspace.
CurrentSolution
"/> normally represents.
ExternalAccess\UnitTesting\UnitTestingStackTraceServiceAccessor.cs (2)
23
=> _stackTraceExplorerService.GetDocumentAndLine(workspace.
CurrentSolution
, parsedFrame.UnderlyingObject);
38
var definition = await _stackTraceExplorerService.TryFindDefinitionAsync(workspace.
CurrentSolution
, parsedFrame.UnderlyingObject, StackFrameSymbolPart.Method, cancellationToken).ConfigureAwait(false);
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
44
var (project, symbol) = await TryResolveSymbolAsync(workspace.
CurrentSolution
, symbolKey, cancellationToken).ConfigureAwait(false);
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (6)
66
metadataWorkspace.OnSolutionFallbackAnalyzerOptionsChanged(sourceWorkspace.
CurrentSolution
.FallbackAnalyzerOptions);
104
var (temporaryProjectInfo, temporaryDocumentId) = GenerateProjectAndDocumentInfo(fileInfo, metadataWorkspace.
CurrentSolution
.Services, sourceProject, topLevelNamedType);
105
var temporarySolution = metadataWorkspace.
CurrentSolution
.AddProject(temporaryProjectInfo);
212
var document = metadataWorkspace.
CurrentSolution
.GetRequiredDocument(generatedDocumentId);
230
var newLoader = new WorkspaceFileTextLoader(metadataWorkspace.
CurrentSolution
.Services, fileInfo.TemporaryFilePath, MetadataAsSourceGeneratedFileInfo.Encoding);
300
var solution = fileInfo.Workspace.
CurrentSolution
;
MetadataAsSource\MetadataAsSourceFileService.cs (2)
181
documentId = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(filePath).SingleOrDefault();
203
var documentId = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(filePath).FirstOrDefault();
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (4)
256
var navigateProject = metadataWorkspace.
CurrentSolution
.GetRequiredProject(projectId);
263
if (!metadataWorkspace.
CurrentSolution
.ContainsDocument(documentInfo.Id))
270
navigateProject = metadataWorkspace.
CurrentSolution
.GetRequiredProject(projectId);
394
var solution = info.SourceWorkspace.
CurrentSolution
;
Microsoft.CodeAnalysis.Features.Test.Utilities (5)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
500
var oldSolution = workspace.
CurrentSolution
;
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
77
solution = workspace.
CurrentSolution
;
Snippets\AbstractSnippetProviderTests.cs (2)
37
var project = workspace.
CurrentSolution
.
127
var project = workspace.
CurrentSolution
.
SolutionExplorer\AbstractSolutionExplorerSymbolTreeItemProviderTests.cs (1)
26
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
Microsoft.CodeAnalysis.Features.UnitTests (40)
EditAndContinue\ActiveStatementsMapTests.cs (3)
118
var solution = workspace.
CurrentSolution
175
var solution = workspace.
CurrentSolution
228
var solution = workspace.
CurrentSolution
EditAndContinue\EditSessionActiveStatementsTests.cs (1)
69
var solution = workspace.
CurrentSolution
;
EditAndContinue\EmitSolutionUpdateResultsTests.cs (2)
28
solution = workspace.
CurrentSolution
;
73
var document = workspace.
CurrentSolution
.
EditAndContinue\RemoteEditAndContinueServiceTests.cs (5)
81
await localWorkspace.ChangeSolutionAsync(localWorkspace.
CurrentSolution
88
var solution = localWorkspace.
CurrentSolution
;
142
localWorkspace.
CurrentSolution
,
222
var results = await sessionProxy.EmitSolutionUpdateAsync(localWorkspace.
CurrentSolution
, runningProjects1, activeStatementSpanProvider, CancellationToken.None);
270
var baseActiveSpans = await sessionProxy.GetBaseActiveStatementSpansAsync(localWorkspace.
CurrentSolution
, [documentId, inProcOnlyDocumentId], CancellationToken.None);
FindUsages\DefinitionItemFactoryTests.cs (29)
132
var solution = workspace.
CurrentSolution
;
168
var solution = workspace.
CurrentSolution
;
210
var solution = workspace.
CurrentSolution
;
246
var solution = workspace.
CurrentSolution
;
288
var solution = workspace.
CurrentSolution
;
330
var solution = workspace.
CurrentSolution
;
383
var solution = workspace.
CurrentSolution
;
437
var solution = workspace.
CurrentSolution
;
477
var solution = workspace.
CurrentSolution
;
517
var solution = workspace.
CurrentSolution
;
559
var solution = workspace.
CurrentSolution
;
617
var solution = workspace.
CurrentSolution
;
663
var solution = workspace.
CurrentSolution
;
700
var solution = workspace.
CurrentSolution
;
762
var solution = workspace.
CurrentSolution
;
818
var solution = workspace.
CurrentSolution
;
872
var solution = workspace.
CurrentSolution
;
927
var solution = workspace.
CurrentSolution
;
977
var solution = workspace.
CurrentSolution
;
1032
var solution = workspace.
CurrentSolution
;
1084
var solution = workspace.
CurrentSolution
;
1146
var solution = workspace.
CurrentSolution
;
1203
var solution = workspace.
CurrentSolution
;
1260
var solution = workspace.
CurrentSolution
;
1332
var solution = workspace.
CurrentSolution
;
1392
var solution = workspace.
CurrentSolution
;
1444
var solution = workspace.
CurrentSolution
;
1507
var solution = workspace.
CurrentSolution
;
1578
var solution = workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.LanguageServer (17)
FileBasedPrograms\CanonicalMiscFilesProjectLoader.cs (6)
125
var solution = _workspaceFactory.MiscellaneousFilesWorkspaceProjectFactory.Workspace.
CurrentSolution
;
163
var addedDocument = miscWorkspace.
CurrentSolution
.GetRequiredDocument(newDocumentInfo.Id);
191
var addedDocument = miscWorkspace.
CurrentSolution
.GetRequiredDocument(documentInfo.Id);
239
var addedDocument = miscWorkspace.
CurrentSolution
.GetRequiredDocument(documentInfo.Id);
294
var primordialProject = primordialWorkspace.
CurrentSolution
.GetRequiredProject(primordialProjectId);
364
var project = miscWorkspace.
CurrentSolution
.Projects
FileBasedPrograms\FileBasedProgramsProjectSystem.cs (2)
164
return workspace.
CurrentSolution
.GetRequiredAdditionalDocument(docId);
168
return workspace.
CurrentSolution
.GetRequiredDocument(id);
HostWorkspace\LanguageServerProjectSystem.cs (1)
51
_projectFileExtensionRegistry = new ProjectFileExtensionRegistry(workspace.
CurrentSolution
.Services, new DiagnosticReporter(workspace));
HostWorkspace\LanguageServerWorkspace.cs (7)
16
/// our <see cref="Workspace.
CurrentSolution
"/> to stay in sync with all the document changes.
72
if (
CurrentSolution
.ContainsDocument(documentId))
76
else if (
CurrentSolution
.ContainsAdditionalDocument(documentId))
89
if (
CurrentSolution
.ContainsDocument(documentId))
93
else if (
CurrentSolution
.ContainsAdditionalDocument(documentId))
106
var textDocument = w.
CurrentSolution
.GetDocument(documentId) ?? w.
CurrentSolution
.GetAdditionalDocument(documentId);
HostWorkspace\LoadedProject.cs (1)
51
_optionsProcessor = new ProjectSystemProjectOptionsProcessor(projectSystemProject, projectFactory.Workspace.
CurrentSolution
.Services);
Microsoft.CodeAnalysis.LanguageServer.Protocol (10)
Workspaces\LspMiscellaneousFilesWorkspaceProvider.cs (6)
73
return
CurrentSolution
.GetRequiredAdditionalDocument(docId);
77
return
CurrentSolution
.GetRequiredDocument(id);
89
var matchingDocument =
CurrentSolution
.GetDocumentIds(uri).SingleOrDefault();
92
if (
CurrentSolution
.ContainsDocument(matchingDocument))
96
else if (
CurrentSolution
.ContainsAdditionalDocument(matchingDocument))
103
var project =
CurrentSolution
.GetRequiredProject(matchingDocument.ProjectId);
Workspaces\LspWorkspaceManager.cs (4)
97
foreach (var documentId in workspace.
CurrentSolution
.GetDocumentIds(uri))
349
var workspaceCurrentSolution = workspace.
CurrentSolution
;
387
workspaceCurrentSolution = workspace.
CurrentSolution
;
597
foreach (var document in workspace.
CurrentSolution
.Projects.SelectMany(documentSelector))
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (81)
CodeActions\CodeActionResolveTests.cs (5)
182
var documentBefore = testWorkspace.
CurrentSolution
.GetDocument(testWorkspace.Documents.Single().Id)!;
187
var documentAfter = testWorkspace.
CurrentSolution
.GetDocument(testWorkspace.Documents.Single().Id)!;
301
var project = testWorkspace.
CurrentSolution
.Projects.Single();
303
var existingDocumentUri = testWorkspace.
CurrentSolution
.GetRequiredDocument(testWorkspace.Documents.Single().Id).GetURI();
429
var existingDocument = testWorkspace.
CurrentSolution
.GetRequiredDocument(testWorkspace.Documents.Single().Id);
CodeActions\RunCodeActionsTests.cs (1)
49
var documentForB = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(doc => doc.Name.Equals("B.cs", StringComparison.OrdinalIgnoreCase));
Completion\CompletionTests.cs (1)
309
var solution = testLspServer.TestWorkspace.
CurrentSolution
;
Definitions\GoToDefinitionTests.cs (1)
367
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
Diagnostics\PullDiagnosticTests.cs (3)
1112
var solution = testLspServer.TestWorkspace.
CurrentSolution
;
1261
var document = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single();
1300
var project = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single();
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
72
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
MiscellaneousFiles\LspMiscellaneousFilesWorkspaceTests.cs (2)
25
var projectId = testLspServer.TestWorkspace.
CurrentSolution
.ProjectIds.Single();
34
return testLspServer.TestWorkspace.
CurrentSolution
.GetRequiredDocument(documentId);
Options\SolutionAnalyzerConfigOptionsUpdaterTests.cs (13)
51
Assert.Empty(workspace.
CurrentSolution
.FallbackAnalyzerOptions);
73
Assert.Empty(workspace.
CurrentSolution
.FallbackAnalyzerOptions);
80
Assert.False(workspace.
CurrentSolution
.FallbackAnalyzerOptions.TryGetValue(LanguageNames.CSharp, out _));
100
Assert.True(workspace.
CurrentSolution
.FallbackAnalyzerOptions.TryGetValue(language, out var fallbackOptions));
112
Assert.Empty(workspace.
CurrentSolution
.Projects);
149
Assert.False(workspace.
CurrentSolution
.FallbackAnalyzerOptions.TryGetValue(LanguageNames.CSharp, out _));
155
Assert.True(workspace.
CurrentSolution
.FallbackAnalyzerOptions.TryGetValue(LanguageNames.CSharp, out var fallbackOptions));
168
Assert.True(workspace.
CurrentSolution
.FallbackAnalyzerOptions.TryGetValue(LanguageNames.CSharp, out fallbackOptions));
173
var projectWithConfig = workspace.
CurrentSolution
.GetRequiredProject(testProjectWithConfig.Id);
212
var projectWithoutConfig = workspace.
CurrentSolution
.GetRequiredProject(testProjectWithoutConfig.Id);
279
Assert.Empty(workspace.
CurrentSolution
.FallbackAnalyzerOptions);
284
var optionsAfterProjectAdded = workspace.
CurrentSolution
.FallbackAnalyzerOptions;
291
Assert.Same(optionsAfterProjectAdded, workspace.
CurrentSolution
.FallbackAnalyzerOptions);
References\FindAllReferencesHandlerTests.cs (2)
377
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
415
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
Rename\RenameTests.cs (8)
268
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
274
var generatedDocument = (await workspace.
CurrentSolution
.Projects.First().GetSourceGeneratedDocumentsAsync()).First();
324
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
327
var generatedDocument = (await workspace.
CurrentSolution
.Projects.First().GetSourceGeneratedDocumentsAsync()).First();
377
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
383
var generatedDocument = (await workspace.
CurrentSolution
.Projects.First().GetSourceGeneratedDocumentsAsync()).First();
430
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
436
var generatedDocument = (await workspace.
CurrentSolution
.Projects.First().GetSourceGeneratedDocumentsAsync()).First();
SpellCheck\SpellCheckTests.cs (5)
343
var document = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.First();
420
var document = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.First();
460
var document = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.First();
498
var document = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.First();
554
var document = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.First();
UriTests.cs (2)
104
var workspaceDocument = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single();
137
var fileDocumentUri = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single().GetURI();
Workspaces\LspWorkspaceManagerTests.cs (36)
71
Assert.NotSame(testLspServer.TestWorkspace.
CurrentSolution
.GetDocument(firstDocument.Id), firstDocument);
72
Assert.Same(testLspServer.TestWorkspace.
CurrentSolution
.GetDocument(firstDocument.Id)?.State, firstDocument?.State);
77
Assert.Same(testLspServer.TestWorkspace.
CurrentSolution
.GetDocument(firstDocument.Id), firstDocument);
80
Assert.Same(testLspServer.TestWorkspace.
CurrentSolution
.GetDocument(secondDocument.Id), secondDocument);
100
Assert.Equal(testLspServer.TestWorkspace.
CurrentSolution
.GetDocument(firstDocumentWithChange.Id), firstDocumentWithChange);
101
Assert.Equal(testLspServer.TestWorkspace.
CurrentSolution
.GetDocument(secondDocumentUnchanged.Id), secondDocumentUnchanged);
135
Assert.Equal(testLspServer.TestWorkspace.
CurrentSolution
.GetDocument(secondDocument.Id), secondDocument);
139
Assert.NotEqual(testLspServer.TestWorkspace.
CurrentSolution
.GetDocument(secondDocument.Id), secondDocument);
153
Assert.Equal(testLspServer.TestWorkspace.
CurrentSolution
, openedDocument!.Project.Solution);
156
var newProject = testLspServer.TestWorkspace.
CurrentSolution
.Projects.First().WithAssemblyName("NewCSProj1");
164
Assert.Equal(testLspServer.TestWorkspace.
CurrentSolution
, openedDocument.Project.Solution);
181
Assert.Equal(testLspServer.TestWorkspace.
CurrentSolution
, openedDocument!.Project.Solution);
185
Assert.NotEqual(testLspServer.TestWorkspace.
CurrentSolution
, openedDocument!.Project.Solution);
189
var newProject = testLspServer.TestWorkspace.
CurrentSolution
.Projects.First().WithAssemblyName("NewCSProj1");
201
Assert.Equal(testLspServer.TestWorkspace.
CurrentSolution
, openedDocument.Project.Solution);
205
Assert.NotEqual(testLspServer.TestWorkspace.
CurrentSolution
, openedDocument.Project.Solution);
220
var newDocumentId = DocumentId.CreateNewId(testLspServer.TestWorkspace.
CurrentSolution
.ProjectIds[0]);
221
var newSolution = testLspServer.TestWorkspace.
CurrentSolution
.AddDocument(newDocumentId, "NewDoc.cs", SourceText.From("New Doc", System.Text.Encoding.UTF8, SourceHashAlgorithms.Default), filePath: @"C:\NewDoc.cs");
229
Assert.Equal(testLspServer.TestWorkspace.
CurrentSolution
, lspDocument.Project.Solution);
404
var newProjectWorkspaceTwo = testWorkspaceTwo.
CurrentSolution
.Projects.First().WithAssemblyName("NewCSProj1");
440
var documentUri = testWorkspace.
CurrentSolution
.Projects.First().Documents.First().GetURI();
459
var newProject = testWorkspace.
CurrentSolution
.Projects.First().WithAssemblyName(newAssemblyName);
488
Assert.Same(testLspServer.TestWorkspace.
CurrentSolution
, lspDocument.Project.Solution);
515
testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single()
522
(await testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single().GetTextAsync()).ToString());
535
(await testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single().GetTextAsync()).ToString());
542
testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().RemoveDocument(document1.Id).Solution);
561
var documentUri = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single().GetURI();
573
testLspServer.TestWorkspace.
CurrentSolution
.WithDocumentText(document.Id, SourceText.From("New Disk Contents")));
576
document = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single();
585
document = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single();
600
var documentUri = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single().GetURI();
667
Assert.Same(testLspServer.TestWorkspace.
CurrentSolution
, sourceGeneratedDocument.Project.Solution);
683
Assert.NotSame(testLspServer.TestWorkspace.
CurrentSolution
, sourceGeneratedDocument.Project.Solution);
699
Assert.Same(testLspServer.TestWorkspace.
CurrentSolution
, sourceGeneratedDocument.Project.Solution);
707
Assert.NotSame(testLspServer.TestWorkspace.
CurrentSolution
, sourceGeneratedDocument.Project.Solution);
Workspaces\SourceGeneratedDocumentUriTests.cs (1)
36
var deserialized = SourceGeneratedDocumentUri.DeserializeIdentity(testLspServer.TestWorkspace.
CurrentSolution
, uri.GetRequiredParsedUri());
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
FileBasedProgramsWorkspaceTests.cs (1)
65
return workspaceFactory.HostWorkspace.
CurrentSolution
.GetRequiredProject(project.Id).Documents.Single();
WorkspaceProjectFactoryServiceTests.cs (1)
50
var project = workspaceFactory.HostWorkspace.
CurrentSolution
.Projects.Single();
Microsoft.CodeAnalysis.Remote.ServiceHub (8)
Host\RemoteWorkspace.cs (4)
51
var currentSolutionChecksum = await this.
CurrentSolution
.CompilationState.GetChecksumAsync(cancellationToken).ConfigureAwait(false);
211
var currentSolution = this.
CurrentSolution
;
238
/// cref="Workspace.
CurrentSolution
"/> of this <see cref="RemoteWorkspace"/> is the responsibility of any
246
/// fork off of <see cref="Workspace.
CurrentSolution
"/> if possible. The latter is almost always what will
Host\RemoteWorkspace.SolutionCreator.cs (1)
626
await TestUtils.AssertChecksumsAsync(_assetProvider, checksumFromRequest, workspace.
CurrentSolution
, incrementalSolutionBuilt, projectConeId).ConfigureAwait(false);
Host\RemoteWorkspace_SolutionCaching.cs (1)
127
solutions.Add(this.
CurrentSolution
);
Host\RemoteWorkspaceManager.cs (1)
30
/// cref="Workspace.
CurrentSolution
"/> of the workspace it is created against (as well as any recent in-flight
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (1)
121
var document = workspace.
CurrentSolution
.GetDocument(documentId);
Microsoft.CodeAnalysis.Workspaces (71)
CodeActions\CodeAction_Cleanup.cs (1)
102
originalSolution ??= changedSolution.Workspace.
CurrentSolution
;
CodeActions\Operations\ApplyChangesOperation.cs (1)
53
var currentSolution = workspace.
CurrentSolution
;
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
122
var solution = _workspace.
CurrentSolution
;
244
foreach (var projectId in service._workspace.
CurrentSolution
.ProjectIds)
Formatting\Formatter.cs (1)
320
return syntaxFormattingService.GetFormattingOptions(optionSet ?? workspace.
CurrentSolution
.Options);
Recommendations\Recommender.cs (1)
26
var solution = workspace.
CurrentSolution
;
Workspace\AdhocWorkspace.cs (9)
57
return this.
CurrentSolution
;
83
return this.
CurrentSolution
.GetProject(projectInfo.Id);
143
return this.
CurrentSolution
.GetDocument(documentInfo.Id);
151
var doc = this.
CurrentSolution
.GetDocument(documentId);
164
var doc = this.
CurrentSolution
.GetDocument(documentId);
179
var doc = this.
CurrentSolution
.GetAdditionalDocument(documentId);
192
var doc = this.
CurrentSolution
.GetAdditionalDocument(documentId);
207
var doc = this.
CurrentSolution
.GetAnalyzerConfigDocument(documentId);
220
var doc = this.
CurrentSolution
.GetAnalyzerConfigDocument(documentId);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (3)
298
if (_documentAlreadyInWorkspace(_project._projectSystemProjectFactory.Workspace.
CurrentSolution
, documentId))
350
if (_project._projectSystemProjectFactory.Workspace.
CurrentSolution
.GetDocument(documentId) != null)
506
var documentToReload = w.
CurrentSolution
.GetDocument(documentId);
Workspace\ProjectSystem\ProjectSystemProject.cs (7)
277
TryReportCompilationThrownAway(_projectSystemProjectFactory.Workspace.
CurrentSolution
, Id);
510
private bool HasBeenRemoved => !_projectSystemProjectFactory.Workspace.
CurrentSolution
.ContainsProject(Id);
1321
return _projectSystemProjectFactory.Workspace.
CurrentSolution
.GetRequiredProject(Id).AllProjectReferences.Contains(projectReference);
1329
var projectReferencesInWorkspace = _projectSystemProjectFactory.Workspace.
CurrentSolution
.GetRequiredProject(Id).AllProjectReferences;
1368
if (!_projectSystemProjectFactory.Workspace.
CurrentSolution
.ContainsProject(Id))
1395
var project = w.
CurrentSolution
.GetRequiredProject(Id);
1403
if (w.
CurrentSolution
.ProjectIds.Count == 1)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (2)
155
analyzerReferences: w.
CurrentSolution
.AnalyzerReferences).WithTelemetryId(SolutionTelemetryId);
393
project = Workspace.
CurrentSolution
.GetRequiredProject(projectId);
Workspace\TextExtensions.cs (4)
26
var solution = workspace.
CurrentSolution
;
62
var solution = workspace.
CurrentSolution
;
109
var solution = workspace.
CurrentSolution
;
130
return workspace.
CurrentSolution
.GetDocument(id);
Workspace\Workspace.cs (37)
168
/// Sets the <see cref="
CurrentSolution
"/> of this workspace. This method does not raise a WorkspaceChange event.
178
/// Sets the <see cref="
CurrentSolution
"/> of this workspace. This method does not raise a
193
var oldSolution = this.
CurrentSolution
;
223
/// Applies specified transformation to <see cref="
CurrentSolution
"/>, updates <see cref="
CurrentSolution
"/> to
233
/// <returns>True if <see cref="
CurrentSolution
"/> was set to the transformed solution, false if the
435
/// Applies specified transformation to <see cref="
CurrentSolution
"/>, updates <see cref="
CurrentSolution
"/> to
446
/// <param name="onBeforeUpdate">Action to perform immediately prior to updating <see cref="
CurrentSolution
"/>.
447
/// The action will be passed the old <see cref="
CurrentSolution
"/> that will be replaced and the exact solution
451
/// <param name="onAfterUpdate">Action to perform once <see cref="
CurrentSolution
"/> has been updated. The
452
/// action will be passed the old <see cref="
CurrentSolution
"/> that was just replaced and the exact solution it
542
/// Setter also force updates the <see cref="
CurrentSolution
"/> to have the updated <see cref="Solution.Options"/>.
548
return this.
CurrentSolution
.Options;
1547
var oldSolution = this.
CurrentSolution
;
1605
if (
CurrentSolution
.FallbackAnalyzerOptions != newSolution.FallbackAnalyzerOptions)
1610
if (!
CurrentSolution
.AnalyzerReferences.SequenceEqual(newSolution.AnalyzerReferences))
2094
var oldProject =
CurrentSolution
.GetRequiredProject(projectId);
2112
var oldProject =
CurrentSolution
.GetRequiredProject(projectId);
2326
=> CheckSolutionIsEmpty(this.
CurrentSolution
);
2340
=> CheckProjectIsInSolution(this.
CurrentSolution
, projectId);
2356
=> CheckProjectIsNotInSolution(this.
CurrentSolution
, projectId);
2373
if (!this.
CurrentSolution
.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference))
2386
if (this.
CurrentSolution
.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference))
2399
var transitiveReferences = this.
CurrentSolution
.GetProjectDependencyGraph().GetProjectsThatThisProjectTransitivelyDependsOn(toProjectId);
2413
if (!this.
CurrentSolution
.GetProject(projectId)!.MetadataReferences.Contains(metadataReference))
2424
if (this.
CurrentSolution
.GetProject(projectId)!.MetadataReferences.Contains(metadataReference))
2435
if (!this.
CurrentSolution
.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference))
2446
if (this.
CurrentSolution
.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference))
2478
=> CheckDocumentIsInSolution(this.
CurrentSolution
, documentId);
2494
=> CheckAdditionalDocumentIsInSolution(this.
CurrentSolution
, documentId);
2510
=> CheckAnalyzerConfigDocumentIsInSolution(this.
CurrentSolution
, documentId);
2527
if (this.
CurrentSolution
.ContainsDocument(documentId))
2539
=> CheckAdditionalDocumentIsNotInSolution(this.
CurrentSolution
, documentId);
2555
=> CheckAnalyzerConfigDocumentIsNotInSolution(this.
CurrentSolution
, documentId);
2572
var project = this.
CurrentSolution
.GetProject(projectId);
2582
var document = this.
CurrentSolution
.GetTextDocument(documentId);
Workspace\Workspace_Editor.cs (2)
213
/// Gets the ids for documents in the <see cref="
CurrentSolution
"/> snapshot associated with the given <paramref name="container"/>.
229
return
CurrentSolution
.GetRelatedDocumentIds(documentId);
Workspace\Workspace_Events.cs (1)
175
var currentSolution = this.
CurrentSolution
;
Microsoft.CodeAnalysis.Workspaces.MSBuild (12)
MSBuild\MSBuildWorkspace.cs (11)
211
return this.
CurrentSolution
;
250
var projectMap = ProjectMap.Create(this.
CurrentSolution
);
261
var projectResult = this.
CurrentSolution
.GetProject(projects[0].Id);
387
var document = this.
CurrentSolution
.GetDocument(documentId);
405
var document = this.
CurrentSolution
.GetAdditionalDocument(documentId);
453
var project = this.
CurrentSolution
.GetRequiredProject(info.Id.ProjectId);
513
var document = this.
CurrentSolution
.GetDocument(documentId);
597
var relativePath = PathUtilities.GetRelativePath(Path.GetDirectoryName(
CurrentSolution
.GetRequiredProject(projectId).FilePath)!, peRef.FilePath);
627
var project = this.
CurrentSolution
.GetProject(projectId);
652
var project = this.
CurrentSolution
.GetProject(projectReference.ProjectId);
667
var 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 (48)
NetCoreTests.cs (20)
90
Assert.Single(workspace.
CurrentSolution
.ProjectIds);
159
Assert.Single(workspace.
CurrentSolution
.ProjectIds);
170
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
177
Assert.Equal(libraryProject.FilePath, workspace.
CurrentSolution
.GetProject(projectRefId).FilePath);
199
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
210
Assert.Equal(3, workspace.
CurrentSolution
.ProjectIds.Count);
242
Assert.Equal(3, workspace.
CurrentSolution
.ProjectIds.Count);
247
foreach (var project in workspace.
CurrentSolution
.Projects)
260
foreach (var project in workspace.
CurrentSolution
.Projects)
284
Assert.Equal(3, workspace.
CurrentSolution
.ProjectIds.Count);
288
foreach (var project in workspace.
CurrentSolution
.Projects)
332
Assert.Equal(4, workspace.
CurrentSolution
.ProjectIds.Count);
337
foreach (var project in workspace.
CurrentSolution
.Projects)
359
foreach (var project in workspace.
CurrentSolution
.Projects)
395
var projects = workspace.
CurrentSolution
.Projects.Where(p => p.FilePath.EndsWith("Project.csproj"));
400
var referencedProject = workspace.
CurrentSolution
.GetProject(projectReference.ProjectId);
550
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
552
Assert.Contains(workspace.
CurrentSolution
.Projects, p => p.Name == "Library(net6)");
553
Assert.Contains(workspace.
CurrentSolution
.Projects, p => p.Name == "Library(net5)");
604
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
VisualStudioMSBuildWorkspaceTests.cs (28)
1431
vbProject = workspace.
CurrentSolution
.GetProject(vbProject.Id);
2001
var solution2 = workspace.
CurrentSolution
;
2021
var projectB = workspaceB.
CurrentSolution
.GetProjectsByName("CSharpProject").FirstOrDefault();
2044
var solution2 = workspace.
CurrentSolution
;
2077
var solution2 = workspace.
CurrentSolution
;
2106
var solution2 = workspace.
CurrentSolution
;
2133
var solution2 = workspace.
CurrentSolution
;
2159
var solution2 = workspace.
CurrentSolution
;
2189
workspace.TryApplyChanges(workspace.
CurrentSolution
.AddAdditionalDocument(DocumentId.CreateNewId(csProjectId), "foo.xaml", SourceText.From("<foo></foo>")));
2192
var xaml = workspace.
CurrentSolution
.GetProject(csProjectId).AdditionalDocuments.FirstOrDefault(d => d.Name == "XamlFile.xaml");
2199
workspace.TryApplyChanges(workspace.
CurrentSolution
.RemoveAdditionalDocument(xaml.Id));
2212
var originalSolution = workspace.
CurrentSolution
;
2221
var doc = workspace.
CurrentSolution
.Projects.First().Documents.First();
2225
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(doc.Id, SourceText.From(newText), PreservationMode.PreserveIdentity));
2242
var originalSolution = workspace.
CurrentSolution
;
2251
var doc = workspace.
CurrentSolution
.Projects.First().Documents.First();
2257
.
CurrentSolution
2287
Assert.Equal(2, workspace.
CurrentSolution
.Projects.Count());
2317
Assert.Equal(2, workspace.
CurrentSolution
.Projects.Count());
2570
var csproject = workspace.
CurrentSolution
.Projects.First(p => p.Language == LanguageNames.CSharp);
2578
var vbproject = workspace.
CurrentSolution
.Projects.First(p => p.Language == LanguageNames.VisualBasic);
2928
workspace.TryApplyChanges(workspace.
CurrentSolution
.GetProject(project.Id).RemoveAnalyzerReference(aref).Solution);
2949
workspace.TryApplyChanges(workspace.
CurrentSolution
.GetProject(project.Id).RemoveProjectReference(pref).Solution);
2950
Assert.Empty(workspace.
CurrentSolution
.GetProject(project.Id).ProjectReferences);
2956
workspace.TryApplyChanges(workspace.
CurrentSolution
.GetProject(project.Id).AddProjectReference(pref).Solution);
2957
Assert.Single(workspace.
CurrentSolution
.GetProject(project.Id).ProjectReferences);
3273
Assert.Equal(0, workspace.
CurrentSolution
.ProjectIds.Count);
3301
Assert.Equal(0, workspace.
CurrentSolution
.ProjectIds.Count);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (11)
Formatting\FormattingTestBase.cs (1)
43
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", language);
WorkspaceExtensions.cs (3)
18
var oldSolution = workspace.
CurrentSolution
;
26
var oldSolution = workspace.
CurrentSolution
;
33
var oldSolution = workspace.
CurrentSolution
;
Workspaces\TestHostDocument.cs (1)
43
var project = workspace.
CurrentSolution
.GetRequiredProject(_project!.Id);
Workspaces\TestWorkspace`1.cs (6)
517
var document = await
CurrentSolution
.GetSourceGeneratedDocumentAsync(documentId, CancellationToken.None);
524
return ChangeDocumentAsync(documentId, this.
CurrentSolution
.WithDocumentText(documentId, text));
538
var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.
CurrentSolution
.AddDocument(documentInfo));
545
var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.
CurrentSolution
.WithAdditionalDocumentText(documentId, text));
552
var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.
CurrentSolution
.WithAnalyzerConfigDocumentText(documentId, text));
781
SerializerService.TestAccessor.AddAnalyzerImageReferences(this.
CurrentSolution
.AnalyzerReferences);
Microsoft.CodeAnalysis.Workspaces.UnitTests (361)
CodeCleanup\AddMissingTokensTests.cs (1)
2587
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\CodeCleanupTests.cs (1)
423
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\FixIncorrectTokenTests.cs (1)
732
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\NormalizeModifiersOrOperatorsTests.cs (1)
933
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\ReduceTokenTests.cs (1)
1993
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\RemoveUnnecessaryLineContinuationTests.cs (1)
1335
var solution = new AdhocWorkspace().
CurrentSolution
;
CommandLineProject\CommandLineProjectWorkspaceTests.cs (2)
30
var project = ws.
CurrentSolution
.GetProject(info.Id);
58
var project = ws.
CurrentSolution
.GetProject(info.Id);
FindAllDeclarationsTests.cs (3)
127
var solution = workspace.
CurrentSolution
;
150
var solution = workspace.
CurrentSolution
;
651
var solution = workspace.
CurrentSolution
FindAllDeclarationsTests.TestSolutionsAndProject.cs (2)
94
solution = workspace.
CurrentSolution
109
solution = workspace.
CurrentSolution
;
FindReferencesTests.cs (8)
63
return workspace.
CurrentSolution
73
var solution = workspace.
CurrentSolution
126
var solution = workspace.
CurrentSolution
178
var sln = CreateWorkspace().
CurrentSolution
219
var sln = CreateWorkspace().
CurrentSolution
285
var sln = CreateWorkspace().
CurrentSolution
375
var solution = CreateWorkspace().
CurrentSolution
;
475
var solution = CreateWorkspace().
CurrentSolution
;
Formatter\FormatterTests.cs (3)
72
var solutionOptions = workspace.
CurrentSolution
.Options.
126
var updatedSolutionOptions = OptionsTestHelpers.GetOptionSetWithChangedOptions(workspace.
CurrentSolution
.Options, OptionsTestHelpers.PublicFormattingOptionsWithNonDefaultValues);
127
var solutionWithUpdatedOptions = workspace.
CurrentSolution
.WithOptions(updatedSolutionOptions);
GeneratedCodeRecognitionTests.cs (1)
97
return new AdhocWorkspace().
CurrentSolution
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (1)
20
var solution = workspace.
CurrentSolution
;
SemanticModelReuse\SemanticModelReuseTests.cs (1)
26
var solution = new AdhocWorkspace().
CurrentSolution
;
Simplifier\SimplifierTests.cs (2)
81
var updatedOptions = GetOptionSetWithChangedPublicOptions(workspace.
CurrentSolution
.Options);
90
var solutionWithUpdatedOptions = workspace.
CurrentSolution
.WithOptions(updatedOptions);
SolutionTests\ProjectDependencyGraphTests.cs (1)
738
=> new AdhocWorkspace().
CurrentSolution
;
SolutionTests\ProjectSemanticVersionTests.cs (18)
22
var project = AddEmptyProject(workspace.
CurrentSolution
);
31
var project = AddEmptyProject(workspace.
CurrentSolution
)
41
var document = AddEmptyProject(workspace.
CurrentSolution
)
55
var document = AddEmptyProject(workspace.
CurrentSolution
)
69
var document = AddEmptyProject(workspace.
CurrentSolution
)
83
var document = AddEmptyProject(workspace.
CurrentSolution
)
97
var document = AddEmptyProject(workspace.
CurrentSolution
)
111
var document = AddEmptyProject(workspace.
CurrentSolution
)
125
var document = AddEmptyProject(workspace.
CurrentSolution
)
139
var document = AddEmptyProject(workspace.
CurrentSolution
)
153
var document = AddEmptyProject(workspace.
CurrentSolution
, LanguageNames.VisualBasic)
167
var document = AddEmptyProject(workspace.
CurrentSolution
, LanguageNames.VisualBasic)
181
var document = AddEmptyProject(workspace.
CurrentSolution
, LanguageNames.VisualBasic)
195
var document = AddEmptyProject(workspace.
CurrentSolution
, LanguageNames.VisualBasic)
209
var document = AddEmptyProject(workspace.
CurrentSolution
, LanguageNames.VisualBasic)
223
var document = AddEmptyProject(workspace.
CurrentSolution
, LanguageNames.VisualBasic)
237
var document = AddEmptyProject(workspace.
CurrentSolution
, LanguageNames.VisualBasic)
251
var document = AddEmptyProject(workspace.
CurrentSolution
, LanguageNames.VisualBasic)
SolutionTests\SolutionTests.cs (191)
56
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
78
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
115
var solution = workspace.
CurrentSolution
;
124
var solution = workspace.
CurrentSolution
;
134
var solution = workspace.
CurrentSolution
;
143
var solution = workspace.
CurrentSolution
;
153
var solution = workspace.
CurrentSolution
;
162
var solution = workspace.
CurrentSolution
;
172
var solution = workspace.
CurrentSolution
;
192
var solution = workspace.
CurrentSolution
;
223
var solution = workspace.
CurrentSolution
;
250
var solution = workspace.
CurrentSolution
;
269
var solution = workspace.
CurrentSolution
;
288
var solution = workspace.
CurrentSolution
;
299
var solution = workspace.
CurrentSolution
;
327
var solution = workspace.
CurrentSolution
;
343
var solution = workspace.
CurrentSolution
359
var solution = workspace.
CurrentSolution
;
384
var solution = workspace.
CurrentSolution
;
408
var solution = workspace.
CurrentSolution
;
441
var solution = workspace.
CurrentSolution
;
488
solution = workspace.
CurrentSolution
;
529
var solution = workspace.
CurrentSolution
;
576
solution = workspace.
CurrentSolution
;
608
var solution = workspace.
CurrentSolution
;
662
solution = workspace.
CurrentSolution
;
694
var solution = workspace.
CurrentSolution
;
742
solution = workspace.
CurrentSolution
;
771
var solution = workspace.
CurrentSolution
;
818
solution = workspace.
CurrentSolution
;
853
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
859
var solution = workspace.
CurrentSolution
;
907
solution = workspace.
CurrentSolution
;
930
var solution = workspace.
CurrentSolution
;
952
var solution = workspace.
CurrentSolution
;
976
var solution = workspace.
CurrentSolution
;
998
var solution = workspace.
CurrentSolution
;
1022
var solution = workspace.
CurrentSolution
;
1044
var solution = workspace.
CurrentSolution
;
1066
var solution = workspace.
CurrentSolution
;
1102
var solution = workspace.
CurrentSolution
1324
var solution = workspace.
CurrentSolution
1358
var solution = workspace.
CurrentSolution
1393
var solution = workspace.
CurrentSolution
1428
var solution = workspace.
CurrentSolution
1463
var solution = workspace.
CurrentSolution
1497
var solution = workspace.
CurrentSolution
1519
var solution = workspace.
CurrentSolution
1547
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp);
1574
var solution = workspace.
CurrentSolution
1597
var solution = workspace.
CurrentSolution
1620
var solution = workspace.
CurrentSolution
.
1643
var solution = workspace.
CurrentSolution
.
1680
var solution = workspace.
CurrentSolution
1734
var solution = workspace.
CurrentSolution
1756
var solution = workspace.
CurrentSolution
1779
var solution = workspace.
CurrentSolution
1796
var solution = workspace.
CurrentSolution
1821
var solution = workspace.
CurrentSolution
1845
var document = workspace.
CurrentSolution
1883
var document = workspace.
CurrentSolution
1921
var document = workspace.
CurrentSolution
1940
var document = workspace.
CurrentSolution
1959
var document = workspace.
CurrentSolution
1975
var solution = workspace.
CurrentSolution
;
2008
var solution = workspace.
CurrentSolution
;
2024
var solution = workspace.
CurrentSolution
;
2066
var solution = workspace.
CurrentSolution
;
2101
var solution = workspace.
CurrentSolution
;
2137
var solution = workspace.
CurrentSolution
;
2155
var solution = workspace.
CurrentSolution
;
2180
var solution = workspace.
CurrentSolution
;
2207
var solution = workspace.
CurrentSolution
;
2225
var solution = workspace.
CurrentSolution
;
2253
var solution = workspace.
CurrentSolution
;
2280
var solution = workspace.
CurrentSolution
;
2294
var solution = workspace.
CurrentSolution
;
2320
var solution = workspace.
CurrentSolution
;
2347
var solution = workspace.
CurrentSolution
;
2366
TestOptionValues(workspace.
CurrentSolution
, expectedA: "A", hasBWithoutFallback: false, expectedB: "fallbackY", expectedBFile: "fallbackY");
2423
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2449
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2479
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2507
var origSolution = workspace.
CurrentSolution
;
2540
var solution = workspace.
CurrentSolution
2570
var solution = workspace.
CurrentSolution
2599
var solution = workspace.
CurrentSolution
2620
var solution = workspace.
CurrentSolution
2637
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2666
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2700
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2723
var solution = workspace.
CurrentSolution
;
2736
var solution = workspace.
CurrentSolution
;
2748
var solution = workspace.
CurrentSolution
;
2763
var solution = workspace.
CurrentSolution
2809
var solution = workspace.
CurrentSolution
2833
var solution = workspace.
CurrentSolution
2861
var solution = workspace.
CurrentSolution
2871
var solution = workspace.
CurrentSolution
;
2885
var solution = workspace.
CurrentSolution
2906
var solution = workspace.
CurrentSolution
2927
var solution = workspace.
CurrentSolution
2946
var solution = workspace.
CurrentSolution
2965
var solution = workspace.
CurrentSolution
2980
var solution = workspace.
CurrentSolution
2999
var solution = workspace.
CurrentSolution
3016
var solution = workspace.
CurrentSolution
3118
var solution = workspace.
CurrentSolution
;
3139
var solution = workspace.
CurrentSolution
;
3177
var solution = workspace.
CurrentSolution
;
3235
var solution = workspace.
CurrentSolution
;
3253
var sol = workspace.
CurrentSolution
;
3272
var sol = workspace.
CurrentSolution
;
3298
var sol = workspace.
CurrentSolution
;
3334
var sol = workspace.
CurrentSolution
3355
var solution1 = workspace.
CurrentSolution
3378
var sol = workspace.
CurrentSolution
3419
var sol = workspace.
CurrentSolution
3460
var solution = workspace.
CurrentSolution
3491
var sol = workspace.
CurrentSolution
;
3522
var sol = workspace.
CurrentSolution
3544
var sol = workspace.
CurrentSolution
3565
var sol = workspace.
CurrentSolution
3589
var sol = workspace.
CurrentSolution
3611
var sol = workspace.
CurrentSolution
3632
var sol = workspace.
CurrentSolution
3652
var sol = workspace.
CurrentSolution
3672
var sol = workspace.
CurrentSolution
3692
var sol = workspace.
CurrentSolution
3711
var sol = workspace.
CurrentSolution
3742
var sol = workspace.
CurrentSolution
3774
var sol = workspace.
CurrentSolution
3800
var sol = workspace.
CurrentSolution
3836
var sol = workspace.
CurrentSolution
3868
var sol = workspace.
CurrentSolution
3919
var sol = workspace.
CurrentSolution
3944
var sol = workspace.
CurrentSolution
3971
var sol = workspace.
CurrentSolution
4105
var solution = workspace.
CurrentSolution
;
4159
var solution = new AdhocWorkspace().
CurrentSolution
4285
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4310
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4338
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4383
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4465
var project = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4483
var project = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4499
var originalProject = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4523
var originalProject = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4551
var document = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4567
var solution = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp).Solution;
4623
var currentSolution = workspace.
CurrentSolution
;
4763
var solution = workspace.
CurrentSolution
;
4779
var solution = workspace.
CurrentSolution
;
4840
var solution = workspace.
CurrentSolution
;
4867
var solution = workspace.
CurrentSolution
;
4903
var solution = workspace.
CurrentSolution
;
4944
var solution = workspace.
CurrentSolution
;
4990
var solution = workspace.
CurrentSolution
;
5021
var solution = workspace.
CurrentSolution
;
5072
var solution = workspace.
CurrentSolution
;
5096
var solution = workspace.
CurrentSolution
5113
var solution = workspace.
CurrentSolution
;
5131
var solution = workspace.
CurrentSolution
;
5154
var solution = workspace.
CurrentSolution
;
5176
var solution = workspace.
CurrentSolution
;
5204
var solution = workspace.
CurrentSolution
;
5232
var solution = workspace.
CurrentSolution
;
5261
var solution = workspace.
CurrentSolution
;
5292
var solution = workspace.
CurrentSolution
;
5330
var solution = workspace.
CurrentSolution
;
5347
var solution = workspace.
CurrentSolution
;
5393
var solution = workspace.
CurrentSolution
;
5437
var solution = workspace.
CurrentSolution
;
5461
var solution = workspace.
CurrentSolution
;
5599
var s0 = workspace.
CurrentSolution
;
5645
var solution = workspace.
CurrentSolution
.AddProject(projInfo);
5674
var solution = workspace.
CurrentSolution
;
5728
var solution = workspace.
CurrentSolution
5756
var solution = workspace.
CurrentSolution
5776
var solution = workspace.
CurrentSolution
5790
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
5807
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
5827
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5855
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5885
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5918
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5943
var project1 = workspace.
CurrentSolution
5995
var project = workspace.
CurrentSolution
.AddProject("TypeScript", "TypeScript", "TypeScript");
6016
var project1 = workspace.
CurrentSolution
6049
var document1 = workspace.
CurrentSolution
.GetRequiredDocument(documentId1);
6055
var document2 = workspace.
CurrentSolution
.GetRequiredDocument(documentId2);
SolutionTests\SolutionWithSourceGeneratorTests.cs (56)
49
var project = AddEmptyProject(workspace.
CurrentSolution
)
90
var project = AddEmptyProject(workspace.
CurrentSolution
)
138
var project = AddEmptyProject(workspace.
CurrentSolution
)
165
var project = AddEmptyProject(workspace.
CurrentSolution
)
182
var project = AddEmptyProject(workspace.
CurrentSolution
)
254
var project = AddEmptyProject(workspace.
CurrentSolution
)
294
var project = AddEmptyProject(workspace.
CurrentSolution
)
338
var project = AddEmptyProject(workspace.
CurrentSolution
)
366
var projectBeforeChange = AddEmptyProject(workspace.
CurrentSolution
)
389
var solutionWithProjects = AddProjectWithReference(workspace.
CurrentSolution
, analyzerReference);
419
var solution = AddEmptyProject(workspace.
CurrentSolution
)
444
var project = AddEmptyProject(workspace.
CurrentSolution
)
458
var project = AddEmptyProject(workspace.
CurrentSolution
)
481
var project = AddEmptyProject(workspace.
CurrentSolution
)
501
var project = AddEmptyProject(workspace.
CurrentSolution
)
528
var project = AddEmptyProject(workspace.
CurrentSolution
)
576
var project = AddEmptyProject(workspace.
CurrentSolution
);
589
var project = AddEmptyProject(workspace.
CurrentSolution
)
601
Assert.NotSame(workspace.
CurrentSolution
, generatedDocument.Project.Solution);
613
var project = AddEmptyProject(workspace.
CurrentSolution
)
618
var generatedDocument = Assert.Single(await workspace.
CurrentSolution
.Projects.Single().GetSourceGeneratedDocumentsAsync());
624
Assert.Same(workspace.
CurrentSolution
, generatedDocument!.Project.Solution);
632
var originalAdditionalFile = AddEmptyProject(workspace.
CurrentSolution
)
645
Assert.Empty(await workspace.
CurrentSolution
.Projects.Single().GetSourceGeneratedDocumentsAsync());
660
var solution = AddEmptyProject(workspace.
CurrentSolution
)
669
var generatedDocument = Assert.Single(await workspace.
CurrentSolution
.GetRequiredProject(projectIdWithGenerator).GetSourceGeneratedDocumentsAsync());
691
var project = AddEmptyProject(workspace.
CurrentSolution
)
703
var document = await workspace.
CurrentSolution
.GetSourceGeneratedDocumentAsync(generatedDocument.Identity.DocumentId, CancellationToken.None);
719
var project = AddEmptyProject(workspace.
CurrentSolution
)
725
var documentToFreeze = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
750
var project = AddEmptyProject(workspace.
CurrentSolution
)
779
var project = AddEmptyProject(workspace.
CurrentSolution
)
809
var originalDocument1 = AddEmptyProject(workspace.
CurrentSolution
, name: "Project1")
847
var project = AddEmptyProject(workspace.
CurrentSolution
);
871
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
904
var solution = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference).Solution;
929
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
949
var project0 = AddEmptyProject(workspace.
CurrentSolution
);
985
var project = AddEmptyProject(workspace.
CurrentSolution
)
1017
var project = AddEmptyProject(workspace.
CurrentSolution
)
1047
var project = AddEmptyProject(workspace.
CurrentSolution
)
1087
var project = AddEmptyProject(workspace.
CurrentSolution
)
1115
var project = AddEmptyProject(workspace.
CurrentSolution
)
1142
var project = AddEmptyProject(workspace.
CurrentSolution
)
1170
var project = AddEmptyProject(workspace.
CurrentSolution
)
1203
var project = AddEmptyProject(workspace.
CurrentSolution
)
1258
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
1293
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
1330
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
1361
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
1408
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
1461
var solution = workspace.
CurrentSolution
;
1514
project1 = workspace.
CurrentSolution
.GetRequiredProject(project1.Id);
1542
var initialSolution = workspace.
CurrentSolution
;
1553
var solutionWithChangedExecutionVersion = workspace.
CurrentSolution
;
1579
var finalSolution = workspace.
CurrentSolution
;
SolutionTests\SourceGeneratorTelemetryCollectorWorkspaceServiceTests.cs (1)
31
var project = AddEmptyProject(workspace.
CurrentSolution
)
SolutionTests\TryApplyChangesTests.cs (7)
78
var project = workspace.
CurrentSolution
.Projects.Single();
91
var project = workspace.
CurrentSolution
.Projects.Single();
104
var project = workspace.
CurrentSolution
.Projects.Single();
121
var project = workspace.
CurrentSolution
.Projects.Single();
136
var project = workspace.
CurrentSolution
.Projects.Single();
151
var project = workspace.
CurrentSolution
.Projects.Single();
165
var project = workspace.
CurrentSolution
.Projects.Single();
SymbolKeyTests.cs (2)
865
document = workspace.
CurrentSolution
.GetDocument(document.Id);
912
document = workspace.
CurrentSolution
.GetDocument(document.Id);
SyntaxNodeTests.cs (1)
83
var sol = new AdhocWorkspace().
CurrentSolution
SyntaxReferenceTests.cs (6)
49
var solution = AddSingleFileCSharpProject(workspace.
CurrentSolution
, """
72
var solution = AddSingleFileVisualBasicProject(workspace.
CurrentSolution
, """
94
var solution = AddSingleFileCSharpProject(workspace.
CurrentSolution
, """
117
var solution = AddSingleFileVisualBasicProject(workspace.
CurrentSolution
, """
140
var solution = AddSingleFileCSharpProject(workspace.
CurrentSolution
, """
168
var solution = AddSingleFileVisualBasicProject(workspace.
CurrentSolution
, """
WorkspaceServiceTests\GlobalOptionServiceTests.cs (15)
72
var newSolution1 = workspace1.
CurrentSolution
.WithOptions(newSet);
77
var oldSolution2 = workspace2.
CurrentSolution
;
83
var newSolution2 = workspace2.
CurrentSolution
;
103
var newSolution1 = workspace1.
CurrentSolution
.WithOptions(newSet);
107
var oldSolution2 = workspace2.
CurrentSolution
;
112
Assert.Equal("EOLN", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
113
Assert.Equal("EOLN", workspace2.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
119
Assert.Equal("EOLN", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
120
Assert.Equal("EOLN", workspace2.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
127
Assert.Equal("NEW_LINE", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
128
Assert.Equal("NEW_LINE", workspace2.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
133
Assert.Equal("NEW_LINE", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
134
Assert.Equal("NEW_LINE", workspace2.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
138
Assert.Equal("NEW_LINE2", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
139
Assert.Equal("NEW_LINE2", workspace2.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
WorkspaceTests\AdhocWorkspaceTests.cs (30)
37
Assert.Equal(project, ws.
CurrentSolution
.Projects.FirstOrDefault());
49
Assert.Same(project, ws.
CurrentSolution
.Projects.FirstOrDefault());
62
Assert.Equal(ws.
CurrentSolution
.GetDocument(info.Id), doc);
94
Assert.Same(ws.
CurrentSolution
, solution);
128
var solution = ws.
CurrentSolution
;
165
var newSolution = ws.
CurrentSolution
.AddProject(projInfo);
167
Assert.Equal(0, ws.
CurrentSolution
.Projects.Count());
172
Assert.Equal(1, ws.
CurrentSolution
.Projects.Count());
173
var proj = ws.
CurrentSolution
.Projects.First();
198
Assert.Equal(1, ws.
CurrentSolution
.Projects.Count());
200
var newSolution = ws.
CurrentSolution
.RemoveProject(pid);
206
Assert.Equal(0, ws.
CurrentSolution
.Projects.Count());
226
var doc = ws.
CurrentSolution
.GetDocument(docInfo.Id);
231
doc = ws.
CurrentSolution
.GetDocument(docInfo.Id);
239
doc = ws.
CurrentSolution
.GetDocument(docInfo.Id);
260
var doc = ws.
CurrentSolution
.GetAdditionalDocument(docInfo.Id);
265
doc = ws.
CurrentSolution
.GetAdditionalDocument(docInfo.Id);
273
doc = ws.
CurrentSolution
.GetAdditionalDocument(docInfo.Id);
299
var doc = ws.
CurrentSolution
.GetAnalyzerConfigDocument(docInfo.Id);
304
doc = ws.
CurrentSolution
.GetAnalyzerConfigDocument(docInfo.Id);
312
doc = ws.
CurrentSolution
.GetAnalyzerConfigDocument(docInfo.Id);
333
var doc = ws.
CurrentSolution
.GetDocument(docInfo.Id);
381
var pws = new WorkspaceWithPartialSemantics(ws.
CurrentSolution
);
382
var proj = pws.
CurrentSolution
.GetProject(projid);
390
var frozen = pws.
CurrentSolution
.GetDocument(docid1).WithFrozenPartialSemantics(CancellationToken.None);
434
var appliedDoc = ws.
CurrentSolution
.GetDocument(originalDoc.Id);
467
var appliedDoc = ws.
CurrentSolution
.GetDocument(originalDoc.Id);
501
var appliedDoc = ws.
CurrentSolution
.GetDocument(originalDoc.Id);
532
var appliedDoc = ws.
CurrentSolution
.GetDocument(originalDoc.Id);
562
var appliedDoc = ws.
CurrentSolution
.GetDocument(originalDoc.Id);
WorkspaceTests\WorkspaceTests.cs (4)
106
var newSolution = ws.
CurrentSolution
.WithAnalyzerReferences([new TestAnalyzerReference()]);
144
return this.
CurrentSolution
.GetProject(projectInfo.Id);
182
return this.
CurrentSolution
.GetDocument(documentInfo.Id);
190
var solution = workspace1.
CurrentSolution
;
Microsoft.VisualStudio.LanguageServices (105)
CallHierarchy\CallHierarchyDetail.cs (2)
31
_documentId = workspace.
CurrentSolution
.GetDocumentId(location.SourceTree);
69
var solution = _workspace.
CurrentSolution
;
CallHierarchy\Finders\AbstractCallFinder.cs (1)
94
var project = workspace.
CurrentSolution
.GetProject(_projectId);
CodeCleanup\AbstractCodeCleanUpFixer.cs (3)
57
var solution = _workspace.
CurrentSolution
;
92
var project = _workspace.
CurrentSolution
.GetProject(projectId);
117
var solution = _workspace.
CurrentSolution
;
CodeLens\CodeLensCallbackListener.cs (4)
73
var solution = _workspace.
CurrentSolution
;
93
var solution = _workspace.
CurrentSolution
;
125
var solution = _workspace.
CurrentSolution
;
164
var solution = _workspace.
CurrentSolution
;
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
122
var solution = _workspace.
CurrentSolution
;
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (2)
74
var currentSolution = _workspace.
CurrentSolution
;
175
var solution = _workspace.
CurrentSolution
;
Diagnostics\VisualStudioVenusSpanMappingService.cs (1)
87
var solution = _workspace.
CurrentSolution
;
EditorConfigSettings\SettingsEditorControl.xaml.cs (1)
83
var solution = _workspace.
CurrentSolution
;
EditorConfigSettings\SettingsEditorFactory.cs (2)
54
if (!workspace.
CurrentSolution
.Projects.Any(p => p.Language is LanguageNames.CSharp or LanguageNames.VisualBasic))
61
if (!workspace.
CurrentSolution
.Projects.Any(p => p.AnalyzerConfigDocuments.Any(editorconfig => StringComparer.OrdinalIgnoreCase.Equals(editorconfig.FilePath, filePath))))
Extensions\VisualStudioWorkspaceImplExtensions.cs (1)
70
var document = workspace.
CurrentSolution
.GetDocument(id);
Implementation\AbstractEditorFactory.cs (1)
291
var solution = workspace.
CurrentSolution
;
Implementation\HierarchyItemToProjectIdMap.cs (1)
26
=> TryGetProject(_workspace.
CurrentSolution
, hierarchyItem, targetFrameworkMoniker, out project);
Implementation\VisualStudioSupportsFeatureService.cs (1)
59
return SupportsRenameWorker(workspace.
CurrentSolution
.GetRelatedDocumentIds(documentId));
Implementation\VsRefactorNotifyService.cs (1)
175
var document = visualStudioWorkspace.
CurrentSolution
.GetDocument(documentId);
InheritanceMargin\MarginGlyph\InheritanceMarginContextMenu.xaml.cs (1)
68
var rehydrated = await viewModel.DefinitionItem.TryRehydrateAsync(_workspace.
CurrentSolution
, cancellationToken).ConfigureAwait(false);
Interactive\VsResetInteractive.cs (1)
164
=> _workspace.
CurrentSolution
.Projects.FirstOrDefault(proj => _workspace.GetHierarchy(proj.Id) == hierarchy);
LanguageService\AbstractCreateServicesOnTextViewConnection.cs (1)
90
else if (Workspace.
CurrentSolution
.GetProject(projectId) is Project project)
LanguageService\AbstractLanguageService`2.VsLanguageDebugInfo.cs (1)
203
var solution = _languageService.Workspace.Value.
CurrentSolution
;
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (4)
189
=> this.Workspace.
CurrentSolution
.GetProject(projectId);
313
this.Workspace.
CurrentSolution
, _languageName, CancellationToken.None).ConfigureAwait(true);
324
return new ObjectList(ObjectListKind.Projects, flags, this, this.GetProjectListItems(this.Workspace.
CurrentSolution
, _languageName, flags));
485
var project = this.Workspace.
CurrentSolution
.GetProject(symbolListItem.ProjectId);
Library\ObjectBrowser\ObjectList.cs (3)
681
var project = this.LibraryManager.Workspace.
CurrentSolution
.GetProject(symbolListItem.ProjectId);
751
var project = this.LibraryManager.Workspace.
CurrentSolution
.GetProject(symbolItem.ProjectId);
909
var project = this.LibraryManager.Workspace.
CurrentSolution
.GetProject(projectListItem.ProjectId);
Library\ObjectBrowser\ObjectListItem.cs (1)
75
var project = workspace.
CurrentSolution
.GetProject(ProjectId);
NavigateTo\RoslynSearchItemsSource.cs (1)
95
var solution = provider._workspace.
CurrentSolution
;
Packaging\PackageInstallerServiceFactory.cs (1)
481
var solution = Workspace.
CurrentSolution
;
Preview\PreviewUpdater.cs (2)
56
var existingDocument = _previewWorkspace.
CurrentSolution
.GetRequiredTextDocument(_currentDocumentId);
67
var currentDocument = _previewWorkspace.
CurrentSolution
.GetRequiredTextDocument(_currentDocumentId);
ProjectSystem\Legacy\AbstractLegacyProject.cs (1)
94
foreach (var projectId in Workspace.
CurrentSolution
.ProjectIds)
ProjectSystem\VisualStudioWorkspace.cs (1)
48
=>
CurrentSolution
.GetTextDocument(documentId)?.FilePath;
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
30
var currentSolution = Workspace.
CurrentSolution
;
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (2)
32
var currentSolution = Workspace.
CurrentSolution
;
45
var currentSolution = Workspace.
CurrentSolution
;
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
31
var currentSolution = Workspace.
CurrentSolution
;
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (2)
28
var currentSolution = Workspace.
CurrentSolution
;
43
var currentSolution = Workspace.
CurrentSolution
;
ProjectSystem\VisualStudioWorkspaceImpl.cs (13)
242
var document = _threadingContext.JoinableTaskFactory.Run(() =>
CurrentSolution
.GetDocumentAsync(documentId, includeSourceGenerated: true).AsTask());
267
var currentSolution = this.
CurrentSolution
;
440
var originalProject =
CurrentSolution
.GetRequiredProject(projectId);
458
var parseOptionsService =
CurrentSolution
.GetRequiredProject(projectId).Services.GetRequiredService<IParseOptionsChangingService>();
884
if (
CurrentSolution
.FilePath is null || documentInfo.FilePath is null)
893
var solutionDirectory = PathUtilities.GetDirectoryName(this.
CurrentSolution
.FilePath);
899
if (PathUtilities.GetDirectoryName(
CurrentSolution
.GetProject(documentInfo.Id.ProjectId)?.FilePath) == solutionDirectory)
977
var document = this.
CurrentSolution
.GetTextDocument(documentId);
1054
var document = this.
CurrentSolution
.GetTextDocument(documentId);
1165
document = this.
CurrentSolution
.GetRequiredTextDocument(documentId);
1238
var document =
CurrentSolution
.GetRequiredDocument(documentId);
1332
return
CurrentSolution
.GetRequiredProject(documentId.ProjectId).Language switch
1631
uiContext.IsActive = this.
CurrentSolution
.Projects.Any(p => p.Language == language);
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (9)
133
var documentIds = _projectSystemProjectFactory.Workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(moniker);
164
if (workspace.
CurrentSolution
.ContainsDocument(documentId))
168
else if (workspace.
CurrentSolution
.ContainsAdditionalDocument(documentId))
174
Debug.Assert(workspace.
CurrentSolution
.ContainsAnalyzerConfigDocument(documentId));
207
var solution = _workspace.
CurrentSolution
;
274
var documentIds = _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(moniker);
316
var documentIds = w.
CurrentSolution
.GetDocumentIdsWithFilePath(moniker);
326
var solution = w.
CurrentSolution
;
375
var needsContextUpdate = w.
CurrentSolution
.GetDocumentIdsWithFilePath(newFileName).Length >= 2;
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
30
var currentSolution = Workspace.
CurrentSolution
;
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (2)
28
var currentSolution = Workspace.
CurrentSolution
;
43
var currentSolution = Workspace.
CurrentSolution
;
ProjectSystem\VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs (2)
33
var documentId = _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(_filePath).FirstOrDefault();
36
var updatedSolution = _workspace.
CurrentSolution
.WithDocumentName(documentId, _toName);
ProjectSystem\VisualStudioWorkspaceImpl_SourceGenerators.cs (1)
57
var documentIds = _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(moniker);
StackTraceExplorer\StackFrameViewModel.cs (2)
212
(_cachedDocument, _cachedLineNumber) = _stackExplorerService.GetDocumentAndLine(_workspace.
CurrentSolution
, _frame);
223
_definitionCache[symbolPart] = await _stackExplorerService.TryFindDefinitionAsync(_workspace.
CurrentSolution
, _frame, symbolPart, cancellationToken).ConfigureAwait(false);
SyncNamespaces\SyncNamespacesCommandHandler.cs (5)
77
visible = _workspace.
CurrentSolution
.Projects
106
var projects = _workspace.
CurrentSolution
.Projects
117
var solution = _workspace.
CurrentSolution
;
143
if (_workspace.
CurrentSolution
.GetChanges(solution).GetProjectChanges().Any())
153
oldSolution: _workspace.
CurrentSolution
,
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
224
foreach (var p in _workspace.
CurrentSolution
.Projects)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (6)
202
var originalSolution = _workspace.
CurrentSolution
;
219
var newSolution = _workspace.
CurrentSolution
;
311
if (newSolution == _workspace.
CurrentSolution
)
322
_workspace.
CurrentSolution
,
474
var project = _workspace.
CurrentSolution
.GetProject(projectId);
554
var project = _workspace.
CurrentSolution
.GetProject(projectId);
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
320
_stateDoNotAccessDirectly ??= new InProgressState(_workspace.
CurrentSolution
);
TaskList\ProjectExternalErrorReporter.cs (3)
64
var solution = _workspace.
CurrentSolution
;
127
return _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(filePath)
247
var solution = _workspace.
CurrentSolution
;
UnusedReferences\RemoveUnusedReferencesCommandHandler.cs (1)
181
var solution = _workspace.
CurrentSolution
;
Utilities\IVsEditorAdaptersFactoryServiceExtensions.cs (1)
30
var document = workspace.
CurrentSolution
.GetDocument(contextDocumentId);
Venus\ContainedDocument.cs (4)
184
foreach (var document in _workspace.
CurrentSolution
.GetProject(_project.Id).Documents)
205
return hierarchy.TryGetItemId(_workspace.
CurrentSolution
.GetDocument(document.Id).FilePath);
242
var originalDocument = _workspace.
CurrentSolution
.GetDocument(this.Id);
763
var document = _workspace.
CurrentSolution
.GetDocument(this.Id);
Venus\ContainedLanguage.cs (1)
152
if (Workspace.
CurrentSolution
.ContainsDocument(ContainedDocument.Id))
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
61
var solution = visualStudioWorkspace.
CurrentSolution
;
Workspace\SourceGeneratedFileManager.cs (1)
357
var project = this.Workspace.
CurrentSolution
.GetProject(_documentIdentity.DocumentId.ProjectId);
Workspace\VisualStudioDocumentNavigationService.cs (4)
59
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
76
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
190
var solution = workspace.
CurrentSolution
;
258
var document = workspace.
CurrentSolution
.GetTextDocument(documentId);
Microsoft.VisualStudio.LanguageServices.CSharp (6)
CodeModel\CSharpCodeModelService.cs (1)
646
var project = state.Workspace.
CurrentSolution
.GetProject(projectId);
ProjectSystemShim\CSharpProjectShim.ICSharpProjectSite.cs (1)
132
var project = Workspace.
CurrentSolution
.GetRequiredProject(ProjectSystemProject.Id);
SemanticSearch\SemanticSearchDocumentNavigationService.cs (1)
31
Debug.Assert(documentId == window.SemanticSearchService.GetQueryDocumentId(workspace.
CurrentSolution
));
SemanticSearch\SemanticSearchPresenterController.cs (1)
42
await executor.ExecuteAsync(query, queryDocument: null, workspace.
CurrentSolution
, queryCancellationSource.Token).ConfigureAwait(false);
SemanticSearch\SemanticSearchToolWindowImpl.cs (2)
421
var querySolution = _semanticSearchWorkspace.Value.
CurrentSolution
;
434
var oldSolution = workspace.
CurrentSolution
;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (71)
CodeModel\AbstractFileCodeElementTests.cs (1)
51
=> GetWorkspace().
CurrentSolution
;
CodeModel\FileCodeModelTestHelpers.cs (1)
36
var project = workspace.
CurrentSolution
.Projects.Single();
DesignerAttribute\DesignerAttributeServiceTests.cs (1)
105
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
DocumentOutline\DocumentOutlineTestsBase.cs (2)
95
workspace.
CurrentSolution
.WithAnalyzerReferences([new TestAnalyzerReferenceByLanguage(DiagnosticExtensions.GetCompilerDiagnosticAnalyzersMap())]));
108
var locations = await GetAnnotatedLocationsAsync(testWorkspace, testWorkspace.
CurrentSolution
);
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (1)
29
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
EditorConfigSettings\DataProvider\DataProviderTests.cs (1)
30
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
F1Help\F1HelpTests.cs (1)
30
var actualText = await service.GetHelpTermAsync(workspace.
CurrentSolution
.Projects.First().Documents.First(), workspace.Documents.First().SelectedSpans.First(), CancellationToken.None);
Interactive\Commands\ResetInteractiveTests.cs (2)
51
var project = workspace.
CurrentSolution
.Projects.FirstOrDefault(p => p.AssemblyName == "ResetInteractiveTestsAssembly");
149
workspace.
CurrentSolution
.GetProject(p.ProjectId)));
PersistentStorage\AbstractPersistentStorageTests.cs (3)
842
var location = configuration.TryGetStorageLocation(SolutionKey.ToSolutionKey(workspace.
CurrentSolution
));
983
var solution = workspace.
CurrentSolution
;
997
return workspace.
CurrentSolution
;
ProjectSystemShim\CPS\AdditionalPropertiesTests.cs (9)
40
=> environment.Workspace.
CurrentSolution
.Projects.Single().DefaultNamespace;
57
var project = environment.Workspace.
CurrentSolution
.Projects.Single();
84
var project = environment.Workspace.
CurrentSolution
.Projects.Single();
132
Assert.Equal(expectedRunAnalyzers, environment.Workspace.
CurrentSolution
.Projects.Single().State.RunAnalyzers);
152
Assert.Equal(expectedRunAnalyzers, environment.Workspace.
CurrentSolution
.Projects.Single().State.RunAnalyzers);
162
Assert.Null(environment.Workspace.
CurrentSolution
.Projects.Single().CompilationOutputInfo.GeneratedFilesOutputDirectory);
168
environment.Workspace.
CurrentSolution
.Projects.Single().CompilationOutputInfo.GeneratedFilesOutputDirectory);
172
AssertEx.AreEqual(path, environment.Workspace.
CurrentSolution
.Projects.Single().CompilationOutputInfo.GeneratedFilesOutputDirectory);
176
Assert.Null(environment.Workspace.
CurrentSolution
.Projects.Single().CompilationOutputInfo.GeneratedFilesOutputDirectory);
ProjectSystemShim\CPS\AnalyzersTests.cs (3)
34
var workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single();
41
workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single();
68
var ca1012DiagnosticOption = environment.Workspace.
CurrentSolution
.Projects.Single().CompilationOptions.SpecificDiagnosticOptions["CA1012"];
ProjectSystemShim\CPS\CSharpCompilerOptionsTests.cs (7)
31
var parseOptions = environment.Workspace.
CurrentSolution
.Projects.Single().ParseOptions;
40
var parseOptions = environment.Workspace.
CurrentSolution
.Projects.Single().ParseOptions;
183
Assert.Equal(SourceHashAlgorithms.Default, environment.Workspace.
CurrentSolution
.Projects.Single().State.ChecksumAlgorithm);
187
Assert.Equal(SourceHashAlgorithm.Sha1, environment.Workspace.
CurrentSolution
.Projects.Single().State.ChecksumAlgorithm);
196
Assert.Null(environment.Workspace.
CurrentSolution
.Projects.Single().CompilationOutputInfo.GeneratedFilesOutputDirectory);
201
AssertEx.AreEqual(path, environment.Workspace.
CurrentSolution
.Projects.Single().CompilationOutputInfo.GeneratedFilesOutputDirectory);
207
environment.Workspace.
CurrentSolution
.Projects.Single().CompilationOutputInfo.GeneratedFilesOutputDirectory);
ProjectSystemShim\CPS\CSharpReferencesTests.cs (7)
52
.
CurrentSolution
.GetProject(project3.Id).ProjectReferences;
57
return environment.Workspace.
CurrentSolution
.GetProject(project3.Id)
101
Assert.Single(environment.Workspace.
CurrentSolution
.GetProject(project2.Id).AllProjectReferences);
105
Assert.Empty(environment.Workspace.
CurrentSolution
.GetProject(project2.Id).AllProjectReferences);
106
Assert.Single(environment.Workspace.
CurrentSolution
.GetProject(project2.Id).MetadataReferences);
122
Assert.Empty(environment.Workspace.
CurrentSolution
.GetProject(project1.Id).AllProjectReferences);
139
return environment.Workspace.
CurrentSolution
.Projects.Single()
ProjectSystemShim\CPS\SourceFileHandlingTests.cs (11)
31
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().Documents;
50
IEnumerable<TextDocument> GetCurrentAdditionalDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().AdditionalDocuments;
68
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().Documents;
69
VersionStamp GetVersion() => environment.Workspace.
CurrentSolution
.Projects.Single().Version;
118
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().Documents;
160
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().Documents;
214
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().Documents;
253
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().Documents;
292
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().Documents;
326
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().Documents;
372
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.
CurrentSolution
.Projects.Single().Documents;
ProjectSystemShim\LegacyProject\AnalyzersTests.cs (4)
61
var projectId = environment.Workspace.
CurrentSolution
.ProjectIds.Single();
81
var workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single();
88
workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single();
219
var workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single();
ProjectSystemShim\LegacyProject\CSharpCompilerOptionsTests.cs (7)
35
var workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single();
49
var workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single();
63
var workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single();
113
=> environment.Workspace.
CurrentSolution
.GetRequiredProject(project.Test_ProjectSystemProject.Id).CompilationOutputInfo.AssemblyPath;
146
=> environment.Workspace.
CurrentSolution
.GetRequiredProject(project.Test_ProjectSystemProject.Id).CompilationOutputInfo.AssemblyPath;
189
var project = environment.Workspace.
CurrentSolution
.Projects.Single();
220
var project = environment.Workspace.
CurrentSolution
.Projects.Single();
ProjectSystemShim\LegacyProject\OutputPathTests.cs (1)
34
var workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single();
ProjectSystemShim\LegacyProject\SourceFileHandlingTests.cs (7)
29
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().Documents);
43
var document = environment.Workspace.
CurrentSolution
.Projects.Single().Documents.Single();
56
var document = environment.Workspace.
CurrentSolution
.Projects.Single().Documents.Single();
66
var projectFolder = Path.GetDirectoryName(environment.Workspace.
CurrentSolution
.Projects.Single().FilePath);
70
var document = environment.Workspace.
CurrentSolution
.Projects.Single().Documents.Single();
80
var projectFolder = Path.GetDirectoryName(environment.Workspace.
CurrentSolution
.Projects.Single().FilePath);
84
var document = environment.Workspace.
CurrentSolution
.Projects.Single().Documents.Single();
ProjectSystemShim\LifetimeTests.cs (2)
25
Assert.Single(environment.Workspace.
CurrentSolution
.Projects);
30
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects);
Microsoft.VisualStudio.LanguageServices.Implementation (39)
CodeModel\AbstractCodeModelService.cs (3)
270
var project = state.Workspace.
CurrentSolution
.GetProject(projectId);
321
var project = workspace.
CurrentSolution
.GetProject(projectId);
496
var oldSolution = workspace.
CurrentSolution
;
CodeModel\CodeModelProjectCache.cs (1)
109
var solution = State.Workspace.
CurrentSolution
;
CodeModel\CodeTypeRef.cs (1)
77
var project = Workspace.
CurrentSolution
.GetProject(_projectId);
CodeModel\Collections\ExternalMemberCollection.cs (1)
47
var project = this.State.Workspace.
CurrentSolution
.GetProject(_projectId);
CodeModel\Collections\ExternalNamespaceEnumerator.cs (1)
61
var project = state.Workspace.
CurrentSolution
.GetProject(projectId);
CodeModel\Collections\OverloadsCollection.cs (1)
61
var solution = this.Workspace.
CurrentSolution
;
CodeModel\Collections\PartialTypeCollection.cs (1)
52
var solution = this.Workspace.
CurrentSolution
;
CodeModel\ExternalElements\AbstractExternalCodeElement.cs (1)
36
var project = this.State.Workspace.
CurrentSolution
.GetProject(this.ProjectId);
CodeModel\FileCodeModel.cs (4)
114
_previousDocument = Workspace.
CurrentSolution
.GetDocument(_documentId);
161
var project = this.State.Workspace.
CurrentSolution
.GetProject(_incomingProjectId);
415
() => Workspace.
CurrentSolution
.GetSourceGeneratedDocumentAsync(GetDocumentId(), CancellationToken.None).AsTask());
419
document = Workspace.
CurrentSolution
.GetDocument(GetDocumentId());
CodeModel\ProjectCodeModel.cs (1)
62
var workspaceProject = _visualStudioWorkspace.
CurrentSolution
.GetProject(_projectId);
CodeModel\ProjectCodeModelFactory.cs (1)
205
foreach (var projectState in _visualStudioWorkspace.
CurrentSolution
.SolutionState.SortedProjectStates)
CodeModel\RootCodeModel.cs (1)
40
=> Workspace.
CurrentSolution
.GetProject(_projectId);
Options\AbstractOptionPreviewViewModel.cs (1)
120
var project = workspace.
CurrentSolution
.AddProject(fileName, "assembly.dll", Language);
ProjectSystem\CPS\CPSProjectFactory.cs (1)
97
ImmutableInterlocked.Update(ref _solutionsWithMissingChecksumAlgorithm, static (set, solutionPath) => set.Add(solutionPath), _workspace.
CurrentSolution
.FilePath ?? "");
ProjectSystem\CPS\TempPECompiler.cs (1)
41
var project = _workspace.
CurrentSolution
.GetRequiredProject(context.Id);
RoslynVisualStudioWorkspace.cs (3)
60
var textDocument = this.
CurrentSolution
.GetTextDocument(documentId);
97
var currentProject = project.Solution.Workspace.
CurrentSolution
.GetProject(project.Id);
146
var project = this.
CurrentSolution
.GetProject(projectId);
SolutionExplorer\AnalyzerItem\AnalyzerItemSource.cs (1)
95
var project = this.Workspace.
CurrentSolution
.GetProject(this.ProjectId);
SolutionExplorer\AnalyzersCommandHandler.cs (3)
277
var project = workspace.
CurrentSolution
.GetProject(group.Key);
431
var originalSolution = workspace.
CurrentSolution
;
441
var project = workspace.
CurrentSolution
.GetProject(projectId);
SolutionExplorer\DiagnosticItem\BaseDiagnosticAndGeneratorItemSource.cs (1)
98
var project = this.Workspace.
CurrentSolution
.GetProject(this.ProjectId);
SolutionExplorer\DiagnosticItem\CpsDiagnosticItemSource.cs (3)
43
this.AnalyzerReference = TryGetAnalyzerReference(Workspace.
CurrentSolution
);
51
if (workspace.
CurrentSolution
.ContainsProject(projectId))
57
var analyzerReference = TryGetAnalyzerReference(Workspace.
CurrentSolution
);
SolutionExplorer\Search\RoslynSolutionExplorerSearchProvider.cs (1)
56
var solution = _workspace.
CurrentSolution
;
SolutionExplorer\Search\SolutionExplorerSearchDisplayItemSourceProvider.cs (1)
39
var document = workspace.
CurrentSolution
.GetDocument(item.Result.NavigableItem.Document.Id);
SolutionExplorer\SourceGeneratedFileItems\SourceGeneratedFileItemSource.cs (4)
157
var solution = _workspace.
CurrentSolution
;
169
if (_workspace.
CurrentSolution
!= solution)
174
OnWorkspaceChanged(new WorkspaceChangeEventArgs(WorkspaceChangeKind.SolutionChanged, solution, _workspace.
CurrentSolution
));
232
return UpdateSourceGeneratedFileItemsAsync(_workspace.
CurrentSolution
, cancellationToken);
SolutionExplorer\SymbolTree\RootSymbolTreeItemCollectionSource.cs (1)
73
var solution = _rootProvider._workspace.
CurrentSolution
;
SolutionExplorer\SymbolTree\SymbolItemContextMenuController.cs (1)
66
var document = rootProvider._workspace.
CurrentSolution
.GetDocument(item.ItemKey.DocumentId);
Microsoft.VisualStudio.LanguageServices.LiveShare (10)
Client\RemoteLanguageServiceWorkspace.cs (10)
241
var docId =
CurrentSolution
.GetDocumentIdsWithFilePath(filePath).FirstOrDefault();
244
return
CurrentSolution
.GetDocument(docId);
279
var docId =
CurrentSolution
.GetDocumentIdsWithFilePath(filePath).FirstOrDefault();
282
return
CurrentSolution
.GetDocument(docId);
317
var project =
CurrentSolution
.Projects.FirstOrDefault(p => p.Name == projectName && p.Language == language);
331
project =
CurrentSolution
.GetRequiredProject(projectInfo.Id);
341
return
CurrentSolution
.GetRequiredDocument(docInfo.Id);
370
if (
CurrentSolution
.ContainsProject(id.ProjectId))
386
var doc =
CurrentSolution
.GetDocument(documentId);
476
var document =
CurrentSolution
.GetDocument(documentId);
Microsoft.VisualStudio.LanguageServices.Xaml (4)
Implementation\XamlProjectService.cs (4)
170
var documentId = _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(filePath).Single(d => d.ProjectId == project.Id);
174
var document = _workspace.
CurrentSolution
.GetRequiredDocument(documentId);
204
var document = _workspace.
CurrentSolution
.GetDocument(documentId);
258
var documentId = _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(newMoniker).Single(d => d.ProjectId == project.Id);
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\WorkspacePanel.xaml.cs (1)
77
var solution = workspace.
CurrentSolution
;
Roslyn.VisualStudio.Next.UnitTests (203)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
64
Assert.True(workspace.
CurrentSolution
.CompilationState.TryGetStateChecksums(out _));
Remote\SnapshotSerializationTests.cs (13)
70
return workspace.
CurrentSolution
;
84
var solution = workspace.
CurrentSolution
;
105
var solution = workspace.
CurrentSolution
;
116
var solution = workspace.
CurrentSolution
;
139
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp);
153
var document = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp).AddDocument("Document", SourceText.From(code));
172
var solution = workspace.
CurrentSolution
;
476
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp);
501
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp);
520
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", NoCompilationConstants.LanguageName);
532
var document = CreateWorkspace().
CurrentSolution
.AddProject("empty", "empty", LanguageNames.CSharp).AddDocument("empty", SourceText.From(""));
548
var project = CreateWorkspace().
CurrentSolution
.AddProject("empty", "empty", LanguageNames.VisualBasic);
583
var solution = workspace.
CurrentSolution
Services\AssetProviderTests.cs (4)
71
var solution = workspace.
CurrentSolution
;
99
var solution = workspace.
CurrentSolution
;
124
var project = workspace.
CurrentSolution
.Projects.First();
154
var project = workspace.
CurrentSolution
.Projects.First();
Services\ServiceHubServicesTests.cs (128)
74
var solution = workspace.
CurrentSolution
;
83
await remoteWorkpace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None));
96
var solution = workspace.
CurrentSolution
;
151
var solution = workspace.
CurrentSolution
;
202
var solution = workspace.
CurrentSolution
;
213
workspace.
CurrentSolution
,
214
workspace.
CurrentSolution
.Projects.Single().Documents.Single(),
238
var solution = workspace.
CurrentSolution
.AddProject("unknown", "unknown", NoCompilationConstants.LanguageName).Solution;
248
Assert.Empty(remoteWorkspace.
CurrentSolution
.Projects);
253
await remoteWorkspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None));
259
await remoteWorkspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None));
273
var solution = workspace.
CurrentSolution
;
279
await remoteWorkspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None));
287
await remoteWorkspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None));
295
await remoteWorkspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None));
318
var solution = workspace.
CurrentSolution
;
329
await remoteWorkspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None));
338
solution = workspace.
CurrentSolution
;
343
await remoteWorkspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None));
352
solution = workspace.
CurrentSolution
;
357
await remoteWorkspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None));
447
var project = localWorkspace.
CurrentSolution
470
await UpdatePrimaryWorkspace(client, localWorkspace.
CurrentSolution
);
472
var localProject = localWorkspace.
CurrentSolution
.Projects.Single();
473
var remoteProject = remoteWorkspace.
CurrentSolution
.Projects.Single();
735
var solution = workspace.
CurrentSolution
;
747
solution = workspace.
CurrentSolution
;
770
var project = workspace.
CurrentSolution
819
var solution = workspace.
CurrentSolution
;
831
solution = workspace.
CurrentSolution
;
874
var solution = workspace.
CurrentSolution
;
887
solution = workspace.
CurrentSolution
;
912
var project1 = workspace.
CurrentSolution
921
var project2 = workspace.
CurrentSolution
929
var initialSolution = workspace.
CurrentSolution
;
934
var currentSolution = workspace.
CurrentSolution
;
963
var project1 = workspace.
CurrentSolution
972
var project2 = workspace.
CurrentSolution
980
var initialSolution = workspace.
CurrentSolution
;
985
var currentSolution = workspace.
CurrentSolution
;
1004
var project1 = workspace.
CurrentSolution
1013
var project2 = workspace.
CurrentSolution
1021
var initialSolution = workspace.
CurrentSolution
;
1028
var currentSolution = workspace.
CurrentSolution
;
1047
var project1 = workspace.
CurrentSolution
1056
var project2 = workspace.
CurrentSolution
1064
var initialSolution = workspace.
CurrentSolution
;
1070
var currentSolution = workspace.
CurrentSolution
;
1099
var project1 = workspace.
CurrentSolution
1108
var project2 = workspace.
CurrentSolution
1117
var initialSolution = workspace.
CurrentSolution
;
1123
var currentSolution = workspace.
CurrentSolution
;
1152
var project1 = workspace.
CurrentSolution
1161
var project2 = workspace.
CurrentSolution
1170
var initialSolution = workspace.
CurrentSolution
;
1176
var currentSolution = workspace.
CurrentSolution
;
1205
var project1 = workspace.
CurrentSolution
1214
var project2 = workspace.
CurrentSolution
1223
var initialSolution = workspace.
CurrentSolution
;
1231
var currentSolution = workspace.
CurrentSolution
;
1250
var project1 = workspace.
CurrentSolution
1259
var project2 = workspace.
CurrentSolution
1268
var initialSolution = workspace.
CurrentSolution
;
1276
var currentSolution = workspace.
CurrentSolution
;
1295
var project1 = workspace.
CurrentSolution
1304
var project2 = workspace.
CurrentSolution
1312
var initialSolution = workspace.
CurrentSolution
;
1319
var currentSolution = workspace.
CurrentSolution
;
1338
var project1 = workspace.
CurrentSolution
1347
var project2 = workspace.
CurrentSolution
1355
var initialSolution = workspace.
CurrentSolution
;
1362
var currentSolution = workspace.
CurrentSolution
;
1381
var project = workspace.
CurrentSolution
.Projects.Single();
1390
project = workspace.
CurrentSolution
.Projects.Single();
1430
var solution = workspace.
CurrentSolution
;
1434
var project = workspace.
CurrentSolution
.Projects.Single();
1451
project = workspace.
CurrentSolution
.Projects.Single();
1455
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(normalDocId, SourceText.From("// new text"))));
1460
solution = workspace.
CurrentSolution
;
1464
project = workspace.
CurrentSolution
.Projects.Single();
1478
project = workspace.
CurrentSolution
.Projects.Single();
1507
var project = workspace.
CurrentSolution
1518
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1527
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(tempDoc.Id, SourceText.From("// new text"))));
1528
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1541
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(tempDoc.Id, SourceText.From("// more new text"))));
1542
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1554
var project = workspace.
CurrentSolution
.Projects.Single();
1592
var project = workspace.
CurrentSolution
1602
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1605
project = workspace.
CurrentSolution
.Projects.Single();
1611
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(tempDoc.Id, SourceText.From("// new text"))));
1612
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1616
project = workspace.
CurrentSolution
.Projects.Single();
1622
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithProjectAnalyzerReferences(projectId, [.. project.AnalyzerReferences, new TestGeneratorReference(generator2)])));
1623
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1627
project = workspace.
CurrentSolution
.Projects.Single();
1633
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(tempDoc.Id, SourceText.From("// more new text"))));
1634
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1638
project = workspace.
CurrentSolution
.Projects.Single();
1671
var project = workspace.
CurrentSolution
1681
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1684
project = workspace.
CurrentSolution
.Projects.Single();
1690
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(tempDoc.Id, SourceText.From("// new text"))));
1691
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1695
project = workspace.
CurrentSolution
.Projects.Single();
1701
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithProjectAnalyzerReferences(projectId, [.. project.AnalyzerReferences, new TestGeneratorReference(generator2)])));
1702
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1706
project = workspace.
CurrentSolution
.Projects.Single();
1717
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(tempDoc.Id, SourceText.From("// more new text"))));
1718
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1722
project = workspace.
CurrentSolution
.Projects.Single();
1755
var project = workspace.
CurrentSolution
1765
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1768
project = workspace.
CurrentSolution
.Projects.Single();
1776
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithProjectAnalyzerReferences(projectId, [analyzerReference1]));
1778
await UpdatePrimaryWorkspace(client, workspace.
CurrentSolution
);
1787
project = workspace.
CurrentSolution
.Projects.Single();
1799
project = workspace.
CurrentSolution
.Projects.Single();
1814
var remoteSolution = remoteWorkspace.
CurrentSolution
;
1850
solution = localWorkspace.
CurrentSolution
;
1853
var currentRemoteSolution = remoteWorkspace.
CurrentSolution
;
1879
var project1 = workspace.
CurrentSolution
1885
var noCompilationProject = workspace.
CurrentSolution
.AddProject("unknown", "unknown", NoCompilationConstants.LanguageName);
1888
var initialSolution = workspace.
CurrentSolution
;
1898
var finalSolution = workspace.
CurrentSolution
;
1926
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
1929
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
Services\ServiceHubServicesTests_ExtensionMessageHandler.cs (14)
79
workspace.
CurrentSolution
, "MessageName", "JsonMessage", CancellationToken.None);
102
workspace.
CurrentSolution
.Projects.Single().Documents.Single(), "MessageName", "JsonMessage", CancellationToken.None);
350
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
376
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
411
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
449
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
496
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
507
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
541
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
572
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
608
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
661
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
685
localWorkspace.
CurrentSolution
,
691
localWorkspace.
CurrentSolution
.Projects.Single().Documents.Single(),
Services\SolutionAssetCacheTests.cs (1)
74
var solution = workspace.
CurrentSolution
;
Services\SolutionServiceTests.cs (35)
50
var solution = workspace.
CurrentSolution
;
67
var solution = workspace.
CurrentSolution
;
90
var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, workspace.
CurrentSolution
);
92
var solutionChecksum = await workspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None);
119
var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, workspace.
CurrentSolution
);
121
var solutionChecksum = await workspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None);
142
var solution = workspace.
CurrentSolution
;
322
var projectId = workspace.
CurrentSolution
.ProjectIds.First();
353
var projectId = workspace.
CurrentSolution
.ProjectIds.First();
386
var projectId = workspace.
CurrentSolution
.ProjectIds.First();
420
var solution1 = workspace.
CurrentSolution
;
470
Assert.Equal(remoteSolution, remoteWorkspace.
CurrentSolution
);
480
var solution = workspace.
CurrentSolution
;
500
var solution = workspace.
CurrentSolution
539
var solution = workspace.
CurrentSolution
;
580
var solution = workspace.
CurrentSolution
;
621
var solution = workspace.
CurrentSolution
;
654
var solution = workspace.
CurrentSolution
;
695
var solution = workspace.
CurrentSolution
;
735
var solution = workspace.
CurrentSolution
;
775
var solution = workspace.
CurrentSolution
;
808
var solution = workspace.
CurrentSolution
;
863
var solution = workspace.
CurrentSolution
;
909
var solution = workspace.
CurrentSolution
;
932
var solution = workspace.
CurrentSolution
;
952
solution = workspace.
CurrentSolution
;
977
var solution = workspace.
CurrentSolution
;
996
var solution = workspace.
CurrentSolution
;
1028
var solution = workspace.
CurrentSolution
;
1066
var solution = workspace.
CurrentSolution
;
1092
var solution = workspace.
CurrentSolution
;
1119
var solution = workspace.
CurrentSolution
;
1148
var solution = workspace.
CurrentSolution
;
1195
var solution = workspace.
CurrentSolution
;
1271
var solution = workspace.
CurrentSolution
;
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (7)
51
var project = workspace.
CurrentSolution
.Projects.First();
84
var project = workspace.
CurrentSolution
.Projects.First();
115
var task = Task.Run(() => AnalyzeAsync(workspace, workspace.
CurrentSolution
.ProjectIds.First(), analyzerType, isHostAnalyzer: false, source.Token));
151
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
156
var project = workspace.
CurrentSolution
.Projects.First();
195
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(analyzerReference);
218
var solution = workspace.
CurrentSolution
;
Test.Utilities (1)
CodeMetricsTestsBase.cs (1)
46
.
CurrentSolution