1479 references to CurrentSolution
AnalyzerRunner (6)
CodeRefactoringRunner.cs (1)
52
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)
47
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
60
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
InheritanceMargin\InheritanceMarginGlyphBenchmarks.cs (1)
130
var items = await BenchmarksHelpers.GenerateInheritanceMarginItemsAsync(workspace.
CurrentSolution
, cancellationToken).ConfigureAwait(false);
RegexClassifierBenchmarks.cs (1)
73
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
SQLitePersistentStorageBenchmark.cs (2)
68
var solution = _workspace.
CurrentSolution
;
72
_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)
49
var solution = new AdhocWorkspace().
CurrentSolution
IncrementalSourceGeneratorBenchmarks.cs (1)
145
var project = _workspace.
CurrentSolution
.Projects.Single(p => p.Name == "Microsoft.CodeAnalysis.Workspaces(netstandard2.0)");
NavigateToBenchmarks.cs (7)
86
var docCount = _workspace.
CurrentSolution
.Projects.SelectMany(p => p.Documents).Count();
111
foreach (var project in _workspace.
CurrentSolution
.Projects)
145
foreach (var project in _workspace.
CurrentSolution
.Projects)
164
foreach (var project in _workspace.
CurrentSolution
.Projects)
186
var storage = await storageService.GetStorageAsync(SolutionKey.ToSolutionKey(_workspace.
CurrentSolution
), CancellationToken.None);
191
var tasks = _workspace.
CurrentSolution
.Projects.SelectMany(p => p.Documents).Select(d => Task.Run(
215
var solution = _workspace.
CurrentSolution
;
ProjectOperationBenchmarks.cs (1)
58
var solution = _workspace.
CurrentSolution
;
RenameBenchmarks.cs (1)
43
_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 (217)
Classification\SemanticClassifierTests.cs (2)
37
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
3919
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
Classification\SyntacticClassifierTests.cs (3)
24
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
6133
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
6163
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
Classification\TotalClassifierTests.cs (1)
35
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
CodeActions\ApplyChangesOperationTests.cs (1)
241
var originalSolution = workspace.
CurrentSolution
;
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
919
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)
181
var document = workspace.
CurrentSolution
.GetDocument(documentId);
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
448
var document = workspace.
CurrentSolution
.GetRequiredDocument(hostDocument.Id);
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
690
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
1350
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (10)
2468
var solution = testWorkspace.
CurrentSolution
;
2721
var solution = testWorkspace.
CurrentSolution
;
2776
var solution = testWorkspace.
CurrentSolution
;
3061
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
3185
var compilation = await workspace.
CurrentSolution
.Projects.First(p => p.Name == "P3").GetCompilationAsync();
3190
var p1 = workspace.
CurrentSolution
.Projects.First(p => p.Name == "P1");
3196
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
3239
var origComp = await workspace.
CurrentSolution
.Projects.Single().GetRequiredCompilationAsync(CancellationToken.None);
3244
var project = workspace.
CurrentSolution
.Projects.Single();
3250
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (2)
376
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
387
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)
76
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
DecompiledSource\DecompiledSourceFormattingTests.cs (1)
256
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (16)
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;
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)
68
var solution = workspace.
CurrentSolution
;
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (3)
39
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
53
var solution = workspace.
CurrentSolution
;
363
var solution = workspace.
CurrentSolution
;
EncapsulateField\EncapsulateFieldTestState.cs (1)
35
TargetDocument = Workspace.
CurrentSolution
.GetDocument(_testDocument.Id);
ExtractMethod\ExtractMethodBase.cs (3)
123
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
163
var document = workspace.
CurrentSolution
.GetDocument(testDocument.Id);
188
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
ExtractMethod\ExtractMethodTests.cs (1)
11481
var solution = new AdhocWorkspace().
CurrentSolution
;
Formatting\CodeCleanupTests.cs (5)
789
var project = workspace.
CurrentSolution
.Projects.Single();
809
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
826
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
886
var solution = workspace.
CurrentSolution
.WithAnalyzerReferences(
908
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
Formatting\FormattingEngineTests.cs (1)
439
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
Formatting\Indentation\SmartIndenterEnterOnTokenTests.cs (2)
1405
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
1446
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (1)
3418
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)
598
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
MoveToNamespace\MoveToNamespaceTests.cs (1)
1446
var document = workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
NavigateTo\NavigateToSearcherTests.cs (6)
143
workspace.
CurrentSolution
,
183
workspace.
CurrentSolution
,
220
workspace.
CurrentSolution
,
257
workspace.
CurrentSolution
,
288
workspace.
CurrentSolution
,
346
workspace.
CurrentSolution
,
Organizing\AbstractOrganizerTests.cs (1)
29
var document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id);
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
169
var document = masWorkspace!.
CurrentSolution
.GetRequiredDocument(info.DocumentId);
224
var project = workspace.
CurrentSolution
.Projects.First();
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (10)
170
var implProject = workspace.
CurrentSolution
.Projects.First();
237
var implProject = workspace.
CurrentSolution
.Projects.First();
298
var implProject = workspace.
CurrentSolution
.Projects.First();
353
var implProject = workspace.
CurrentSolution
.Projects.First();
404
var implProject = workspace.
CurrentSolution
.Projects.First();
469
var implProject = workspace.
CurrentSolution
.Projects.First();
527
var implProject = workspace.
CurrentSolution
.Projects.First();
534
implProject = workspace.
CurrentSolution
.Projects.First().AddMetadataReference(MetadataReference.CreateFromFile(dllFilePath));
542
implProject = workspace.
CurrentSolution
.Projects.First();
548
implProject = workspace.
CurrentSolution
.Projects.First().AddMetadataReference(MetadataReference.CreateFromFile(realImplementationDllFilePath));
PdbSourceDocument\PdbSourceDocumentTests.cs (3)
484
var implProject = workspace.
CurrentSolution
.Projects.First();
531
var implProject = workspace.
CurrentSolution
.Projects.First();
936
var project = workspace.
CurrentSolution
.Projects.First();
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (2)
211
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
215
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
QuickInfo\SemanticQuickInfoSourceTests.cs (3)
52
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
133
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
302
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
QuickInfo\SyntacticQuickInfoSourceTests.cs (1)
604
var document = workspace.
CurrentSolution
.Projects.First().Documents.First();
Rename\CSharpInlineRenameServiceTests.cs (1)
64
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)
63
var solution = workspace.
CurrentSolution
;
75
Assert.Equal(solution, workspace.
CurrentSolution
);
85
var solution = workspace.
CurrentSolution
;
92
solution = workspace.
CurrentSolution
;
101
var solution = workspace.
CurrentSolution
;
107
solution = workspace.
CurrentSolution
;
116
var solution = workspace.
CurrentSolution
;
121
solution = workspace.
CurrentSolution
;
123
solution = workspace.
CurrentSolution
;
132
var solution = workspace.
CurrentSolution
;
143
var solution = workspace.
CurrentSolution
;
157
var solution = workspace.
CurrentSolution
;
184
var solution = workspace.
CurrentSolution
;
223
workspace.TryApplyChanges(workspace.
CurrentSolution
);
226
var tree1 = await workspace.
CurrentSolution
233
var tree2 = await workspace.
CurrentSolution
242
var currentSnapshot = workspaceSnapshotBuilder.
CurrentSolution
;
260
var solution = workspace.
CurrentSolution
;
274
var solution = workspace.
CurrentSolution
;
285
var snapshot = workspace.
CurrentSolution
;
296
var solution = workspace.
CurrentSolution
;
313
var solution = workspace.
CurrentSolution
;
324
var snapshot = workspace.
CurrentSolution
;
335
var solution = workspace.
CurrentSolution
;
352
var solution = workspace.
CurrentSolution
;
362
Assert.Empty(workspace.
CurrentSolution
.Projects);
369
var solution = workspace.
CurrentSolution
;
384
var solution = workspace.
CurrentSolution
;
394
Assert.Empty(workspace.
CurrentSolution
.Projects.Single().Documents);
403
var solution = workspace.
CurrentSolution
;
411
var snapshot = workspace.
CurrentSolution
;
422
var solution = workspace.
CurrentSolution
;
433
var snapshot = workspace.
CurrentSolution
;
446
var solution = workspace.
CurrentSolution
;
461
var snapshot = workspace.
CurrentSolution
;
479
var solutionX = workspace.
CurrentSolution
;
494
var solutionY = workspace.
CurrentSolution
;
512
var solutionZ = workspace.
CurrentSolution
;
533
var solutionX = workspace.
CurrentSolution
;
548
var solutionY = workspace.
CurrentSolution
;
572
var cs = workspace.
CurrentSolution
;
601
var solutionX = workspace.
CurrentSolution
;
616
var solutionY = workspace.
CurrentSolution
;
643
var cs = workspace.
CurrentSolution
;
665
var cs = workspace.
CurrentSolution
;
693
var solution = workspace.
CurrentSolution
;
704
solution = workspace.
CurrentSolution
;
729
Assert.Equal(startText, (await workspace.
CurrentSolution
.GetDocument(document.Id).GetTextAsync()).ToString());
732
var oldSolution = workspace.
CurrentSolution
;
736
Assert.Equal(startText, (await workspace.
CurrentSolution
.GetDocument(document.Id).GetTextAsync()).ToString());
760
var oldSolution = workspace.
CurrentSolution
;
766
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
781
var oldSolution = workspace.
CurrentSolution
;
787
Assert.Equal(0, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1053
var project = workspace.
CurrentSolution
.Projects.Single();
1077
var project = workspace.
CurrentSolution
.Projects.Single();
1109
var project = workspace.
CurrentSolution
.Projects.Single();
1113
var oldSolution = workspace.
CurrentSolution
;
1122
var doc = workspace.
CurrentSolution
.GetAdditionalDocument(additionalDoc.Id);
1142
var project = workspace.
CurrentSolution
.Projects.Single();
1146
var oldSolution = workspace.
CurrentSolution
;
1155
var doc = workspace.
CurrentSolution
.GetAnalyzerConfigDocument(analyzerConfigDoc.Id);
1232
var project = workspace.
CurrentSolution
.Projects.Single();
1236
var oldSolution = workspace.
CurrentSolution
;
1239
var doc = workspace.
CurrentSolution
.GetAdditionalDocument(additionalDoc.Id);
1243
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1244
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Count());
1248
oldSolution = workspace.
CurrentSolution
;
1253
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1254
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Count());
1255
Assert.Equal("original.config", workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Single().Name);
1268
var project = workspace.
CurrentSolution
.Projects.Single();
1272
var oldSolution = workspace.
CurrentSolution
;
1275
var doc = workspace.
CurrentSolution
.GetAnalyzerConfigDocument(analyzerConfigDoc.Id);
1279
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1280
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1284
oldSolution = workspace.
CurrentSolution
;
1289
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1290
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1291
Assert.Equal("original.config", workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Single().Name);
1306
var project = workspace.
CurrentSolution
.Projects.Single();
1312
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1313
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Count());
1316
project = workspace.
CurrentSolution
.Projects.Single();
1319
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1320
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Count());
1321
Assert.Equal("original.config", workspace.
CurrentSolution
.GetProject(project1.Id).AdditionalDocuments.Single().Name);
1334
var project = workspace.
CurrentSolution
.Projects.Single();
1340
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1341
Assert.Equal(2, workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1344
project = workspace.
CurrentSolution
.Projects.Single();
1347
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).Documents.Count());
1348
Assert.Equal(1, workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1349
Assert.Equal("original.config", workspace.
CurrentSolution
.GetProject(project1.Id).AnalyzerConfigDocuments.Single().Name);
1364
var documentIdsWithFilePath = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(docFilePath);
1368
documentIdsWithFilePath = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(additionalDocFilePath);
1384
var documentIdsWithFilePath = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(docFilePath);
1388
documentIdsWithFilePath = workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(analyzerConfigDocFilePath);
1463
var solution = workspace1.
CurrentSolution
;
1477
var currentOptionValue = workspace1.
CurrentSolution
.Options.GetOption(optionKey);
1500
var beforeSolutionForPrimaryWorkspace = primaryWorkspace.
CurrentSolution
;
1501
var beforeSolutionForSecondaryWorkspace = secondaryWorkspace.
CurrentSolution
;
1514
Assert.NotEqual(beforeSolutionForPrimaryWorkspace, primaryWorkspace.
CurrentSolution
);
1515
Assert.NotEqual(beforeSolutionForSecondaryWorkspace, secondaryWorkspace.
CurrentSolution
);
1527
Assert.NotSame(beforeSolutionForPrimaryWorkspace, primaryWorkspace.
CurrentSolution
);
1528
Assert.NotSame(beforeSolutionForSecondaryWorkspace, secondaryWorkspace.
CurrentSolution
);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
59
var solution = workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (21)
Diagnostics\Suppression\SuppressionTests.cs (3)
447
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
758
var solution = workspace.
CurrentSolution
;
1000
var solution = workspace.
CurrentSolution
;
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (14)
301
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
368
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
395
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source);
429
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
462
var oldSolution = workspace.
CurrentSolution
.
511
var oldSolution = workspace.
CurrentSolution
;
516
var newSolution = workspace.
CurrentSolution
.WithDocumentText(documentId, SourceText.From(source2));
542
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source);
580
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
619
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
660
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
707
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
741
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
795
var oldSolution = AddDefaultTestProject(workspace.
CurrentSolution
, source1);
SemanticSearch\CSharpSemanticSearchServiceTests.cs (4)
64
var solution = workspace.
CurrentSolution
;
101
var solution = workspace.
CurrentSolution
;
151
var solution = workspace.
CurrentSolution
;
205
var solution = workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
Formatting\FormattingMultipleSpanTests.cs (1)
164
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp);
OrganizeImports\OrganizeUsingsTests.cs (2)
30
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp);
91
var project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.CSharp);
Microsoft.CodeAnalysis.EditorFeatures (21)
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);
EditorConfigSettings\Aggregator\SettingsAggregator.cs (2)
36
var currentSolution = _workspace.
CurrentSolution
.SolutionState;
94
UpdateProviders(_workspace.
CurrentSolution
.SolutionState);
EditorConfigSettings\DataProvider\SettingsProviderBase.cs (1)
54
var solution = Workspace.
CurrentSolution
;
EditorConfigSettings\Updater\SettingsUpdaterBase.cs (1)
74
var solution = Workspace.
CurrentSolution
;
IntelliSense\NavigationActionFactory.cs (1)
60
var solution = workspace.
CurrentSolution
;
Navigation\IDocumentNavigationServiceExtensions.cs (1)
78
var document = workspace.
CurrentSolution
.GetDocument(documentId);
Remote\SolutionChecksumUpdater.cs (2)
168
var solution = _workspace.
CurrentSolution
;
199
var solution = _workspace.
CurrentSolution
;
RenameTracking\RenameTrackingTaggerProvider.cs (1)
72
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)
50
var document = this.
CurrentSolution
.GetTextDocument(documentId);
75
var document = this.
CurrentSolution
.GetRequiredDocument(documentId);
84
var document = this.
CurrentSolution
.GetRequiredAdditionalDocument(documentId);
93
var document = this.
CurrentSolution
.GetRequiredAnalyzerConfigDocument(documentId);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (57)
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 new CodeLensReferencesService().GetReferenceCountAsync(workspace.
CurrentSolution
, annotatedDocument.Id,
53
var document = workspace.
CurrentSolution
.GetDocument(annotatedDocument.Id);
62
var result = await new CodeLensReferencesService().FindReferenceLocationsAsync(workspace.
CurrentSolution
,
79
var document = workspace.
CurrentSolution
.GetDocument(annotatedDocument.Id);
88
var result = await new CodeLensReferencesService().FindReferenceMethodsAsync(workspace.
CurrentSolution
,
105
var document = workspace.
CurrentSolution
.GetDocument(annotatedDocument.Id);
114
var actual = await new CodeLensReferencesService().GetFullyQualifiedNameAsync(workspace.
CurrentSolution
,
Completion\AbstractCompletionProviderTests.cs (7)
370
var currentDocument = workspace.
CurrentSolution
.GetDocument(workspaceFixture.Target.CurrentDocument.Id);
694
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspaceFixture.Target.CurrentDocument.Id);
957
var solution = testWorkspace.
CurrentSolution
;
1013
var solution = testWorkspace.
CurrentSolution
;
1042
var solution = testWorkspace.
CurrentSolution
;
1277
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
1322
var document = workspace.
CurrentSolution
.GetDocument(documentId);
Debugging\AbstractDataTipInfoGetterTests.cs (1)
71
workspace.
CurrentSolution
.Projects.First().Documents.First(),
Diagnostics\DiagnosticTaggerWrapper.cs (1)
41
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)
26
=> _workspace.
CurrentSolution
.Projects.First().DocumentIds.First();
ExtractInterface\ExtractInterfaceTestState.cs (3)
57
OriginalSolution = Workspace.
CurrentSolution
;
65
ExtractFromDocument = Workspace.
CurrentSolution
.GetDocument(_testDocument.Id);
123
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)
183
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);
LanguageServer\AbstractLanguageServerProtocolTests.cs (8)
340
var solution = workspace.
CurrentSolution
;
415
var generatedDocumentId = DocumentId.CreateNewId(workspace.
CurrentSolution
.ProjectIds.First());
426
var newSolution = workspace.
CurrentSolution
.AddDocument(generatedDocumentInfo);
434
var solution = workspace.
CurrentSolution
446
var solution = workspace.
CurrentSolution
597
var locations = await GetAnnotatedLocationsAsync(testWorkspace, testWorkspace.
CurrentSolution
);
623
var locations = await GetAnnotatedLocationsAsync(testWorkspace, testWorkspace.
CurrentSolution
);
759
public Solution GetCurrentSolution() => TestWorkspace.
CurrentSolution
;
NavigateTo\AbstractNavigateToTests.cs (1)
243
=> [_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)
350
var document = testWorkspace.
CurrentSolution
.GetDocument(documentId);
353
document = testWorkspace.
CurrentSolution
.GetDocument(documentId);
469
var document = testWorkspace.
CurrentSolution
.GetDocument(documentId);
SpellCheck\AbstractSpellCheckSpanTests.cs (1)
28
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
Structure\AbstractSyntaxStructureProviderTests.cs (2)
51
var document = workspace.
CurrentSolution
.GetRequiredDocument(hostDocument.Id);
70
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 (227)
CodeFixes\CodeFixServiceTests.cs (7)
49
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
56
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
293
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
356
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
397
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
778
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
1071
sourceDocument = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
CodeGeneration\AbstractCodeGenerationTests.cs (1)
31
var project = workspace.
CurrentSolution
CodeGeneration\CodeGenerationTests.cs (3)
865
this.Document = Workspace.
CurrentSolution
.Projects.Single().Documents.Single();
876
var semanticModel = await workspace.
CurrentSolution
.Projects.Single().Documents.Single().GetSemanticModelAsync();
881
public Solution Solution { get { return Workspace.
CurrentSolution
; } }
CodeRefactorings\CodeRefactoringServiceTest.cs (5)
48
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
87
var document = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
106
var project = workspace.
CurrentSolution
.Projects.Single();
165
var project = workspace.
CurrentSolution
.Projects.Single()
204
var project = workspace.
CurrentSolution
.Projects.Single()
Completion\CompletionServiceTests.cs (1)
43
var project = workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(reference);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (25)
61
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
71
workspace.
CurrentSolution
, projectId: null, documentId: null, diagnosticIds: null, shouldIncludeAnalyzer: null, getDocuments: null,
86
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
100
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
115
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
135
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
154
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
257
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
292
var solution = workspace.
CurrentSolution
;
329
var project = workspace.
CurrentSolution
.Projects.Single();
340
var project = workspace.
CurrentSolution
.Projects.Single();
351
var project = workspace.
CurrentSolution
.Projects.Single();
376
var solution = workspace.
CurrentSolution
;
509
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
511
var project = workspace.
CurrentSolution
.Projects.Single();
624
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
626
var project = workspace.
CurrentSolution
.Projects.Single();
702
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
703
var project = workspace.
CurrentSolution
.Projects.Single();
740
var project = workspace.
CurrentSolution
.Projects.Single();
751
project = workspace.
CurrentSolution
.Projects.Single();
816
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
818
var project = workspace.
CurrentSolution
.Projects.Single();
859
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
.Projects.Single().AddAnalyzerReference(new TestGeneratorReference(generator)).Solution));
861
var project = workspace.
CurrentSolution
.Projects.Single();
Diagnostics\DiagnosticDataTests.cs (5)
112
var document = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp).AddDocument("TestDocument", code);
139
var additionalDocument = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
175
var additionalDocument = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
223
var project = workspace.
CurrentSolution
.GetRequiredProject(documentId.ProjectId);
260
var firstDocument = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (2)
58
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences(
66
var document = workspace.
CurrentSolution
.GetDocument(documentId);
EditAndContinue\EditAndContinueLanguageServiceTests.cs (4)
69
solution = workspace.
CurrentSolution
;
116
await localWorkspace.ChangeSolutionAsync(localWorkspace.
CurrentSolution
121
var solution = localWorkspace.
CurrentSolution
;
257
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)
97
var document = testWorkspace.
CurrentSolution
.GetRequiredDocument(testHostDocument.Id);
162
var docSpan = await actualDocumentSpans[i].TryRehydrateAsync(workspace.
CurrentSolution
, CancellationToken.None);
337
var document = testWorkspace.
CurrentSolution
.GetRequiredDocument(testHostDocument.Id);
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
; }
311
var document = Workspace.
CurrentSolution
.GetRequiredDocument(testDocument.Id);
Preview\PreviewWorkspaceTests.cs (22)
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
);
166
var project = previewWorkspace.
CurrentSolution
.Projects.Single();
RenameTracking\RenameTrackingTestState.cs (2)
170
var document = this.Workspace.
CurrentSolution
.GetDocument(HostDocument.Id);
200
await operations[0].TryApplyAsync(this.Workspace, this.Workspace.
CurrentSolution
, CodeAnalysisProgress.None, CancellationToken.None);
Snippets\RoslynLSPSnippetConvertTests.cs (3)
402
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
413
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
495
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.First().Id);
StackTraceExplorer\StackTraceExplorerTests.cs (5)
41
var definition = await service.TryFindDefinitionAsync(workspace.
CurrentSolution
, stackFrame, StackFrameSymbolPart.Method, CancellationToken.None);
47
var doc = workspace.
CurrentSolution
.GetRequiredDocument(cursorDoc.Id);
56
var expectedDefinition = expectedSymbol.ToNonClassifiedDefinitionItem(workspace.
CurrentSolution
, includeHiddenLocations: true);
825
var definition = await service.TryFindDefinitionAsync(workspace.
CurrentSolution
, parsedFame, StackFrameSymbolPart.Method, CancellationToken.None);
857
var definition = await service.TryFindDefinitionAsync(workspace.
CurrentSolution
, frame, StackFrameSymbolPart.Method, CancellationToken.None);
Structure\BlockStructureServiceTests.cs (1)
116
var document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id);
Structure\StructureTaggerTests.cs (1)
403
var document = workspace.
CurrentSolution
.GetDocument(hostdoc.Id);
SymbolFinder\DependentTypeFinderTests.cs (18)
53
var solution = workspace.
CurrentSolution
;
94
var solution = workspace.
CurrentSolution
;
141
var solution = workspace.
CurrentSolution
;
186
var solution = workspace.
CurrentSolution
;
227
var solution = workspace.
CurrentSolution
;
269
var solution = workspace.
CurrentSolution
;
311
var solution = workspace.
CurrentSolution
;
351
var solution = workspace.
CurrentSolution
;
392
var solution = workspace.
CurrentSolution
;
432
var solution = workspace.
CurrentSolution
;
463
var solution = workspace.
CurrentSolution
;
512
var solution = workspace.
CurrentSolution
;
564
var solution = workspace.
CurrentSolution
;
591
var solution = workspace.
CurrentSolution
;
638
var solution = workspace.
CurrentSolution
;
664
var solution = workspace.
CurrentSolution
;
728
var solution = workspace.
CurrentSolution
;
771
var solution = workspace.
CurrentSolution
;
SymbolFinder\FindSymbolAtPositionTests.cs (1)
21
var document = workspace.
CurrentSolution
.GetRequiredDocument(workspace.Documents.Single().Id);
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
40
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)
26
var document = workspace.
CurrentSolution
.GetDocument(workspace.GetDocumentId(hostDocument));
54
var document = workspace.
CurrentSolution
.GetDocument(workspace.GetDocumentId(hostDocument));
Utilities\SymbolEquivalenceComparerTests.cs (92)
52
var type = (ITypeSymbol)(await workspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
124
var csharpType = (ITypeSymbol)(await csharpWorkspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
125
var vbType = (await vbWorkspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
194
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
195
var type2_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
196
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
197
var type2_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
245
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
246
var type2_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
247
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
248
var type2_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
284
var typeC = (await workspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
285
var typeD = (await workspace.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("D").Single();
328
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
329
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
353
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
354
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
378
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
379
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
403
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
404
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
428
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
429
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
455
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
456
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
482
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
483
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
509
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
510
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
534
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
535
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
559
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
560
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
586
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
587
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
620
var csharpType1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
621
var vbType1 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
665
var csharpType1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
666
var vbType1 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
696
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
722
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
723
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
757
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
758
var type1_v2 = (await workspace2.
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();
825
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
826
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
856
var outer1 = (INamespaceSymbol)(await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetMembers("Outer").Single();
857
var outer2 = (INamespaceSymbol)(await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetMembers("Outer").Single();
933
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
934
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
935
var type2_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
936
var type2_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
970
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
971
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single();
995
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
996
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1020
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1021
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1051
var outer = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Outer").Single();
1052
var other = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Other").Single();
1081
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1082
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single();
1112
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1113
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1152
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1153
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1182
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1183
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1212
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1213
var type1_v2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1243
var type1_v1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single();
1244
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();
1343
var t1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1344
var t2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1407
var t1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1408
var t2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1470
var t1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1471
var t2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1533
var t1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1534
var t2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single();
1621
var comp1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync());
1622
var comp2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync());
1695
var comp1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync());
1696
var comp2 = (await workspace2.
CurrentSolution
.Projects.Single().GetCompilationAsync());
1718
var namespace1 = (await workspace1.
CurrentSolution
.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M");
1719
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.EditorFeatures.Wpf (5)
InlineDiagnostics\InlineDiagnosticsTaggerProvider.cs (1)
67
var project = workspace.
CurrentSolution
.GetProject(diagnostic.DocumentId.ProjectId);
NavigateTo\NavigateToItemProvider.cs (3)
47
=> NavigateToUtilities.GetKindsProvided(_workspace.
CurrentSolution
);
53
foreach (var project in _workspace.
CurrentSolution
.Projects)
112
var solution = _workspace.
CurrentSolution
;
Peek\DefinitionPeekableItem.cs (1)
70
var solution = workspace.
CurrentSolution
;
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.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)
24
var oldSolution = workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.Features (8)
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
112
var newSolution = workspace.
CurrentSolution
.WithDocumentText(
124
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);
27
var definition = await _stackTraceExplorerService.TryFindDefinitionAsync(workspace.
CurrentSolution
, parsedFrame.UnderlyingObject, StackFrameSymbolPart.Method, cancellationToken).ConfigureAwait(false);
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
45
var (project, symbol) = await TryResolveSymbolAsync(workspace.
CurrentSolution
, symbolKey, cancellationToken).ConfigureAwait(false);
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
75
var metadataSolution = metadataWorkspace.CurrentSolution.WithFallbackAnalyzerOptions(sourceWorkspace.
CurrentSolution
.FallbackAnalyzerOptions);
344
var solution = fileInfo.Workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
76
solution = workspace.
CurrentSolution
;
RelatedDocuments\AbstractRelatedDocumentsTests.cs (1)
32
var startingDocument = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
Snippets\AbstractSnippetProviderTests.cs (2)
35
var project = workspace.
CurrentSolution
.
118
var project = workspace.
CurrentSolution
.
Microsoft.CodeAnalysis.Features.UnitTests (44)
EditAndContinue\ActiveStatementsMapTests.cs (3)
116
var solution = workspace.
CurrentSolution
171
var solution = workspace.
CurrentSolution
222
var solution = workspace.
CurrentSolution
EditAndContinue\CompileTimeSolutionProviderTests.cs (4)
41
var designTimeSolution = workspace.
CurrentSolution
.
123
_ = await workspace.
CurrentSolution
.GetRequiredProject(projectId).GetCompilationAsync();
126
var compileTimeSolution1 = provider.GetCompileTimeSolution(workspace.
CurrentSolution
);
141
var compileTimeSolution2 = provider.GetCompileTimeSolution(workspace.
CurrentSolution
);
EditAndContinue\EditSessionActiveStatementsTests.cs (1)
66
var solution = workspace.
CurrentSolution
;
EditAndContinue\EmitSolutionUpdateResultsTests.cs (2)
30
solution = workspace.
CurrentSolution
;
70
var document = workspace.
CurrentSolution
.
EditAndContinue\RemoteEditAndContinueServiceTests.cs (5)
78
await localWorkspace.ChangeSolutionAsync(localWorkspace.
CurrentSolution
85
var solution = localWorkspace.
CurrentSolution
;
141
localWorkspace.
CurrentSolution
,
219
var results = await sessionProxy.EmitSolutionUpdateAsync(localWorkspace.
CurrentSolution
, runningProjects: [project.Id], activeStatementSpanProvider, CancellationToken.None);
263
var baseActiveSpans = await sessionProxy.GetBaseActiveStatementSpansAsync(localWorkspace.
CurrentSolution
, [documentId, inProcOnlyDocumentId], CancellationToken.None);
FindUsages\DefinitionItemFactoryTests.cs (29)
130
var solution = workspace.
CurrentSolution
;
166
var solution = workspace.
CurrentSolution
;
208
var solution = workspace.
CurrentSolution
;
244
var solution = workspace.
CurrentSolution
;
286
var solution = workspace.
CurrentSolution
;
328
var solution = workspace.
CurrentSolution
;
381
var solution = workspace.
CurrentSolution
;
435
var solution = workspace.
CurrentSolution
;
475
var solution = workspace.
CurrentSolution
;
515
var solution = workspace.
CurrentSolution
;
557
var solution = workspace.
CurrentSolution
;
615
var solution = workspace.
CurrentSolution
;
661
var solution = workspace.
CurrentSolution
;
698
var solution = workspace.
CurrentSolution
;
760
var solution = workspace.
CurrentSolution
;
816
var solution = workspace.
CurrentSolution
;
870
var solution = workspace.
CurrentSolution
;
925
var solution = workspace.
CurrentSolution
;
975
var solution = workspace.
CurrentSolution
;
1030
var solution = workspace.
CurrentSolution
;
1082
var solution = workspace.
CurrentSolution
;
1144
var solution = workspace.
CurrentSolution
;
1201
var solution = workspace.
CurrentSolution
;
1258
var solution = workspace.
CurrentSolution
;
1330
var solution = workspace.
CurrentSolution
;
1390
var solution = workspace.
CurrentSolution
;
1442
var solution = workspace.
CurrentSolution
;
1505
var solution = workspace.
CurrentSolution
;
1576
var solution = workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.LanguageServer (9)
HostWorkspace\LanguageServerProjectSystem.cs (1)
82
_projectFileExtensionRegistry = new ProjectFileExtensionRegistry(workspaceFactory.Workspace.
CurrentSolution
.Services, new DiagnosticReporter(workspaceFactory.Workspace));
HostWorkspace\LanguageServerWorkspace.cs (7)
14
/// our <see cref="Workspace.
CurrentSolution
"/> to stay in sync with all the document changes.
69
if (
CurrentSolution
.ContainsDocument(documentId))
73
else if (
CurrentSolution
.ContainsAdditionalDocument(documentId))
86
if (
CurrentSolution
.ContainsDocument(documentId))
90
else if (
CurrentSolution
.ContainsAdditionalDocument(documentId))
103
var textDocument = w.
CurrentSolution
.GetDocument(documentId) ?? w.
CurrentSolution
.GetAdditionalDocument(documentId);
HostWorkspace\Razor\RazorDynamicFileInfoProvider.cs (1)
84
var textDocument = await _workspaceFactory.Workspace.
CurrentSolution
.GetTextDocumentAsync(response.CSharpDocument, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Features\Diagnostics\DiagnosticAnalyzerService.cs (1)
104
return analyzer.GetCachedDiagnosticsAsync(workspace.
CurrentSolution
, projectId, documentId, includeSuppressedDiagnostics, includeLocalDocumentDiagnostics, includeNonLocalDocumentDiagnostics, cancellationToken);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (1)
20
var analyzerReferences = _workspace.
CurrentSolution
.SolutionState.Analyzers.HostAnalyzerReferences;
Workspaces\LspWorkspaceManager.cs (3)
147
foreach (var documentId in workspace.
CurrentSolution
.GetDocumentIds(uri))
355
var workspaceCurrentSolution = workspace.
CurrentSolution
;
393
workspaceCurrentSolution = workspace.
CurrentSolution
;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (15)
Metadata\LspMetadataAsSourceWorkspaceTests.cs (1)
130
var doc = testLspServer.GetManagerAccessor().GetLspMiscellaneousFilesWorkspace()!.
CurrentSolution
.Projects.SingleOrDefault()?.Documents.SingleOrDefault();
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (1)
309
return testLspServer.GetManagerAccessor().GetLspMiscellaneousFilesWorkspace()!.
CurrentSolution
.Projects.SingleOrDefault()?.Documents.Single();
Options\SolutionAnalyzerConfigOptionsUpdaterTests.cs (10)
49
Assert.Empty(workspace.
CurrentSolution
.FallbackAnalyzerOptions);
71
Assert.Empty(workspace.
CurrentSolution
.FallbackAnalyzerOptions);
78
Assert.False(workspace.
CurrentSolution
.FallbackAnalyzerOptions.TryGetValue(LanguageNames.CSharp, out _));
98
Assert.True(workspace.
CurrentSolution
.FallbackAnalyzerOptions.TryGetValue(language, out var fallbackOptions));
149
Assert.True(workspace.
CurrentSolution
.FallbackAnalyzerOptions.TryGetValue(LanguageNames.CSharp, out var fallbackOptions));
156
var projectWithConfig = workspace.
CurrentSolution
.GetRequiredProject(testProjectWithConfig.Id);
195
var projectWithoutConfig = workspace.
CurrentSolution
.GetRequiredProject(testProjectWithoutConfig.Id);
262
Assert.Empty(workspace.
CurrentSolution
.FallbackAnalyzerOptions);
267
var optionsAfterProjectAdded = workspace.
CurrentSolution
.FallbackAnalyzerOptions;
274
Assert.Same(optionsAfterProjectAdded, workspace.
CurrentSolution
.FallbackAnalyzerOptions);
Workspaces\LspWorkspaceManagerTests.cs (3)
446
var newProjectWorkspaceTwo = testWorkspaceTwo.
CurrentSolution
.Projects.First().WithAssemblyName("NewCSProj1");
483
var documentUri = testWorkspace.
CurrentSolution
.Projects.First().Documents.First().GetURI();
502
var newProject = testWorkspace.
CurrentSolution
.Projects.First().WithAssemblyName(newAssemblyName);
Microsoft.CodeAnalysis.Remote.ServiceHub (8)
Host\RemoteWorkspace.cs (4)
52
var currentSolutionChecksum = await this.
CurrentSolution
.CompilationState.GetChecksumAsync(cancellationToken).ConfigureAwait(false);
212
var currentSolution = this.
CurrentSolution
;
239
/// cref="Workspace.
CurrentSolution
"/> of this <see cref="RemoteWorkspace"/> is the responsibility of any
247
/// 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)
128
solutions.Add(this.
CurrentSolution
);
Host\RemoteWorkspaceManager.cs (1)
42
/// cref="Workspace.
CurrentSolution
"/> of the workspace it is created against (as well as any recent in-flight
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (1)
100
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)
3015
Dim project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
4197
Dim solution = New AdhocWorkspace().
CurrentSolution
Formatting\VisualBasicFormattingTestBase.vb (1)
57
Dim project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
OrganizeImports\OrganizeImportsTests.vb (2)
27
Dim project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
48
Dim project = workspace.
CurrentSolution
.AddProject("Project", "Project.dll", LanguageNames.VisualBasic)
Microsoft.CodeAnalysis.Workspaces (42)
CodeActions\CodeAction.cs (1)
464
originalSolution ??= changedSolution.Workspace.
CurrentSolution
;
CodeActions\Operations\ApplyChangesOperation.cs (1)
53
var currentSolution = workspace.
CurrentSolution
;
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
121
var solution = _workspace.
CurrentSolution
;
Formatting\Formatter.cs (1)
321
return syntaxFormattingService.GetFormattingOptions(optionSet ?? workspace.
CurrentSolution
.Options);
Recommendations\Recommender.cs (1)
26
var solution = workspace.
CurrentSolution
;
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (3)
286
if (_documentAlreadyInWorkspace(_project._projectSystemProjectFactory.Workspace.
CurrentSolution
, documentId))
338
if (_project._projectSystemProjectFactory.Workspace.
CurrentSolution
.GetDocument(documentId) != null)
484
var attributes = w.
CurrentSolution
.GetRequiredDocument(documentId).State.Attributes;
Workspace\ProjectSystem\ProjectSystemProject.cs (7)
285
TryReportCompilationThrownAway(_projectSystemProjectFactory.Workspace.
CurrentSolution
, Id);
500
private bool HasBeenRemoved => !_projectSystemProjectFactory.Workspace.
CurrentSolution
.ContainsProject(Id);
1303
return _projectSystemProjectFactory.Workspace.
CurrentSolution
.GetRequiredProject(Id).AllProjectReferences.Contains(projectReference);
1311
var projectReferencesInWorkspace = _projectSystemProjectFactory.Workspace.
CurrentSolution
.GetRequiredProject(Id).AllProjectReferences;
1350
if (!_projectSystemProjectFactory.Workspace.
CurrentSolution
.ContainsProject(Id))
1377
var project = w.
CurrentSolution
.GetRequiredProject(Id);
1385
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)
27
var solution = workspace.
CurrentSolution
;
63
var solution = workspace.
CurrentSolution
;
110
var solution = workspace.
CurrentSolution
;
131
return workspace.
CurrentSolution
.GetDocument(id);
Workspace\Workspace.cs (18)
164
/// Sets the <see cref="
CurrentSolution
"/> of this workspace. This method does not raise a <see cref="WorkspaceChanged"/> event.
174
/// Sets the <see cref="
CurrentSolution
"/> of this workspace. This method does not raise a <see
189
var oldSolution = this.
CurrentSolution
;
219
/// Applies specified transformation to <see cref="
CurrentSolution
"/>, updates <see cref="
CurrentSolution
"/> to
229
/// <returns>True if <see cref="
CurrentSolution
"/> was set to the transformed solution, false if the
404
/// Ensures that whenever a new language is added to <see cref="
CurrentSolution
"/> we
406
/// Conversely, if a language is no longer present in <see cref="
CurrentSolution
"/>
411
/// <see cref="
CurrentSolution
"/> as appropriate.
415
/// of any <see cref="Solution"/> snapshot stored in <see cref="
CurrentSolution
"/>.
453
/// Applies specified transformation to <see cref="
CurrentSolution
"/>, updates <see cref="
CurrentSolution
"/> to
464
/// <param name="onBeforeUpdate">Action to perform immediately prior to updating <see cref="
CurrentSolution
"/>.
465
/// The action will be passed the old <see cref="
CurrentSolution
"/> that will be replaced and the exact solution
469
/// <param name="onAfterUpdate">Action to perform once <see cref="
CurrentSolution
"/> has been updated. The
470
/// action will be passed the old <see cref="
CurrentSolution
"/> that was just replaced and the exact solution it
560
/// Setter also force updates the <see cref="
CurrentSolution
"/> to have the updated <see cref="Solution.Options"/>.
566
return this.
CurrentSolution
.Options;
Workspace\Workspace_Editor.cs (2)
212
/// Gets the ids for documents in the <see cref="
CurrentSolution
"/> snapshot associated with the given <paramref name="container"/>.
228
return
CurrentSolution
.GetRelatedDocumentIds(documentId);
Workspace\Workspace_Events.cs (1)
231
var currentSolution = this.
CurrentSolution
;
Microsoft.CodeAnalysis.Workspaces.MSBuild (12)
MSBuild\MSBuildWorkspace.cs (11)
211
return this.
CurrentSolution
;
250
var projectMap = ProjectMap.Create(this.
CurrentSolution
);
261
var projectResult = this.
CurrentSolution
.GetProject(projects[0].Id);
387
var document = this.
CurrentSolution
.GetDocument(documentId);
405
var document = this.
CurrentSolution
.GetAdditionalDocument(documentId);
453
var project = this.
CurrentSolution
.GetRequiredProject(info.Id.ProjectId);
513
var document = this.
CurrentSolution
.GetDocument(documentId);
597
var relativePath = PathUtilities.GetRelativePath(Path.GetDirectoryName(
CurrentSolution
.GetRequiredProject(projectId).FilePath)!, peRef.FilePath);
627
var project = this.
CurrentSolution
.GetProject(projectId);
652
var project = this.
CurrentSolution
.GetProject(projectReference.ProjectId);
667
var project = this.
CurrentSolution
.GetProject(projectReference.ProjectId);
MSBuild\ProjectMap.cs (1)
16
/// project into a custom <see cref="Workspace"/>. To use, pass <see cref="Workspace.
CurrentSolution
"/> to <see cref="Create(Solution)"/>.
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (47)
NetCoreTests.cs (20)
87
Assert.Single(workspace.
CurrentSolution
.ProjectIds);
112
Assert.Single(workspace.
CurrentSolution
.ProjectIds);
123
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
130
Assert.Equal(libraryProject.FilePath, workspace.
CurrentSolution
.GetProject(projectRefId).FilePath);
152
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
163
Assert.Equal(3, workspace.
CurrentSolution
.ProjectIds.Count);
195
Assert.Equal(3, workspace.
CurrentSolution
.ProjectIds.Count);
200
foreach (var project in workspace.
CurrentSolution
.Projects)
213
foreach (var project in workspace.
CurrentSolution
.Projects)
237
Assert.Equal(3, workspace.
CurrentSolution
.ProjectIds.Count);
241
foreach (var project in workspace.
CurrentSolution
.Projects)
285
Assert.Equal(4, workspace.
CurrentSolution
.ProjectIds.Count);
290
foreach (var project in workspace.
CurrentSolution
.Projects)
312
foreach (var project in workspace.
CurrentSolution
.Projects)
348
var projects = workspace.
CurrentSolution
.Projects.Where(p => p.FilePath.EndsWith("Project.csproj"));
353
var referencedProject = workspace.
CurrentSolution
.GetProject(projectReference.ProjectId);
442
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
444
Assert.Contains(workspace.
CurrentSolution
.Projects, p => p.Name == "Library(net6)");
445
Assert.Contains(workspace.
CurrentSolution
.Projects, p => p.Name == "Library(net5)");
500
Assert.Equal(2, workspace.
CurrentSolution
.ProjectIds.Count);
VisualStudioMSBuildWorkspaceTests.cs (27)
1445
vbProject = workspace.
CurrentSolution
.GetProject(vbProject.Id);
2018
var solution2 = workspace.
CurrentSolution
;
2038
var projectB = workspaceB.
CurrentSolution
.GetProjectsByName("CSharpProject").FirstOrDefault();
2061
var solution2 = workspace.
CurrentSolution
;
2094
var solution2 = workspace.
CurrentSolution
;
2123
var solution2 = workspace.
CurrentSolution
;
2150
var solution2 = workspace.
CurrentSolution
;
2176
var solution2 = workspace.
CurrentSolution
;
2206
workspace.TryApplyChanges(workspace.
CurrentSolution
.AddAdditionalDocument(DocumentId.CreateNewId(csProjectId), "foo.xaml", SourceText.From("<foo></foo>")));
2209
var xaml = workspace.
CurrentSolution
.GetProject(csProjectId).AdditionalDocuments.FirstOrDefault(d => d.Name == "XamlFile.xaml");
2216
workspace.TryApplyChanges(workspace.
CurrentSolution
.RemoveAdditionalDocument(xaml.Id));
2229
var originalSolution = workspace.
CurrentSolution
;
2238
var doc = workspace.
CurrentSolution
.Projects.First().Documents.First();
2242
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithDocumentText(doc.Id, SourceText.From(newText), PreservationMode.PreserveIdentity));
2259
var originalSolution = workspace.
CurrentSolution
;
2268
var doc = workspace.
CurrentSolution
.Projects.First().Documents.First();
2274
.
CurrentSolution
2304
Assert.Equal(2, workspace.
CurrentSolution
.Projects.Count());
2334
Assert.Equal(2, workspace.
CurrentSolution
.Projects.Count());
2587
var csproject = workspace.
CurrentSolution
.Projects.First(p => p.Language == LanguageNames.CSharp);
2595
var vbproject = workspace.
CurrentSolution
.Projects.First(p => p.Language == LanguageNames.VisualBasic);
2945
workspace.TryApplyChanges(workspace.
CurrentSolution
.GetProject(project.Id).RemoveAnalyzerReference(aref).Solution);
2966
workspace.TryApplyChanges(workspace.
CurrentSolution
.GetProject(project.Id).RemoveProjectReference(pref).Solution);
2967
Assert.Empty(workspace.
CurrentSolution
.GetProject(project.Id).ProjectReferences);
2973
workspace.TryApplyChanges(workspace.
CurrentSolution
.GetProject(project.Id).AddProjectReference(pref).Solution);
2974
Assert.Single(workspace.
CurrentSolution
.GetProject(project.Id).ProjectReferences);
3290
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)
42
var project = workspace.
CurrentSolution
.GetRequiredProject(_project!.Id);
Workspaces\TestWorkspace`1.cs (6)
535
var document = await
CurrentSolution
.GetSourceGeneratedDocumentAsync(documentId, CancellationToken.None);
542
return ChangeDocumentAsync(documentId, this.
CurrentSolution
.WithDocumentText(documentId, text));
556
var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.
CurrentSolution
.AddDocument(documentInfo));
563
var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.
CurrentSolution
.WithAdditionalDocumentText(documentId, text));
570
var (oldSolution, newSolution) = this.SetCurrentSolutionEx(this.
CurrentSolution
.WithAnalyzerConfigDocumentText(documentId, text));
804
foreach (var analyzer in this.
CurrentSolution
.AnalyzerReferences)
Microsoft.CodeAnalysis.Workspaces.UnitTests (332)
CodeCleanup\AddMissingTokensTests.cs (1)
2728
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\CodeCleanupTests.cs (1)
416
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\FixIncorrectTokenTests.cs (1)
753
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\NormalizeModifiersOrOperatorsTests.cs (1)
1029
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\ReduceTokenTests.cs (1)
2016
var solution = new AdhocWorkspace().
CurrentSolution
;
CodeCleanup\RemoveUnnecessaryLineContinuationTests.cs (1)
1452
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)
133
var solution = workspace.
CurrentSolution
;
156
var solution = workspace.
CurrentSolution
;
699
var solution = workspace.
CurrentSolution
FindAllDeclarationsTests.TestSolutionsAndProject.cs (2)
96
solution = workspace.
CurrentSolution
111
solution = workspace.
CurrentSolution
;
FindReferencesTests.cs (8)
63
return workspace.
CurrentSolution
73
var solution = workspace.
CurrentSolution
122
var solution = workspace.
CurrentSolution
172
var sln = CreateWorkspace().
CurrentSolution
211
var sln = CreateWorkspace().
CurrentSolution
275
var sln = CreateWorkspace().
CurrentSolution
363
var solution = CreateWorkspace().
CurrentSolution
;
453
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)
101
return new AdhocWorkspace().
CurrentSolution
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (1)
20
var solution = workspace.
CurrentSolution
;
SemanticModelReuse\SemanticModelReuseTests.cs (1)
25
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 (181)
58
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
80
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
117
var solution = workspace.
CurrentSolution
;
126
var solution = workspace.
CurrentSolution
;
136
var solution = workspace.
CurrentSolution
;
145
var solution = workspace.
CurrentSolution
;
155
var solution = workspace.
CurrentSolution
;
164
var solution = workspace.
CurrentSolution
;
174
var solution = workspace.
CurrentSolution
;
194
var solution = workspace.
CurrentSolution
;
225
var solution = workspace.
CurrentSolution
;
252
var solution = workspace.
CurrentSolution
;
271
var solution = workspace.
CurrentSolution
;
290
var solution = workspace.
CurrentSolution
;
301
var solution = workspace.
CurrentSolution
;
331
var solution = workspace.
CurrentSolution
347
var solution = workspace.
CurrentSolution
;
372
var solution = workspace.
CurrentSolution
;
396
var solution = workspace.
CurrentSolution
;
429
var solution = workspace.
CurrentSolution
;
476
solution = workspace.
CurrentSolution
;
517
var solution = workspace.
CurrentSolution
;
564
solution = workspace.
CurrentSolution
;
596
var solution = workspace.
CurrentSolution
;
650
solution = workspace.
CurrentSolution
;
682
var solution = workspace.
CurrentSolution
;
730
solution = workspace.
CurrentSolution
;
759
var solution = workspace.
CurrentSolution
;
806
solution = workspace.
CurrentSolution
;
841
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
847
var solution = workspace.
CurrentSolution
;
895
solution = workspace.
CurrentSolution
;
918
var solution = workspace.
CurrentSolution
;
940
var solution = workspace.
CurrentSolution
;
964
var solution = workspace.
CurrentSolution
;
986
var solution = workspace.
CurrentSolution
;
1010
var solution = workspace.
CurrentSolution
;
1032
var solution = workspace.
CurrentSolution
;
1054
var solution = workspace.
CurrentSolution
;
1090
var solution = workspace.
CurrentSolution
1299
var solution = workspace.
CurrentSolution
1334
var solution = workspace.
CurrentSolution
1369
var solution = workspace.
CurrentSolution
1404
var solution = workspace.
CurrentSolution
1438
var solution = workspace.
CurrentSolution
1460
var solution = workspace.
CurrentSolution
1488
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp);
1515
var solution = workspace.
CurrentSolution
1538
var solution = workspace.
CurrentSolution
1561
var solution = workspace.
CurrentSolution
.
1584
var solution = workspace.
CurrentSolution
.
1621
var solution = workspace.
CurrentSolution
1675
var solution = workspace.
CurrentSolution
1698
var solution = workspace.
CurrentSolution
1721
var solution = workspace.
CurrentSolution
1738
var solution = workspace.
CurrentSolution
1763
var solution = workspace.
CurrentSolution
1787
var document = workspace.
CurrentSolution
1821
var document = workspace.
CurrentSolution
1859
var document = workspace.
CurrentSolution
1878
var document = workspace.
CurrentSolution
1897
var document = workspace.
CurrentSolution
1913
var solution = workspace.
CurrentSolution
;
1946
var solution = workspace.
CurrentSolution
;
1962
var solution = workspace.
CurrentSolution
;
2004
var solution = workspace.
CurrentSolution
;
2039
var solution = workspace.
CurrentSolution
;
2075
var solution = workspace.
CurrentSolution
;
2093
var solution = workspace.
CurrentSolution
;
2118
var solution = workspace.
CurrentSolution
;
2145
var solution = workspace.
CurrentSolution
;
2163
var solution = workspace.
CurrentSolution
;
2191
var solution = workspace.
CurrentSolution
;
2218
var solution = workspace.
CurrentSolution
;
2232
var solution = workspace.
CurrentSolution
;
2258
var solution = workspace.
CurrentSolution
;
2285
var solution = workspace.
CurrentSolution
;
2304
TestOptionValues(workspace.
CurrentSolution
, expectedA: "A", hasBWithoutFallback: false, expectedB: "fallbackY", expectedBFile: "fallbackY");
2361
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2387
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2417
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2446
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2475
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2506
var solution = workspace.
CurrentSolution
.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp).
2529
var solution = workspace.
CurrentSolution
;
2542
var solution = workspace.
CurrentSolution
;
2554
var solution = workspace.
CurrentSolution
;
2569
var solution = workspace.
CurrentSolution
2615
var solution = workspace.
CurrentSolution
2639
var solution = workspace.
CurrentSolution
2667
var solution = workspace.
CurrentSolution
2677
var solution = workspace.
CurrentSolution
;
2691
var solution = workspace.
CurrentSolution
2712
var solution = workspace.
CurrentSolution
2733
var solution = workspace.
CurrentSolution
2752
var solution = workspace.
CurrentSolution
2771
var solution = workspace.
CurrentSolution
2786
var solution = workspace.
CurrentSolution
2805
var solution = workspace.
CurrentSolution
2822
var solution = workspace.
CurrentSolution
2922
var solution = workspace.
CurrentSolution
;
2943
var solution = workspace.
CurrentSolution
;
2981
var solution = workspace.
CurrentSolution
;
3039
var solution = workspace.
CurrentSolution
;
3057
var sol = workspace.
CurrentSolution
;
3076
var sol = workspace.
CurrentSolution
;
3102
var sol = workspace.
CurrentSolution
;
3138
var sol = workspace.
CurrentSolution
3159
var solution1 = workspace.
CurrentSolution
3182
var sol = workspace.
CurrentSolution
3223
var sol = workspace.
CurrentSolution
3264
var solution = workspace.
CurrentSolution
3295
var sol = workspace.
CurrentSolution
;
3326
var sol = workspace.
CurrentSolution
3348
var sol = workspace.
CurrentSolution
3369
var sol = workspace.
CurrentSolution
3393
var sol = workspace.
CurrentSolution
3415
var sol = workspace.
CurrentSolution
3436
var sol = workspace.
CurrentSolution
3456
var sol = workspace.
CurrentSolution
3476
var sol = workspace.
CurrentSolution
3496
var sol = workspace.
CurrentSolution
3515
var sol = workspace.
CurrentSolution
3546
var sol = workspace.
CurrentSolution
3578
var sol = workspace.
CurrentSolution
3604
var sol = workspace.
CurrentSolution
3638
var sol = workspace.
CurrentSolution
3668
var sol = workspace.
CurrentSolution
3719
var sol = workspace.
CurrentSolution
3744
var sol = workspace.
CurrentSolution
3771
var sol = workspace.
CurrentSolution
3905
var solution = workspace.
CurrentSolution
;
3958
var solution = new AdhocWorkspace().
CurrentSolution
4073
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4098
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4126
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4171
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
4249
var project = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4267
var project = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4283
var originalProject = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4307
var originalProject = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4335
var document = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp)
4351
var solution = workspace.
CurrentSolution
.AddProject("TestProject", "TestProject", LanguageNames.CSharp).Solution;
4407
var currentSolution = workspace.
CurrentSolution
;
4547
var solution = workspace.
CurrentSolution
;
4563
var solution = workspace.
CurrentSolution
;
4634
var solution = workspace.
CurrentSolution
;
4671
var solution = workspace.
CurrentSolution
;
4707
var solution = workspace.
CurrentSolution
;
4748
var solution = workspace.
CurrentSolution
;
4794
var solution = workspace.
CurrentSolution
;
4825
var solution = workspace.
CurrentSolution
;
4935
var solution = workspace.
CurrentSolution
;
4958
var solution = workspace.
CurrentSolution
;
4980
var solution = workspace.
CurrentSolution
;
5008
var solution = workspace.
CurrentSolution
;
5036
var solution = workspace.
CurrentSolution
;
5065
var solution = workspace.
CurrentSolution
;
5096
var solution = workspace.
CurrentSolution
;
5134
var solution = workspace.
CurrentSolution
;
5151
var solution = workspace.
CurrentSolution
;
5197
var solution = workspace.
CurrentSolution
;
5241
var solution = workspace.
CurrentSolution
;
5265
var solution = workspace.
CurrentSolution
;
5386
var s0 = workspace.
CurrentSolution
;
5432
var solution = workspace.
CurrentSolution
.AddProject(projInfo);
5461
var solution = workspace.
CurrentSolution
;
5515
var solution = workspace.
CurrentSolution
5543
var solution = workspace.
CurrentSolution
5563
var solution = workspace.
CurrentSolution
5577
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
5594
var project = workspace.
CurrentSolution
.AddProject("CSharpProject", "CSharpProject", LanguageNames.CSharp);
5614
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5642
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5672
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5705
var project1 = workspace.
CurrentSolution
.AddProject("CSharpProject1", "CSharpProject1", LanguageNames.CSharp);
5730
var project1 = workspace.
CurrentSolution
5782
var project = workspace.
CurrentSolution
.AddProject("TypeScript", "TypeScript", "TypeScript");
5803
var project1 = workspace.
CurrentSolution
5836
var document1 = workspace.
CurrentSolution
.GetRequiredDocument(documentId1);
5842
var document2 = workspace.
CurrentSolution
.GetRequiredDocument(documentId2);
SolutionTests\SolutionWithSourceGeneratorTests.cs (37)
49
var project = AddEmptyProject(workspace.
CurrentSolution
)
90
var project = AddEmptyProject(workspace.
CurrentSolution
)
138
var project = AddEmptyProject(workspace.
CurrentSolution
)
165
var project = AddEmptyProject(workspace.
CurrentSolution
)
254
var project = AddEmptyProject(workspace.
CurrentSolution
)
294
var project = AddEmptyProject(workspace.
CurrentSolution
)
338
var project = AddEmptyProject(workspace.
CurrentSolution
)
366
var projectBeforeChange = AddEmptyProject(workspace.
CurrentSolution
)
389
var solutionWithProjects = AddProjectWithReference(workspace.
CurrentSolution
, analyzerReference);
419
var solution = AddEmptyProject(workspace.
CurrentSolution
)
444
var project = AddEmptyProject(workspace.
CurrentSolution
)
458
var project = AddEmptyProject(workspace.
CurrentSolution
)
481
var project = AddEmptyProject(workspace.
CurrentSolution
)
501
var project = AddEmptyProject(workspace.
CurrentSolution
)
528
var project = AddEmptyProject(workspace.
CurrentSolution
)
576
var project = AddEmptyProject(workspace.
CurrentSolution
);
589
var project = AddEmptyProject(workspace.
CurrentSolution
)
601
Assert.NotSame(workspace.
CurrentSolution
, generatedDocument.Project.Solution);
613
var project = AddEmptyProject(workspace.
CurrentSolution
)
618
var generatedDocument = Assert.Single(await workspace.
CurrentSolution
.Projects.Single().GetSourceGeneratedDocumentsAsync());
624
Assert.Same(workspace.
CurrentSolution
, generatedDocument!.Project.Solution);
632
var originalAdditionalFile = AddEmptyProject(workspace.
CurrentSolution
)
645
Assert.Empty(await workspace.
CurrentSolution
.Projects.Single().GetSourceGeneratedDocumentsAsync());
660
var solution = AddEmptyProject(workspace.
CurrentSolution
)
669
var generatedDocument = Assert.Single(await workspace.
CurrentSolution
.GetRequiredProject(projectIdWithGenerator).GetSourceGeneratedDocumentsAsync());
691
var project = AddEmptyProject(workspace.
CurrentSolution
)
703
var document = await workspace.
CurrentSolution
.GetSourceGeneratedDocumentAsync(generatedDocument.Identity.DocumentId, CancellationToken.None);
719
var project = AddEmptyProject(workspace.
CurrentSolution
)
725
var documentToFreeze = workspace.
CurrentSolution
.Projects.Single().Documents.Single();
750
var project = AddEmptyProject(workspace.
CurrentSolution
)
779
var project = AddEmptyProject(workspace.
CurrentSolution
)
809
var originalDocument1 = AddEmptyProject(workspace.
CurrentSolution
, name: "Project1")
847
var project = AddEmptyProject(workspace.
CurrentSolution
);
871
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
904
var solution = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference).Solution;
929
var project = AddEmptyProject(workspace.
CurrentSolution
).AddAnalyzerReference(analyzerReference);
949
var project0 = AddEmptyProject(workspace.
CurrentSolution
);
SolutionTests\SourceGeneratorTelemetryCollectorWorkspaceServiceTests.cs (1)
31
var project = AddEmptyProject(workspace.
CurrentSolution
)
SolutionTests\TryApplyChangesTests.cs (7)
77
var project = workspace.
CurrentSolution
.Projects.Single();
90
var project = workspace.
CurrentSolution
.Projects.Single();
103
var project = workspace.
CurrentSolution
.Projects.Single();
120
var project = workspace.
CurrentSolution
.Projects.Single();
135
var project = workspace.
CurrentSolution
.Projects.Single();
150
var project = workspace.
CurrentSolution
.Projects.Single();
164
var project = workspace.
CurrentSolution
.Projects.Single();
SymbolKeyTests.cs (2)
877
document = workspace.
CurrentSolution
.GetDocument(document.Id);
924
document = workspace.
CurrentSolution
.GetDocument(document.Id);
SyntaxNodeTests.cs (1)
87
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)
73
var newSolution1 = workspace1.
CurrentSolution
.WithOptions(newSet);
78
var oldSolution2 = workspace2.
CurrentSolution
;
84
var newSolution2 = workspace2.
CurrentSolution
;
104
var newSolution1 = workspace1.
CurrentSolution
.WithOptions(newSet);
108
var oldSolution2 = workspace2.
CurrentSolution
;
113
Assert.Equal("EOLN", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
114
Assert.Equal("EOLN", workspace2.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
120
Assert.Equal("EOLN", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
121
Assert.Equal("EOLN", workspace2.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
128
Assert.Equal("NEW_LINE", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
129
Assert.Equal("NEW_LINE", workspace2.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
134
Assert.Equal("NEW_LINE", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
135
Assert.Equal("NEW_LINE", workspace2.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
139
Assert.Equal("NEW_LINE2", workspace1.
CurrentSolution
.Options.GetOption<string>(perLanguageOptionKey));
140
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 (96)
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);
CodeLens\CodeLensCallbackListener.cs (5)
64
var solution = _workspace.
CurrentSolution
;
81
var solution = _workspace.
CurrentSolution
;
107
var solution = _workspace.
CurrentSolution
;
129
var solution = _workspace.
CurrentSolution
;
229
return _workspace.
CurrentSolution
.GetDocumentAsync(documentId, includeSourceGenerated: true).AsTask();
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
115
var solution = _workspace.
CurrentSolution
;
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (4)
93
var currentSolution = _workspace.
CurrentSolution
;
193
command.Text = GetBackgroundAnalysisScope(_workspace.
CurrentSolution
, _globalOptions) switch
309
var solution = _workspace.
CurrentSolution
;
356
return _workspace.
CurrentSolution
.GetProject(projectId);
Diagnostics\VisualStudioVenusSpanMappingService.cs (1)
87
var solution = _workspace.
CurrentSolution
;
EditorConfigSettings\SettingsEditorControl.xaml.cs (1)
83
var solution = _workspace.
CurrentSolution
;
EditorConfigSettings\SettingsEditorFactory.cs (2)
84
if (!_workspace.
CurrentSolution
.Projects.Any(p => p.Language is LanguageNames.CSharp or LanguageNames.VisualBasic))
91
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)
295
var solution = workspace.
CurrentSolution
;
Implementation\HierarchyItemToProjectIdMap.cs (1)
37
var candidateProjects = _workspace.
CurrentSolution
.Projects
Implementation\VisualStudioSupportsFeatureService.cs (1)
59
return SupportsRenameWorker(workspace.
CurrentSolution
.GetRelatedDocumentIds(documentId));
Implementation\VsRefactorNotifyService.cs (1)
191
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)
165
=> _workspace.
CurrentSolution
.Projects.FirstOrDefault(proj => _workspace.GetHierarchy(proj.Id) == hierarchy);
LanguageService\AbstractCreateServicesOnTextViewConnection.cs (1)
86
else if (Workspace.
CurrentSolution
.GetProject(projectId) is Project project)
LanguageService\AbstractLanguageService`2.VsLanguageDebugInfo.cs (1)
194
var solution = _languageService.Workspace.
CurrentSolution
;
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (4)
185
=> this.Workspace.
CurrentSolution
.GetProject(projectId);
309
this.Workspace.
CurrentSolution
, _languageName, CancellationToken.None).ConfigureAwait(true);
320
return new ObjectList(ObjectListKind.Projects, flags, this, this.GetProjectListItems(this.Workspace.
CurrentSolution
, _languageName, flags));
481
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);
Packaging\PackageInstallerServiceFactory.cs (1)
480
var solution = Workspace.
CurrentSolution
;
Progression\GraphQueryManager.cs (2)
59
var solution = _workspace.
CurrentSolution
;
100
var solution = _workspace.
CurrentSolution
;
ProjectSystem\Legacy\AbstractLegacyProject.cs (1)
97
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)
296
var document = _threadingContext.JoinableTaskFactory.Run(() =>
CurrentSolution
.GetDocumentAsync(documentId, includeSourceGenerated: true).AsTask());
321
var currentSolution = this.
CurrentSolution
;
494
var originalProject =
CurrentSolution
.GetRequiredProject(projectId);
512
var parseOptionsService =
CurrentSolution
.GetRequiredProject(projectId).Services.GetRequiredService<IParseOptionsChangingService>();
915
if (
CurrentSolution
.FilePath is null || documentInfo.FilePath is null)
924
var solutionDirectory = PathUtilities.GetDirectoryName(this.
CurrentSolution
.FilePath);
930
if (PathUtilities.GetDirectoryName(
CurrentSolution
.GetProject(documentInfo.Id.ProjectId)?.FilePath) == solutionDirectory)
1008
var document = this.
CurrentSolution
.GetTextDocument(documentId);
1089
var document = this.
CurrentSolution
.GetTextDocument(documentId);
1204
var textBuffer = this.
CurrentSolution
.GetTextDocument(documentId)!.GetTextSynchronously(CancellationToken.None).Container.TryGetTextBuffer();
1221
var document =
CurrentSolution
.GetRequiredDocument(documentId);
1315
return
CurrentSolution
.GetRequiredProject(documentId.ProjectId).Language switch
1589
uiContext.IsActive = this.
CurrentSolution
.Projects.Any(p => p.Language == language);
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (7)
165
if (workspace.
CurrentSolution
.ContainsDocument(documentId))
169
else if (workspace.
CurrentSolution
.ContainsAdditionalDocument(documentId))
175
Debug.Assert(workspace.
CurrentSolution
.ContainsAnalyzerConfigDocument(documentId));
208
var solution = _workspace.
CurrentSolution
;
275
var documentIds = _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(moniker);
317
var documentIds = w.
CurrentSolution
.GetDocumentIdsWithFilePath(moniker);
327
var solution = w.
CurrentSolution
;
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)
70
var documentIds = _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(moniker);
StackTraceExplorer\StackFrameViewModel.cs (2)
218
(_cachedDocument, _cachedLineNumber) = _stackExplorerService.GetDocumentAndLine(_workspace.
CurrentSolution
, _frame);
229
_definitionCache[symbolPart] = await _stackExplorerService.TryFindDefinitionAsync(_workspace.
CurrentSolution
, _frame, symbolPart, cancellationToken).ConfigureAwait(false);
SyncNamespaces\SyncNamespacesCommandHandler.cs (5)
79
visible = _workspace.
CurrentSolution
.Projects
108
var projects = _workspace.
CurrentSolution
.Projects
120
var solution = _workspace.
CurrentSolution
;
146
if (_workspace.
CurrentSolution
.GetChanges(solution).GetProjectChanges().Any())
156
oldSolution: _workspace.
CurrentSolution
,
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
224
foreach (var p in _workspace.
CurrentSolution
.Projects)
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
304
_stateDoNotAccessDirectly = new InProgressState(this, _workspace.
CurrentSolution
);
TaskList\ProjectExternalErrorReporter.cs (3)
88
var project = _workspace.
CurrentSolution
.GetProject(_projectId);
133
return _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(filePath)
318
if (workspace.
CurrentSolution
.GetDocument(documentId) is Document document &&
UnusedReferences\RemoveUnusedReferencesCommandHandler.cs (1)
182
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)
155
if (Workspace.
CurrentSolution
.ContainsDocument(ContainedDocument.Id))
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
64
var solution = visualStudioWorkspace.
CurrentSolution
;
Workspace\SourceGeneratedFileManager.cs (1)
334
var project = this.Workspace.
CurrentSolution
.GetProject(_documentIdentity.DocumentId.ProjectId);
Workspace\VisualStudioDocumentNavigationService.cs (4)
60
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
77
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
191
var solution = workspace.
CurrentSolution
;
265
var document = workspace.
CurrentSolution
.GetTextDocument(documentId);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
SemanticSearch\SemanticSearchDocumentNavigationService.cs (1)
31
Debug.Assert(documentId == SemanticSearchUtilities.GetQueryDocumentId(workspace.
CurrentSolution
));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (12)
CodeModel\AbstractFileCodeElementTests.cs (1)
51
=> GetWorkspace().
CurrentSolution
;
CodeModel\FileCodeModelTestHelpers.cs (1)
35
var project = workspace.
CurrentSolution
.Projects.Single();
DesignerAttribute\DesignerAttributeServiceTests.cs (1)
121
var document = workspace.
CurrentSolution
.GetRequiredDocument(documentId);
DocumentOutline\DocumentOutlineTestsBase.cs (1)
99
var solution = workspace.
CurrentSolution
;
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (1)
28
Assert.True(workspace.TryApplyChanges(workspace.
CurrentSolution
EditorConfigSettings\DataProvider\DataProviderTests.cs (1)
29
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");
145
workspace.
CurrentSolution
.GetProject(p.ProjectId)));
PersistentStorage\AbstractPersistentStorageTests.cs (3)
844
var location = configuration.TryGetStorageLocation(SolutionKey.ToSolutionKey(workspace.
CurrentSolution
));
985
var solution = workspace.
CurrentSolution
;
999
return workspace.
CurrentSolution
;
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)
125
Dim documents = Workspace.
CurrentSolution
.Projects.SelectMany(Function(p) p.Documents).Where(Function(d) documentNames.Contains(d.Name))
CodeModel\CodeModelTestHelpers.vb (2)
60
Dim project = workspace.
CurrentSolution
.Projects.Single()
137
Dim document = state.Workspace.
CurrentSolution
.GetDocument(cursorDocument.Id)
CodeModel\CodeModelTestState.vb (1)
91
Dim projectId = Workspace.
CurrentSolution
.ProjectIds.Single()
CodeModel\Mocks\MockVisualStudioWorkspace.vb (6)
39
SetCurrentSolutionEx(testWorkspace.
CurrentSolution
)
50
Assert.True(_workspace.TryApplyChanges(_workspace.
CurrentSolution
.WithDocumentText(documentId, newText)))
51
SetCurrentSolutionEx(_workspace.
CurrentSolution
)
56
SetCurrentSolutionEx(_workspace.
CurrentSolution
)
60
Assert.True(_workspace.TryApplyChanges(_workspace.
CurrentSolution
.RemoveDocument(documentId)))
61
SetCurrentSolutionEx(_workspace.
CurrentSolution
)
Microsoft.VisualStudio.LanguageServices.UnitTests (143)
ChangeSignature\AddParameterViewModelTests.vb (1)
301
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
461
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
CodeModel\AbstractEventCollectorTests.vb (3)
104
Dim project = workspace.
CurrentSolution
.Projects.First()
108
Dim codeDocument = workspace.
CurrentSolution
.GetDocument(workspace.Documents(0).Id)
111
Dim changeDocument = workspace.
CurrentSolution
.GetDocument(workspace.Documents(1).Id)
CodeModel\CSharp\FileCodeModelTests.vb (1)
1022
Dim changeDocument = changedWorkspace.
CurrentSolution
.GetDocument(changedWorkspace.Documents(0).Id)
CodeModel\CSharp\SyntaxNodeKeyTests.vb (2)
231
Dim project = workspace.
CurrentSolution
.Projects.First()
238
Dim document = workspace.
CurrentSolution
.GetDocument(cursorDocument.Id)
CodeModel\VisualBasic\FileCodeModelTests.vb (2)
1020
Dim changeDocument = changedworkspace.
CurrentSolution
.GetDocument(changedworkspace.Documents.First(Function(d) d.Name.Equals("File1.vb")).Id)
1036
changeDocument = changedworkspace.
CurrentSolution
.GetDocument(changedworkspace.Documents.First(Function(d) d.Name.Equals("File2.vb")).Id)
CommonControls\MemberSelectionViewModelTests.vb (1)
177
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
230
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
DebuggerIntelliSense\TestState.vb (1)
40
Dim language = Workspace.
CurrentSolution
.Projects.First().Language
Debugging\VisualBasicBreakpointResolutionServiceTests.vb (1)
28
Dim document = workspace.
CurrentSolution
.Projects.First.Documents.First
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (10)
51
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences({analyzerReference}))
60
Dim project = workspace.
CurrentSolution
.Projects.First()
79
Dim project = workspace.
CurrentSolution
.Projects.First()
97
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences({analyzerReference}))
106
Dim project = workspace.
CurrentSolution
.Projects.First()
119
Dim project = workspace.
CurrentSolution
.Projects.First()
155
Dim project = workspace.
CurrentSolution
.Projects.First()
195
Dim project = workspace.
CurrentSolution
.Projects.First()
229
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences({analyzerReference}))
234
Dim project = workspace.
CurrentSolution
.Projects.First()
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
293
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
GenerateType\GenerateTypeViewModelTests.vb (1)
841
Dim document = workspace.
CurrentSolution
.GetDocument(testDoc.Id)
GoToDefinition\GoToDefinitionApiTests.vb (1)
21
Dim solution = workspace.
CurrentSolution
Help\HelpTests.vb (1)
21
Assert.Equal(expected, Await service.GetHelpTermAsync(workspace.
CurrentSolution
.Projects.First().Documents.First(), workspace.Documents.First().SelectedSpans.First(), CancellationToken.None))
InheritanceMargin\InheritanceMarginViewModelTests.vb (1)
81
Dim document = workspace.
CurrentSolution
.GetDocument(testDocument.Id)
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (1)
28
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
Preview\PreviewChangesTests.vb (11)
39
Dim document = workspace.
CurrentSolution
.GetDocument(documentId)
50
workspace.
CurrentSolution
,
92
Dim document = workspace.
CurrentSolution
.GetDocument(docId)
110
workspace.
CurrentSolution
,
134
Dim document = workspace.
CurrentSolution
.GetDocument(documentId)
145
workspace.
CurrentSolution
,
187
Dim document = workspace.
CurrentSolution
.GetDocument(docId)
210
workspace.
CurrentSolution
,
270
Dim document1 = workspace.
CurrentSolution
.GetDocument(documentId1)
273
Dim document2 = workspace.
CurrentSolution
.GetDocument(documentId2)
290
workspace.
CurrentSolution
,
Progression\ProgressionTestState.vb (7)
29
Dim graphBuilder As New GraphBuilder(Workspace.
CurrentSolution
)
31
Assert.NotNull(graphBuilder.TryAddNodeForDocument(Workspace.
CurrentSolution
.GetDocument(documentId), CancellationToken.None))
37
Dim document = Workspace.
CurrentSolution
.GetDocument(hostDocument.Id)
44
Dim graphBuilder As New GraphBuilder(Workspace.
CurrentSolution
)
51
Dim graphBuilder = Await graphQuery.GetGraphAsync(Workspace.
CurrentSolution
, graphContext, CancellationToken.None)
79
Dim document = Workspace.
CurrentSolution
.GetDocument(hostDocument.Id)
84
Return 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)
25
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
44
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
63
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
86
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
109
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
129
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
149
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
168
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
188
Dim workspaceProject = environment.Workspace.
CurrentSolution
.Projects.Single()
196
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 (15)
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)
125
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences)
130
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences)
145
}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
159
}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
169
}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
179
}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
204
AssertEx.Equal({path1, path2}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
227
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences)
236
}, environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences.Select(Function(r) r.FullPath))
268
Assert.Empty(environment.Workspace.
CurrentSolution
.Projects.Single().AnalyzerReferences)
277
}, 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)
25
Dim projectInSolution = environment.Workspace.
CurrentSolution
.GetProject(project1.Id)
33
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)
249
Dim workspaceDoc = workspace.
CurrentSolution
.GetDocument(doc.Id)
RQName\RQNameTests.vb (1)
245
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)
90
Dim sourceGeneratedDocument = Assert.Single(Await workspace.
CurrentSolution
.GetProject(projectId).GetSourceGeneratedDocumentsAsync())
122
Dim expectedNames = Aggregate document In workspace.
CurrentSolution
.GetProject(projectId).AdditionalDocuments
159
workspace.OnAdditionalDocumentRemoved(workspace.
CurrentSolution
.GetProject(projectId).AdditionalDocumentIds.Single())
255
workspace.OnAdditionalDocumentTextChanged(workspace.
CurrentSolution
.Projects.Single().AdditionalDocumentIds.Single(),
Venus\AbstractContainedLanguageCodeSupportTests.vb (2)
40
Dim document = workspace.
CurrentSolution
.Projects.Single().Documents.Single()
58
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()
143
Dim startDocument = workspace.
CurrentSolution
.GetDocument(originalDocument.Id)
148
Dim results = Await codelensService.FindReferenceLocationsAsync(workspace.
CurrentSolution
, startDocument.Id, node, CancellationToken.None)
152
Dim definitionText = Await workspace.
CurrentSolution
.GetDocument(definitionDocument.Id).GetTextAsync()
183
Dim document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id)
201
Dim currentDocument = workspace.
CurrentSolution
.GetDocument(document.Id)
223
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences({analyzerReference}))
225
Dim document = workspace.
CurrentSolution
.GetDocument(workspace.Documents.First().Id)
242
workspace.
CurrentSolution
, projectId:=Nothing, documentId:=document.Id, diagnosticIds:=Nothing, shouldIncludeAnalyzer:=Nothing,
277
Dim mappedDocument = testWorkspace.
CurrentSolution
.GetDocument(mappedTestDocument.Id)
315
Dim mappedDocument = testWorkspace.
CurrentSolution
.GetDocument(mappedTestDocument.Id)
Venus\DocumentServiceTests.vb (7)
41
Dim spans = Await spanMapper.MapSpansAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), {New TextSpan(position, length:=0)}, CancellationToken.None)
65
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)
116
Dim document = Assert.IsType(Of SourceGeneratedDocument)(Await workspace.
CurrentSolution
.GetDocumentAsync(sourceGeneratedDocumentId, includeSourceGenerated:=True))
140
Dim result = Await excerptService.TryExcerptAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.SingleLine, ClassificationOptions.Default, CancellationToken.None)
179
Dim result = Await excerptService.TryExcerptAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.Tooltip, ClassificationOptions.Default, CancellationToken.None)
226
Dim result = Await excerptService.TryExcerptAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.Tooltip, ClassificationOptions.Default, CancellationToken.None)
279
Dim result = Await excerptService.TryExcerptAsync(workspace.
CurrentSolution
.GetDocument(subjectDocument.Id), GetNamedSpan(subjectDocument), ExcerptMode.SingleLine, ClassificationOptions.Default, CancellationToken.None)
VsNavInfo\VsNavInfoTests.vb (2)
829
Dim document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id)
867
Dim document = workspace.
CurrentSolution
.GetDocument(hostDocument.Id)
Microsoft.VisualStudio.LanguageServices.VisualBasic (3)
ProjectSystemShim\VisualBasicProject.vb (1)
201
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)
165
var documentId = _workspace.
CurrentSolution
.GetDocumentIdsWithFilePath(filePath).Single(d => d.ProjectId == project.Id);
169
var document = _workspace.
CurrentSolution
.GetRequiredDocument(documentId);
201
var document = _workspace.
CurrentSolution
.GetDocument(documentId);
255
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 (63)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
64
Assert.True(workspace.
CurrentSolution
.CompilationState.TryGetStateChecksums(out _));
Services\AssetProviderTests.cs (3)
74
var solution = workspace.
CurrentSolution
;
102
var solution = workspace.
CurrentSolution
;
127
var project = workspace.
CurrentSolution
.Projects.First();
Services\ServiceHubServicesTests.cs (14)
56
var solution = workspace.
CurrentSolution
;
78
var solution = workspace.
CurrentSolution
;
133
var solution = workspace.
CurrentSolution
;
184
var solution = workspace.
CurrentSolution
;
195
workspace.
CurrentSolution
,
196
workspace.
CurrentSolution
.Projects.Single().Documents.Single(),
255
var solution = workspace.
CurrentSolution
;
300
var solution = workspace.
CurrentSolution
;
320
solution = workspace.
CurrentSolution
;
334
solution = workspace.
CurrentSolution
;
768
var project = workspace.
CurrentSolution
1477
var remoteSolution = remoteWorkspace.
CurrentSolution
;
1513
solution = localWorkspace.
CurrentSolution
;
1516
var currentRemoteSolution = remoteWorkspace.
CurrentSolution
;
Services\SolutionAssetCacheTests.cs (1)
74
var solution = workspace.
CurrentSolution
;
Services\SolutionServiceTests.cs (35)
51
var solution = workspace.
CurrentSolution
;
68
var solution = workspace.
CurrentSolution
;
91
var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, workspace.
CurrentSolution
);
93
var solutionChecksum = await workspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None);
120
var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, workspace.
CurrentSolution
);
122
var solutionChecksum = await workspace.
CurrentSolution
.CompilationState.GetChecksumAsync(CancellationToken.None);
143
var solution = workspace.
CurrentSolution
;
331
var projectId = workspace.
CurrentSolution
.ProjectIds.First();
362
var projectId = workspace.
CurrentSolution
.ProjectIds.First();
395
var projectId = workspace.
CurrentSolution
.ProjectIds.First();
429
var solution1 = workspace.
CurrentSolution
;
479
Assert.Equal(remoteSolution, remoteWorkspace.
CurrentSolution
);
489
var solution = workspace.
CurrentSolution
;
509
var solution = workspace.
CurrentSolution
548
var solution = workspace.
CurrentSolution
;
589
var solution = workspace.
CurrentSolution
;
630
var solution = workspace.
CurrentSolution
;
663
var solution = workspace.
CurrentSolution
;
704
var solution = workspace.
CurrentSolution
;
744
var solution = workspace.
CurrentSolution
;
784
var solution = workspace.
CurrentSolution
;
817
var solution = workspace.
CurrentSolution
;
872
var solution = workspace.
CurrentSolution
;
918
var solution = workspace.
CurrentSolution
;
941
var solution = workspace.
CurrentSolution
;
961
solution = workspace.
CurrentSolution
;
986
var solution = workspace.
CurrentSolution
;
1005
var solution = workspace.
CurrentSolution
;
1037
var solution = workspace.
CurrentSolution
;
1075
var solution = workspace.
CurrentSolution
;
1101
var solution = workspace.
CurrentSolution
;
1128
var solution = workspace.
CurrentSolution
;
1157
var solution = workspace.
CurrentSolution
;
1204
var solution = workspace.
CurrentSolution
;
1280
var solution = workspace.
CurrentSolution
;
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (9)
50
var analyzerResult = await AnalyzeAsync(workspace, workspace.
CurrentSolution
.ProjectIds.First(), analyzerType, isHostAnalyzer);
58
analyzerResult = await AnalyzeAsync(workspace, workspace.
CurrentSolution
.ProjectIds.First(), analyzerType, isHostAnalyzer);
81
var analyzerResult = await AnalyzeAsync(workspace, workspace.
CurrentSolution
.ProjectIds.First(), analyzerType, isHostAnalyzer);
97
analyzerResult = await AnalyzeAsync(workspace, workspace.
CurrentSolution
.ProjectIds.First(), analyzerType, isHostAnalyzer);
119
var task = Task.Run(() => AnalyzeAsync(workspace, workspace.
CurrentSolution
.ProjectIds.First(), analyzerType, isHostAnalyzer: false, source.Token));
153
workspace.TryApplyChanges(workspace.
CurrentSolution
.WithAnalyzerReferences([analyzerReference]));
158
var project = workspace.
CurrentSolution
.Projects.First();
196
var project = workspace.
CurrentSolution
.Projects.First().AddAnalyzerReference(analyzerReference);
223
var solution = workspace.
CurrentSolution
;