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