1802 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.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
320
var project = new AdhocWorkspace().
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)
180
var updatedDocument = workspace.
CurrentSolution
.GetRequiredDocument(document.Id);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (227)
Classification\SemanticClassifierTests.cs (2)
35
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
3526
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)
228
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)
396
var document = workspace.
CurrentSolution
.GetRequiredDocument(hostDocument.Id);
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
660
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
1276
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)
59
var newSolution = workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference])
63
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
90
ideEngineWorkspace.TryApplyChanges(ideEngineWorkspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
92
var ideEngineDocument = ideEngineWorkspace.
CurrentSolution
.Projects.Single().Documents.Single();
105
var compilerEngineCompilation = (CSharpCompilation)compilerEngineWorkspace.
CurrentSolution
.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None).Result;
126
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
128
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
164
var additionalDocId = DocumentId.CreateNewId(workspace.
CurrentSolution
.Projects.Single().Id);
170
workspace.TryApplyChanges(workspace.
CurrentSolution
174
var sourceDocument = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
202
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
204
var ideEngineDocument = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
258
ideEngineWorkspace.TryApplyChanges(ideEngineWorkspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
260
var ideEngineDocument = ideEngineWorkspace.
CurrentSolution
.Projects.Single().Documents.Single();
279
var compilerEngineCompilation = (CSharpCompilation)compilerEngineWorkspace.
CurrentSolution
.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None).Result;
338
var compilerEngineCompilation = (CSharpCompilation)(await compilerEngineWorkspace.
CurrentSolution
.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None));
757
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences(
762
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
,
543
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)
197
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
201
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 (1)
63
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)
66
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)
371
var currentDocument = workspace.
CurrentSolution
.GetDocument(workspaceFixture.Target.CurrentDocument.Id);
690
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspaceFixture.Target.CurrentDocument.Id);
963
var solution = testWorkspace.
CurrentSolution
;
1020
var solution = testWorkspace.
CurrentSolution
;
1049
var solution = testWorkspace.
CurrentSolution
;
1266
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
1311
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)
352
var document = testWorkspace.
CurrentSolution
.GetDocument(documentId);
355
document = testWorkspace.
CurrentSolution
.GetDocument(documentId);
472
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)
93
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)
50
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
57
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
278
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
341
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
365
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
748
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
1053
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);
89
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
108
var project = workspace.
CurrentSolution
.Projects.Single();
167
var project = workspace.
CurrentSolution
.Projects.Single()
206
var project = workspace.
CurrentSolution
.Projects.Single()
246
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(), documentId: null, diagnosticIds: null, shouldIncludeAnalyzer: null,
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();
633
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
634
var project = workspace.
CurrentSolution
.Projects.Single();
667
workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference])
670
var project = workspace.
CurrentSolution
.Projects.Single();
703
workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerHostReference])
706
var project = workspace.
CurrentSolution
.Projects.Single();
738
workspace.
CurrentSolution
.WithAnalyzerReferences(AddExtraReferenceIfNeeded(analyzerHostReference, includeExtraHostReference))
741
var project = workspace.
CurrentSolution
.Projects.Single();
792
workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerHostReference])
795
var project = workspace.
CurrentSolution
.Projects.Single();
830
var project = workspace.
CurrentSolution
.Projects.Single();
841
project = workspace.
CurrentSolution
.Projects.Single();
907
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
909
var project = workspace.
CurrentSolution
.Projects.Single();
950
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(new TestGeneratorReference(generator)).Solution));
952
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
;
376
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)
141
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);
55
var expectedDefinition = expectedSymbol.ToNonClassifiedDefinitionItem(workspace.
CurrentSolution
, includeHiddenLocations: true);
818
var definition = await service.TryFindDefinitionAsync(workspace.
CurrentSolution
, parsedFrame, StackFrameSymbolPart.Method, CancellationToken.None);
848
var definition = await service.TryFindDefinitionAsync(workspace.
CurrentSolution
, frame, StackFrameSymbolPart.Method, CancellationToken.None);
886
var (document, line) = service.GetDocumentAndLine(workspace.
CurrentSolution
, frame);
925
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.EditorFeatures2.UnitTests (2)
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (1)
148
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences(analyzeReferences))
Simplification\ParameterSimplificationTests.vb (1)
18
Dim solution = workspace.
CurrentSolution
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.OmniSharp (1)
Options\OmniSharpSolutionAnalyzerConfigOptionsUpdater.cs (1)
23
var oldSolution = workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (2)
Testing\TestRoslynOptionsHelper.cs (1)
14
var globalOptions = workspace.
CurrentSolution
.Services.ExportProvider.GetService<IGlobalOptionService>();
WorkspaceExtensions.cs (1)
18
return workspace.
CurrentSolution
.GetTextDocumentAsync(identifier, cancellationToken);
Microsoft.CodeAnalysis.Features (17)
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 (5)
66
metadataWorkspace.OnSolutionFallbackAnalyzerOptionsChanged(sourceWorkspace.
CurrentSolution
.FallbackAnalyzerOptions);
104
var (temporaryProjectInfo, temporaryDocumentId) = GenerateProjectAndDocumentInfo(fileInfo, metadataWorkspace.
CurrentSolution
.Services, sourceProject, topLevelNamedType);
106
var temporaryDocument = metadataWorkspace.
CurrentSolution
211
var document = metadataWorkspace.
CurrentSolution
.GetRequiredDocument(generatedDocumentId);
288
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)
255
var navigateProject = metadataWorkspace.
CurrentSolution
.GetRequiredProject(projectId);
262
if (!metadataWorkspace.
CurrentSolution
.ContainsDocument(documentInfo.Id))
269
navigateProject = metadataWorkspace.
CurrentSolution
.GetRequiredProject(projectId);
393
var solution = info.SourceWorkspace.
CurrentSolution
;
Microsoft.CodeAnalysis.Features.Test.Utilities (6)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
465
var oldSolution = workspace.
CurrentSolution
;
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
76
solution = workspace.
CurrentSolution
;
RelatedDocuments\AbstractRelatedDocumentsTests.cs (1)
32
var startingDocument = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
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 (44)
EditAndContinue\ActiveStatementsMapTests.cs (3)
118
var solution = workspace.
CurrentSolution
175
var solution = workspace.
CurrentSolution
228
var solution = workspace.
CurrentSolution
EditAndContinue\CompileTimeSolutionProviderTests.cs (4)
41
var designTimeSolution = workspace.
CurrentSolution
.
120
_ = await workspace.
CurrentSolution
.GetRequiredProject(projectId).GetCompilationAsync();
123
var compileTimeSolution1 = provider.GetCompileTimeSolution(workspace.
CurrentSolution
);
138
var compileTimeSolution2 = provider.GetCompileTimeSolution(workspace.
CurrentSolution
);
EditAndContinue\EditSessionActiveStatementsTests.cs (1)
70
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
;
144
localWorkspace.
CurrentSolution
,
226
var results = await sessionProxy.EmitSolutionUpdateAsync(localWorkspace.
CurrentSolution
, runningProjects1, activeStatementSpanProvider, CancellationToken.None);
274
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 (11)
FileBasedPrograms\FileBasedProgramsProjectSystem.cs (2)
102
return workspace.
CurrentSolution
.GetRequiredAdditionalDocument(docId);
106
return workspace.
CurrentSolution
.GetRequiredDocument(id);
HostWorkspace\LanguageServerProjectSystem.cs (1)
53
_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)
53
_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))
348
var workspaceCurrentSolution = workspace.
CurrentSolution
;
386
workspaceCurrentSolution = workspace.
CurrentSolution
;
596
foreach (var document in workspace.
CurrentSolution
.Projects.SelectMany(documentSelector))
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (79)
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)
1099
var solution = testLspServer.TestWorkspace.
CurrentSolution
;
1248
var document = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single().Documents.Single();
1287
var project = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single();
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 (1)
377
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
RelatedDocuments\RelatedDocumentsTests.cs (5)
64
var project = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single();
91
var project = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single();
126
var project = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single();
154
var project = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single();
202
var project = testLspServer.TestWorkspace.
CurrentSolution
.Projects.Single();
Rename\RenameTests.cs (3)
267
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
316
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
359
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(new TestGeneratorReference(razorGenerator));
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)
122
var document = workspace.
CurrentSolution
.GetDocument(documentId);
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (6)
CaseCorrection\VisualBasicCaseCorrectionTestBase.vb (1)
16
Dim project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
Formatting\FormattingTests.vb (2)
3014
Dim project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
4196
Dim solution = New AdhocWorkspace().
CurrentSolution
Formatting\VisualBasicFormattingTestBase.vb (1)
56
Dim project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
OrganizeImports\OrganizeImportsTests.vb (2)
25
Dim project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
46
Dim project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
Microsoft.CodeAnalysis.Workspaces (75)
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);
391
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 (41)
163
/// Sets the <see cref="
CurrentSolution
"/> of this workspace. This method does not raise a WorkspaceChange event.
173
/// Sets the <see cref="
CurrentSolution
"/> of this workspace. This method does not raise a
188
var oldSolution = this.
CurrentSolution
;
218
/// Applies specified transformation to <see cref="
CurrentSolution
"/>, updates <see cref="
CurrentSolution
"/> to
228
/// <returns>True if <see cref="
CurrentSolution
"/> was set to the transformed solution, false if the
406
/// Ensures that whenever a new language is added to <see cref="
CurrentSolution
"/> we
408
/// Conversely, if a language is no longer present in <see cref="
CurrentSolution
"/>
413
/// <see cref="
CurrentSolution
"/> as appropriate.
417
/// of any <see cref="Solution"/> snapshot stored in <see cref="
CurrentSolution
"/>.
455
/// Applies specified transformation to <see cref="
CurrentSolution
"/>, updates <see cref="
CurrentSolution
"/> to
466
/// <param name="onBeforeUpdate">Action to perform immediately prior to updating <see cref="
CurrentSolution
"/>.
467
/// The action will be passed the old <see cref="
CurrentSolution
"/> that will be replaced and the exact solution
471
/// <param name="onAfterUpdate">Action to perform once <see cref="
CurrentSolution
"/> has been updated. The
472
/// action will be passed the old <see cref="
CurrentSolution
"/> that was just replaced and the exact solution it
562
/// Setter also force updates the <see cref="
CurrentSolution
"/> to have the updated <see cref="Solution.Options"/>.
568
return this.
CurrentSolution
.Options;
1567
var oldSolution = this.
CurrentSolution
;
1625
if (
CurrentSolution
.FallbackAnalyzerOptions != newSolution.FallbackAnalyzerOptions)
1630
if (!
CurrentSolution
.AnalyzerReferences.SequenceEqual(newSolution.AnalyzerReferences))
2114
var oldProject =
CurrentSolution
.GetRequiredProject(projectId);
2132
var oldProject =
CurrentSolution
.GetRequiredProject(projectId);
2346
=> CheckSolutionIsEmpty(this.
CurrentSolution
);
2360
=> CheckProjectIsInSolution(this.
CurrentSolution
, projectId);
2376
=> CheckProjectIsNotInSolution(this.
CurrentSolution
, projectId);
2393
if (!this.
CurrentSolution
.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference))
2406
if (this.
CurrentSolution
.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference))
2419
var transitiveReferences = this.
CurrentSolution
.GetProjectDependencyGraph().GetProjectsThatThisProjectTransitivelyDependsOn(toProjectId);
2433
if (!this.
CurrentSolution
.GetProject(projectId)!.MetadataReferences.Contains(metadataReference))
2444
if (this.
CurrentSolution
.GetProject(projectId)!.MetadataReferences.Contains(metadataReference))
2455
if (!this.
CurrentSolution
.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference))
2466
if (this.
CurrentSolution
.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference))
2498
=> CheckDocumentIsInSolution(this.
CurrentSolution
, documentId);
2514
=> CheckAdditionalDocumentIsInSolution(this.
CurrentSolution
, documentId);
2530
=> CheckAnalyzerConfigDocumentIsInSolution(this.
CurrentSolution
, documentId);
2547
if (this.
CurrentSolution
.ContainsDocument(documentId))
2559
=> CheckAdditionalDocumentIsNotInSolution(this.
CurrentSolution
, documentId);
2575
=> CheckAnalyzerConfigDocumentIsNotInSolution(this.
CurrentSolution
, documentId);
2592
var project = this.
CurrentSolution
.GetProject(projectId);
2602
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)
213
return this.
CurrentSolution
;
252
var projectMap = ProjectMap.Create(this.
CurrentSolution
);
263
var projectResult = this.
CurrentSolution
.GetProject(projects[0].Id);
389
var document = this.
CurrentSolution
.GetDocument(documentId);
407
var document = this.
CurrentSolution
.GetAdditionalDocument(documentId);
455
var project = this.
CurrentSolution
.GetRequiredProject(info.Id.ProjectId);
515
var document = this.
CurrentSolution
.GetDocument(documentId);
599
var relativePath = PathUtilities.GetRelativePath(Path.GetDirectoryName(
CurrentSolution
.GetRequiredProject(projectId).FilePath)!, peRef.FilePath);
629
var project = this.
CurrentSolution
.GetProject(projectId);
654
var project = this.
CurrentSolution
.GetProject(projectReference.ProjectId);
669
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)
89
Assert.Single(workspace.
CurrentSolution
.ProjectIds);
135
Assert.Single(workspace.
CurrentSolution
.ProjectIds);
146
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
153
Assert.Equal(libraryProject.FilePath, workspace.
CurrentSolution
.GetProject(projectRefId).FilePath);
175
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
186
Assert.Equal(3, workspace.
CurrentSolution
.ProjectIds.Count);
218
Assert.Equal(3, workspace.
CurrentSolution
.ProjectIds.Count);
223
foreach (var project in workspace.
CurrentSolution
.Projects)
236
foreach (var project in workspace.
CurrentSolution
.Projects)
260
Assert.Equal(3, workspace.
CurrentSolution
.ProjectIds.Count);
264
foreach (var project in workspace.
CurrentSolution
.Projects)
308
Assert.Equal(4, workspace.
CurrentSolution
.ProjectIds.Count);
313
foreach (var project in workspace.
CurrentSolution
.Projects)
335
foreach (var project in workspace.
CurrentSolution
.Projects)
371
var projects = workspace.
CurrentSolution
.Projects.Where(p => p.FilePath.EndsWith("Project.csproj"));
376
var referencedProject = workspace.
CurrentSolution
.GetProject(projectReference.ProjectId);
465
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
467
Assert.Contains(workspace.
CurrentSolution
.Projects, p => p.Name == "Library(net6)");
468
Assert.Contains(workspace.
CurrentSolution
.Projects, p => p.Name == "Library(net5)");
519
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
VisualStudioMSBuildWorkspaceTests.cs (28)
1433
vbProject = workspace.
CurrentSolution
.GetProject(vbProject.Id);
2003
var solution2 = workspace.
CurrentSolution
;
2023
var projectB = workspaceB.
CurrentSolution
.GetProjectsByName("CSharpProject").FirstOrDefault();
2046
var solution2 = workspace.
CurrentSolution
;
2079
var solution2 = workspace.
CurrentSolution
;
2108
var solution2 = workspace.
CurrentSolution
;
2135
var solution2 = workspace.
CurrentSolution
;
2161
var solution2 = workspace.
CurrentSolution
;
2191
workspace.TryApplyChanges(workspace.
CurrentSolution
.AddAdditionalDocument(DocumentId.CreateNewId(csProjectId), "foo.xaml", SourceText.From("<foo></foo>")));
2194
var xaml = workspace.
CurrentSolution
.GetProject(csProjectId).AdditionalDocuments.FirstOrDefault(d => d.Name == "XamlFile.xaml");
2201
workspace.TryApplyChanges(workspace.
CurrentSolution
.RemoveAdditionalDocument(xaml.Id));
2214
var originalSolution = workspace.
CurrentSolution
;
2223
var doc = workspace.
CurrentSolution
.Projects.First().Documents.First();
2227
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(doc.Id, SourceText.From(newText), PreservationMode.PreserveIdentity));
2244
var originalSolution = workspace.
CurrentSolution
;
2253
var doc = workspace.
CurrentSolution
.Projects.First().Documents.First();
2259
.
CurrentSolution
2289
Assert.Equal(2, workspace.
CurrentSolution
.Projects.Count());
2319
Assert.Equal(2, workspace.
CurrentSolution
.Projects.Count());
2572
var csproject = workspace.
CurrentSolution
.Projects.First(p => p.Language == LanguageNames.CSharp);
2580
var vbproject = workspace.
CurrentSolution
.Projects.First(p => p.Language == LanguageNames.VisualBasic);
2934
workspace.TryApplyChanges(workspace.
CurrentSolution
.GetProject(project.Id).RemoveAnalyzerReference(aref).Solution);
2955
workspace.TryApplyChanges(workspace.
CurrentSolution
.GetProject(project.Id).RemoveProjectReference(pref).Solution);
2956
Assert.Empty(workspace.
CurrentSolution
.GetProject(project.Id).ProjectReferences);
2962
workspace.TryApplyChanges(workspace.
CurrentSolution
.GetProject(project.Id).AddProjectReference(pref).Solution);
2963
Assert.Single(workspace.
CurrentSolution
.GetProject(project.Id).ProjectReferences);
3279
Assert.Equal(0, workspace.
CurrentSolution
.ProjectIds.Count);
3307
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)
518
var document = await
CurrentSolution
.GetSourceGeneratedDocumentAsync(documentId, CancellationToken.None);
525
return ChangeDocumentAsync(documentId, this.
CurrentSolution
.WithDocumentText(documentId, text));
539
var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.
CurrentSolution
.AddDocument(documentInfo));
546
var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.
CurrentSolution
.WithAdditionalDocumentText(documentId, text));
553
var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.
CurrentSolution
.WithAnalyzerConfigDocumentText(documentId, text));
782
SerializerService.TestAccessor.AddAnalyzerImageReferences(this.
CurrentSolution
.AnalyzerReferences);
Microsoft.CodeAnalysis.Workspaces.UnitTests (349)
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 (185)
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
;
329
var solution = workspace.
CurrentSolution
345
var solution = workspace.
CurrentSolution
;
370
var solution = workspace.
CurrentSolution
;
394
var solution = workspace.
CurrentSolution
;
427
var solution = workspace.
CurrentSolution
;
474
solution = workspace.
CurrentSolution
;
515
var solution = workspace.
CurrentSolution
;
562
solution = workspace.
CurrentSolution
;
594
var solution = workspace.
CurrentSolution
;
648
solution = workspace.
CurrentSolution
;
680
var solution = workspace.
CurrentSolution
;
728
solution = workspace.
CurrentSolution
;
757
var solution = workspace.
CurrentSolution
;
804
solution = workspace.
CurrentSolution
;
839
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
845
var solution = workspace.
CurrentSolution
;
893
solution = workspace.
CurrentSolution
;
916
var solution = workspace.
CurrentSolution
;
938
var solution = workspace.
CurrentSolution
;
962
var solution = workspace.
CurrentSolution
;
984
var solution = workspace.
CurrentSolution
;
1008
var solution = workspace.
CurrentSolution
;
1030
var solution = workspace.
CurrentSolution
;
1052
var solution = workspace.
CurrentSolution
;
1088
var solution = workspace.
CurrentSolution
1297
var solution = workspace.
CurrentSolution
1332
var solution = workspace.
CurrentSolution
1367
var solution = workspace.
CurrentSolution
1402
var solution = workspace.
CurrentSolution
1436
var solution = workspace.
CurrentSolution
1458
var solution = workspace.
CurrentSolution
1486
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp);
1513
var solution = workspace.
CurrentSolution
1536
var solution = workspace.
CurrentSolution
1559
var solution = workspace.
CurrentSolution
.
1582
var solution = workspace.
CurrentSolution
.
1619
var solution = workspace.
CurrentSolution
1673
var solution = workspace.
CurrentSolution
1695
var solution = workspace.
CurrentSolution
1718
var solution = workspace.
CurrentSolution
1735
var solution = workspace.
CurrentSolution
1760
var solution = workspace.
CurrentSolution
1784
var document = workspace.
CurrentSolution
1822
var document = workspace.
CurrentSolution
1860
var document = workspace.
CurrentSolution
1879
var document = workspace.
CurrentSolution
1898
var document = workspace.
CurrentSolution
1914
var solution = workspace.
CurrentSolution
;
1947
var solution = workspace.
CurrentSolution
;
1963
var solution = workspace.
CurrentSolution
;
2005
var solution = workspace.
CurrentSolution
;
2040
var solution = workspace.
CurrentSolution
;
2076
var solution = workspace.
CurrentSolution
;
2094
var solution = workspace.
CurrentSolution
;
2119
var solution = workspace.
CurrentSolution
;
2146
var solution = workspace.
CurrentSolution
;
2164
var solution = workspace.
CurrentSolution
;
2192
var solution = workspace.
CurrentSolution
;
2219
var solution = workspace.
CurrentSolution
;
2233
var solution = workspace.
CurrentSolution
;
2259
var solution = workspace.
CurrentSolution
;
2286
var solution = workspace.
CurrentSolution
;
2305
TestOptionValues(workspace.
CurrentSolution
, expectedA: "A", hasBWithoutFallback: false, expectedB: "fallbackY", expectedBFile: "fallbackY");
2362
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2388
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2418
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2445
var origSolution = workspace.
CurrentSolution
;
2470
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2499
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2533
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2556
var solution = workspace.
CurrentSolution
;
2569
var solution = workspace.
CurrentSolution
;
2581
var solution = workspace.
CurrentSolution
;
2596
var solution = workspace.
CurrentSolution
2642
var solution = workspace.
CurrentSolution
2666
var solution = workspace.
CurrentSolution
2694
var solution = workspace.
CurrentSolution
2704
var solution = workspace.
CurrentSolution
;
2718
var solution = workspace.
CurrentSolution
2739
var solution = workspace.
CurrentSolution
2760
var solution = workspace.
CurrentSolution
2779
var solution = workspace.
CurrentSolution
2798
var solution = workspace.
CurrentSolution
2813
var solution = workspace.
CurrentSolution
2832
var solution = workspace.
CurrentSolution
2849
var solution = workspace.
CurrentSolution
2951
var solution = workspace.
CurrentSolution
;
2972
var solution = workspace.
CurrentSolution
;
3010
var solution = workspace.
CurrentSolution
;
3068
var solution = workspace.
CurrentSolution
;
3086
var sol = workspace.
CurrentSolution
;
3105
var sol = workspace.
CurrentSolution
;
3131
var sol = workspace.
CurrentSolution
;
3167
var sol = workspace.
CurrentSolution
3188
var solution1 = workspace.
CurrentSolution
3211
var sol = workspace.
CurrentSolution
3252
var sol = workspace.
CurrentSolution
3293
var solution = workspace.
CurrentSolution
3324
var sol = workspace.
CurrentSolution
;
3355
var sol = workspace.
CurrentSolution
3377
var sol = workspace.
CurrentSolution
3398
var sol = workspace.
CurrentSolution
3422
var sol = workspace.
CurrentSolution
3444
var sol = workspace.
CurrentSolution
3465
var sol = workspace.
CurrentSolution
3485
var sol = workspace.
CurrentSolution
3505
var sol = workspace.
CurrentSolution
3525
var sol = workspace.
CurrentSolution
3544
var sol = workspace.
CurrentSolution
3575
var sol = workspace.
CurrentSolution
3607
var sol = workspace.
CurrentSolution
3633
var sol = workspace.
CurrentSolution
3669
var sol = workspace.
CurrentSolution
3701
var sol = workspace.
CurrentSolution
3752
var sol = workspace.
CurrentSolution
3777
var sol = workspace.
CurrentSolution
3804
var sol = workspace.
CurrentSolution
3938
var solution = workspace.
CurrentSolution
;
3992
var solution = new AdhocWorkspace().
CurrentSolution
4118
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4143
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4171
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4216
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4298
var project = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4316
var project = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4332
var originalProject = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4356
var originalProject = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4384
var document = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4400
var solution = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp).Solution;
4456
var currentSolution = workspace.
CurrentSolution
;
4596
var solution = workspace.
CurrentSolution
;
4612
var solution = workspace.
CurrentSolution
;
4673
var solution = workspace.
CurrentSolution
;
4700
var solution = workspace.
CurrentSolution
;
4736
var solution = workspace.
CurrentSolution
;
4777
var solution = workspace.
CurrentSolution
;
4823
var solution = workspace.
CurrentSolution
;
4854
var solution = workspace.
CurrentSolution
;
4905
var solution = workspace.
CurrentSolution
;
4929
var solution = workspace.
CurrentSolution
4946
var solution = workspace.
CurrentSolution
;
4964
var solution = workspace.
CurrentSolution
;
4987
var solution = workspace.
CurrentSolution
;
5009
var solution = workspace.
CurrentSolution
;
5037
var solution = workspace.
CurrentSolution
;
5065
var solution = workspace.
CurrentSolution
;
5094
var solution = workspace.
CurrentSolution
;
5125
var solution = workspace.
CurrentSolution
;
5163
var solution = workspace.
CurrentSolution
;
5180
var solution = workspace.
CurrentSolution
;
5226
var solution = workspace.
CurrentSolution
;
5270
var solution = workspace.
CurrentSolution
;
5294
var solution = workspace.
CurrentSolution
;
5432
var s0 = workspace.
CurrentSolution
;
5478
var solution = workspace.
CurrentSolution
.AddProject(projInfo);
5507
var solution = workspace.
CurrentSolution
;
5561
var solution = workspace.
CurrentSolution
5589
var solution = workspace.
CurrentSolution
5609
var solution = workspace.
CurrentSolution
5623
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
5640
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
5660
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5688
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5718
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5751
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5776
var project1 = workspace.
CurrentSolution
5828
var project = workspace.
CurrentSolution
.AddProject("TypeScript", "TypeScript", "TypeScript");
5849
var project1 = workspace.
CurrentSolution
5882
var document1 = workspace.
CurrentSolution
.GetRequiredDocument(documentId1);
5888
var document2 = workspace.
CurrentSolution
.GetRequiredDocument(documentId2);
SolutionTests\SolutionWithSourceGeneratorTests.cs (50)
47
var project = AddEmptyProject(workspace.
CurrentSolution
)
88
var project = AddEmptyProject(workspace.
CurrentSolution
)
136
var project = AddEmptyProject(workspace.
CurrentSolution
)
163
var project = AddEmptyProject(workspace.
CurrentSolution
)
180
var project = AddEmptyProject(workspace.
CurrentSolution
)
252
var project = AddEmptyProject(workspace.
CurrentSolution
)
292
var project = AddEmptyProject(workspace.
CurrentSolution
)
336
var project = AddEmptyProject(workspace.
CurrentSolution
)
364
var projectBeforeChange = AddEmptyProject(workspace.
CurrentSolution
)
387
var solutionWithProjects = AddProjectWithReference(workspace.
CurrentSolution
, analyzerReference);
417
var solution = AddEmptyProject(workspace.
CurrentSolution
)
442
var project = AddEmptyProject(workspace.
CurrentSolution
)
456
var project = AddEmptyProject(workspace.
CurrentSolution
)
479
var project = AddEmptyProject(workspace.
CurrentSolution
)
499
var project = AddEmptyProject(workspace.
CurrentSolution
)
526
var project = AddEmptyProject(workspace.
CurrentSolution
)
574
var project = AddEmptyProject(workspace.
CurrentSolution
);
587
var project = AddEmptyProject(workspace.
CurrentSolution
)
599
Assert.NotSame(workspace.
CurrentSolution
, generatedDocument.Project.Solution);
611
var project = AddEmptyProject(workspace.
CurrentSolution
)
616
var generatedDocument = Assert.Single(await workspace.
CurrentSolution
.Projects.Single().GetSourceGeneratedDocumentsAsync());
622
Assert.Same(workspace.
CurrentSolution
, generatedDocument!.Project.Solution);
630
var originalAdditionalFile = AddEmptyProject(workspace.
CurrentSolution
)
643
Assert.Empty(await workspace.
CurrentSolution
.Projects.Single().GetSourceGeneratedDocumentsAsync());
658
var solution = AddEmptyProject(workspace.
CurrentSolution
)
667
var generatedDocument = Assert.Single(await workspace.
CurrentSolution
.GetRequiredProject(projectIdWithGenerator).GetSourceGeneratedDocumentsAsync());
689
var project = AddEmptyProject(workspace.
CurrentSolution
)
701
var document = await workspace.
CurrentSolution
.GetSourceGeneratedDocumentAsync(generatedDocument.Identity.DocumentId, CancellationToken.None);
717
var project = AddEmptyProject(workspace.
CurrentSolution
)
723
var documentToFreeze = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
748
var project = AddEmptyProject(workspace.
CurrentSolution
)
777
var project = AddEmptyProject(workspace.
CurrentSolution
)
807
var originalDocument1 = AddEmptyProject(workspace.
CurrentSolution
, name: "Project1")
845
var project = AddEmptyProject(workspace.
CurrentSolution
);
869
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
902
var solution = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference).Solution;
927
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
947
var project0 = AddEmptyProject(workspace.
CurrentSolution
);
983
var project = AddEmptyProject(workspace.
CurrentSolution
)
1015
var project = AddEmptyProject(workspace.
CurrentSolution
)
1045
var project = AddEmptyProject(workspace.
CurrentSolution
)
1085
var project = AddEmptyProject(workspace.
CurrentSolution
)
1113
var project = AddEmptyProject(workspace.
CurrentSolution
)
1140
var project = AddEmptyProject(workspace.
CurrentSolution
)
1168
var project = AddEmptyProject(workspace.
CurrentSolution
)
1201
var project = AddEmptyProject(workspace.
CurrentSolution
)
1256
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
1291
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
1328
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
1359
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
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
;
171
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)
64
if (!workspace.
CurrentSolution
.Projects.Any(p => p.Language is LanguageNames.CSharp or LanguageNames.VisualBasic))
71
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)
198
var solution = _languageService.Workspace.
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)
98
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)
335
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)
645
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.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.Test.Utilities2 (10)
CallHierarchy\CallHierarchyTestState.vb (1)
126
Dim documents = Workspace.
CurrentSolution
.Projects.SelectMany(Function(p) p.Documents).Where(Function(d) documentNames.Contains(d.Name))
CodeModel\CodeModelTestHelpers.vb (2)
62
Dim project = workspace.
CurrentSolution
.Projects.Single()
139
Dim document = state.Workspace.
CurrentSolution
.GetDocument(cursorDocument.Id)
CodeModel\CodeModelTestState.vb (1)
91
Dim projectId = Workspace.
CurrentSolution
.ProjectIds.Single()
CodeModel\Mocks\MockVisualStudioWorkspace.vb (6)
35
SetCurrentSolutionEx(testWorkspace.
CurrentSolution
)
46
Assert.True(_workspace.TryApplyChanges(_workspace.
CurrentSolution
.WithDocumentText(documentId, newText)))
47
SetCurrentSolutionEx(_workspace.
CurrentSolution
)
52
SetCurrentSolutionEx(_workspace.
CurrentSolution
)
56
Assert.True(_workspace.TryApplyChanges(_workspace.
CurrentSolution
.RemoveDocument(documentId)))
57
SetCurrentSolutionEx(_workspace.
CurrentSolution
)
Microsoft.VisualStudio.LanguageServices.UnitTests (130)
ChangeSignature\AddParameterViewModelTests.vb (1)
301
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
460
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
CodeModel\AbstractEventCollectorTests.vb (3)
101
Dim project = workspace.
CurrentSolution
.Projects.First()
105
Dim codeDocument = workspace.
CurrentSolution
.GetDocument(workspace.Documents(0).Id)
108
Dim changeDocument = workspace.
CurrentSolution
.GetDocument(workspace.Documents(1).Id)
CodeModel\CSharp\FileCodeModelTests.vb (1)
1020
Dim changeDocument = changedWorkspace.
CurrentSolution
.GetDocument(changedWorkspace.Documents(0).Id)
CodeModel\CSharp\SyntaxNodeKeyTests.vb (2)
229
Dim project = workspace.
CurrentSolution
.Projects.First()
236
Dim document = workspace.
CurrentSolution
.GetDocument(cursorDocument.Id)
CodeModel\VisualBasic\FileCodeModelTests.vb (2)
1018
Dim changeDocument = changedworkspace.
CurrentSolution
.GetDocument(changedworkspace.Documents.First(Function(d) d.Name.Equals("File1.vb")).Id)
1034
changeDocument = changedworkspace.
CurrentSolution
.GetDocument(changedworkspace.Documents.First(Function(d) d.Name.Equals("File2.vb")).Id)
CommonControls\MemberSelectionViewModelTests.vb (1)
175
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
229
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
DebuggerIntelliSense\TestState.vb (1)
37
Dim language = Workspace.
CurrentSolution
.Projects.First().Language
Debugging\VisualBasicBreakpointResolutionServiceTests.vb (1)
25
Dim document = workspace.
CurrentSolution
.Projects.First.Documents.First
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (9)
46
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences({analyzerReference}))
54
Dim project = workspace.
CurrentSolution
.Projects.First()
73
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences({analyzerReference}))
81
Dim project = workspace.
CurrentSolution
.Projects.First()
97
Dim project = workspace.
CurrentSolution
.Projects.First()
134
Dim project = workspace.
CurrentSolution
.Projects.First()
175
Dim project = workspace.
CurrentSolution
.Projects.First()
210
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences({analyzerReference}))
215
Dim project = workspace.
CurrentSolution
.Projects.First()
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
290
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
GenerateType\GenerateTypeViewModelTests.vb (1)
840
Dim document = workspace.
CurrentSolution
.GetDocument(testDoc.Id)
GoToDefinition\GoToDefinitionApiTests.vb (1)
22
Dim solution = workspace.
CurrentSolution
Help\HelpTests.vb (1)
18
Assert.Equal(expected, Await service.GetHelpTermAsync(workspace.
CurrentSolution
.Projects.First().Documents.First(), workspace.Documents.First().SelectedSpans.First(), CancellationToken.None))
InheritanceMargin\InheritanceMarginViewModelTests.vb (1)
78
Dim document = workspace.
CurrentSolution
.GetDocument(testDocument.Id)
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (1)
27
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
Preview\PreviewChangesTests.vb (11)
38
Dim document = workspace.
CurrentSolution
.GetDocument(documentId)
49
workspace.
CurrentSolution
,
91
Dim document = workspace.
CurrentSolution
.GetDocument(docId)
109
workspace.
CurrentSolution
,
133
Dim document = workspace.
CurrentSolution
.GetDocument(documentId)
144
workspace.
CurrentSolution
,
186
Dim document = workspace.
CurrentSolution
.GetDocument(docId)
209
workspace.
CurrentSolution
,
269
Dim document1 = workspace.
CurrentSolution
.GetDocument(documentId1)
272
Dim document2 = workspace.
CurrentSolution
.GetDocument(documentId2)
289
workspace.
CurrentSolution
,
ProjectSystemShim\VisualBasicCodeModelLifetimeTests.vb (2)
28
Dim originalDocumentId = environment.Workspace.
CurrentSolution
.Projects.Single().DocumentIds.Single()
38
Dim newDocumentId = environment.Workspace.
CurrentSolution
.Projects.Single().DocumentIds.Single()
ProjectSystemShim\VisualBasicCompilerOptionsTests.vb (10)
23
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
42
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
61
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
84
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
107
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
127
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
147
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
166
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
186
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
194
workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
ProjectSystemShim\VisualBasicProjectTests.vb (3)
20
Assert.Equal(environment.Workspace.
CurrentSolution
.Projects.Single().Name, "Test")
24
Assert.Equal(environment.Workspace.
CurrentSolution
.Projects.Single().Name, "Test2")
35
Assert.Single(environment.Workspace.
CurrentSolution
.Projects)
ProjectSystemShim\VisualBasicSpecialReferencesTests.vb (10)
22
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
41
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
60
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
77
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
84
workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
92
workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
107
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
122
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
128
workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
134
workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
ProjectSystemShim\VisualStudioProjectTests\AnalyzerReferenceTests.vb (10)
37
Assert.Single(environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences)
52
Dim analyzers = environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Single().GetAnalyzers(LanguageNames.CSharp)
72
Dim analyzers = environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Single().GetAnalyzers(LanguageNames.CSharp)
91
Dim analyzers = environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Single().GetAnalyzers(LanguageNames.CSharp)
123
AssertEx.Equal({path1, path2}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
146
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences)
155
}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
187
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences)
196
}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
225
}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
ProjectSystemShim\VisualStudioProjectTests\DynamicFileTests.vb (4)
39
Dim dynamicSourceFile = environment.Workspace.
CurrentSolution
.Projects.Single().Documents.Single()
47
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().Documents)
89
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().Documents)
93
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().Documents)
ProjectSystemShim\VisualStudioProjectTests\MetadataToProjectReferenceConversionTests.vb (10)
30
Dim getProject2 = Function() environment.Workspace.
CurrentSolution
.GetProject(project2.Id)
67
Dim getProject2 = Function() environment.Workspace.
CurrentSolution
.GetProject(project2.Id)
102
Dim getReferencingProject = Function() environment.Workspace.
CurrentSolution
.GetProject(referencingProject.Id)
138
Dim getReferencingProject = Function() environment.Workspace.
CurrentSolution
.GetProject(referencingProject.Id)
175
Dim getReferencingProject = Function() environment.Workspace.
CurrentSolution
.GetProject(referencingProject.Id)
203
Dim getReferencingProject = Function() environment.Workspace.
CurrentSolution
.GetProject(referencingProject.Id)
249
Dim getReferencingProject = Function() environment.Workspace.
CurrentSolution
.GetProject(referencingProject.Id)
264
Dim getReferencingProject = Function() environment.Workspace.
CurrentSolution
.GetProject(referencingProject.Id)
300
Dim getReferencingProject = Function() environment.Workspace.
CurrentSolution
.GetProject(referencingProject.Id)
369
Assert.Single(environment.Workspace.
CurrentSolution
.Projects.Single().MetadataReferences)
ProjectSystemShim\VisualStudioProjectTests\ProjectSystemProjectFactoryTests.vb (2)
23
Dim projectInSolution = environment.Workspace.
CurrentSolution
.GetProject(project1.Id)
31
Dim newProjectInSolution As Project = environment.Workspace.
CurrentSolution
.GetProject(project1.Id)
ProjectSystemShim\VisualStudioProjectTests\SolutionIdTests.vb (4)
19
Dim solutionId = environment.Workspace.
CurrentSolution
.Id
27
Assert.NotEqual(solutionId, environment.Workspace.
CurrentSolution
.Id)
36
Dim solutionId = environment.Workspace.
CurrentSolution
.Id
40
Assert.Equal(solutionId, environment.Workspace.
CurrentSolution
.Id)
ProjectSystemShim\VisualStudioProjectTests\WorkspaceChangedEventTests.vb (4)
31
Assert.Equal(environment.Workspace.
CurrentSolution
.Projects.Single().DocumentIds.Single(), change.DocumentId)
71
Assert.Equal(environment.Workspace.
CurrentSolution
.Projects.Single().AdditionalDocumentIds.Single(), change.DocumentId)
101
Dim startingSolution = environment.Workspace.
CurrentSolution
106
Assert.Same(startingSolution, environment.Workspace.
CurrentSolution
)
PullMemberUp\PullMemberUpViewModelTest.vb (1)
248
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
RQName\RQNameTests.vb (1)
244
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
Snippets\CSharpSnippetExpansionClientTests.vb (1)
381
Dim document = workspace.
CurrentSolution
.Projects.Single().Documents.Single()
Snippets\VisualBasicSnippetExpansionClientTests.vb (1)
402
Dim document = workspace.
CurrentSolution
.Projects.Single().Documents.Single()
SolutionExplorer\SourceGeneratorItemTests.vb (4)
89
Dim sourceGeneratedDocument = Assert.Single(Await workspace.
CurrentSolution
.GetProject(projectId).GetSourceGeneratedDocumentsAsync())
121
Dim expectedNames = Aggregate document In workspace.
CurrentSolution
.GetProject(projectId).AdditionalDocuments
158
workspace.OnAdditionalDocumentRemoved(workspace.
CurrentSolution
.GetProject(projectId).AdditionalDocumentIds.Single())
254
workspace.OnAdditionalDocumentTextChanged(workspace.
CurrentSolution
.Projects.Single().AdditionalDocumentIds.Single(),
Venus\AbstractContainedLanguageCodeSupportTests.vb (2)
36
Dim document = workspace.
CurrentSolution
.Projects.Single().Documents.Single()
54
Return workspace.
CurrentSolution
.Projects.Single().Documents.Single()
Venus\DocumentService_IntegrationTests.vb (12)
76
Dim startDocument = workspace.
CurrentSolution
.GetDocument(cursorDocument.Id)
85
Dim definitionText = Await workspace.
CurrentSolution
.GetDocument(definitionDocument.Id).GetTextAsync()
144
Dim startDocument = workspace.
CurrentSolution
.GetDocument(originalDocument.Id)
149
Dim unmappedResults = Await codelensService.FindReferenceLocationsAsync(workspace.
CurrentSolution
, startDocument.Id, node, CancellationToken.None)
151
Dim results = Await codelensService.MapReferenceLocationsAsync(workspace.
CurrentSolution
, unmappedResults.Value, ClassificationOptions.Default, CancellationToken.None)
154
Dim definitionText = Await workspace.
CurrentSolution
.GetDocument(definitionDocument.Id).GetTextAsync()
187
Dim document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id)
205
Dim currentDocument = workspace.
CurrentSolution
.GetDocument(document.Id)
227
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences({analyzerReference}))
229
Dim document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id)
278
Dim mappedDocument = testWorkspace.
CurrentSolution
.GetDocument(mappedTestDocument.Id)
316
Dim mappedDocument = testWorkspace.
CurrentSolution
.GetDocument(mappedTestDocument.Id)
Venus\DocumentServiceTests.vb (7)
40
Dim spans = Await spanMapper.MapSpansAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), {New TextSpan(position, length:=0)}, CancellationToken.None)
64
Dim spans = Await spanMapper.MapSpansAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), {New TextSpan(position, length:=0), New TextSpan(start:=1, length:=0), New TextSpan(position + 1, length:=0)}, CancellationToken.None)
115
Dim document = Assert.IsType(Of SourceGeneratedDocument)(Await workspace.
CurrentSolution
.GetDocumentAsync(sourceGeneratedDocumentId, includeSourceGenerated:=True))
139
Dim result = Await excerptService.TryExcerptAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.SingleLine, ClassificationOptions.Default, CancellationToken.None)
178
Dim result = Await excerptService.TryExcerptAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.Tooltip, ClassificationOptions.Default, CancellationToken.None)
225
Dim result = Await excerptService.TryExcerptAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.Tooltip, ClassificationOptions.Default, CancellationToken.None)
278
Dim result = Await excerptService.TryExcerptAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.SingleLine, ClassificationOptions.Default, CancellationToken.None)
VsNavInfo\VsNavInfoTests.vb (2)
826
Dim document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id)
864
Dim document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id)
Microsoft.VisualStudio.LanguageServices.VisualBasic (3)
ProjectSystemShim\VisualBasicProject.vb (1)
198
Dim project = Workspace.
CurrentSolution
.GetProject(ProjectSystemProject.Id)
Venus\ContainedLanguageStaticEventBinding.vb (2)
74
targetDocument = visualStudioWorkspace.
CurrentSolution
.GetDocument(targetDocument.Id)
102
targetDocument = visualStudioWorkspace.
CurrentSolution
.GetDocument(targetDocument.Id)
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 (161)
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 (86)
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();
1422
var project = workspace.
CurrentSolution
.Projects.Single();
1433
Contract.ThrowIfFalse(workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(normalDocId, SourceText.From("// new text"))));
1439
project = workspace.
CurrentSolution
.Projects.Single();
1479
var remoteSolution = remoteWorkspace.
CurrentSolution
;
1515
solution = localWorkspace.
CurrentSolution
;
1518
var currentRemoteSolution = remoteWorkspace.
CurrentSolution
;
1544
var project1 = workspace.
CurrentSolution
1550
var noCompilationProject = workspace.
CurrentSolution
.AddProject("unknown", "unknown", NoCompilationConstants.LanguageName);
1553
var initialSolution = workspace.
CurrentSolution
;
1563
var finalSolution = workspace.
CurrentSolution
;
1591
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
1594
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();
196
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(analyzerReference);
220
var solution = workspace.
CurrentSolution
;
Test.Utilities (1)
CodeMetricsTestsBase.cs (1)
46
.
CurrentSolution