592 references to Documents
AnalyzerRunner (2)
CodeRefactoringRunner.cs (1)
58
foreach (var document in project.
Documents
)
Program.cs (1)
192
Parallel.ForEach(projects.SelectMany(project => project.
Documents
), document =>
IdeBenchmarks (4)
InheritanceMargin\BenchmarksHelpers.cs (1)
25
foreach (var document in project.
Documents
)
Lsp\LspCompletionSerializationBenchmarks.cs (1)
116
var document = testServer.GetCurrentSolution().Projects.First().
Documents
.First();
Lsp\LspSourceGeneratorBenchmarks.cs (1)
78
var document = _testServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
SQLitePersistentStorageBenchmark.cs (1)
71
_document = _workspace.CurrentSolution.Projects.Single().
Documents
.Single();
IdeCoreBenchmarks (7)
ClassificationBenchmarks.cs (1)
95
foreach (var document in project.
Documents
)
NavigateToBenchmarks.cs (5)
84
var docCount = _workspace.CurrentSolution.Projects.SelectMany(p => p.
Documents
).Count();
111
foreach (var document in project.
Documents
)
145
foreach (var document in project.
Documents
)
164
var tasks = project.
Documents
.Select(d => Task.Run(
189
var tasks = _workspace.CurrentSolution.Projects.SelectMany(p => p.
Documents
).Select(d => Task.Run(
ProjectOperationBenchmarks.cs (1)
96
foreach (var _ in Project.
Documents
)
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
105
var details = new FixDetails(method, invocationOp, invocationDoc.Project.DefaultNamespace, invocationDoc.Project.
Documents
);
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
76
foreach (var doc in proj.
Documents
)
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
76
foreach (var doc in proj.
Documents
)
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
96
foreach (var document in projects.SelectMany(p => p.
Documents
))
DiagnosticVerifier.cs (1)
142
var documents = project.
Documents
.ToArray();
Microsoft.AspNetCore.App.Analyzers.Test (3)
TestDiagnosticAnalyzer.cs (3)
32
var doc = project.Solution.GetDocument(project.
Documents
.First().Id);
49
var doc = project.Solution.GetDocument(project.
Documents
.First().Id);
71
var document = project.Solution.GetDocument(project.
Documents
.First().Id);
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Helpers\DiagnosticVerifier.Helper.cs (2)
117
var documents = project.
Documents
.ToArray();
135
return CreateProject(new[] { source }, language).
Documents
.First();
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Helpers\DiagnosticVerifier.Helper.cs (2)
117
var documents = project.
Documents
.ToArray();
135
return CreateProject(new[] { source }, language).
Documents
.First();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (53)
Classification\SyntacticClassifierTests.cs (3)
25
var document = workspace.CurrentSolution.Projects.First().
Documents
.First();
5786
var document = workspace.CurrentSolution.Projects.First().
Documents
.First();
5816
var document = workspace.CurrentSolution.Projects.First().
Documents
.First();
CodeActions\ApplyChangesOperationTests.cs (10)
77
var document1 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program1"));
82
var document2 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program2"));
107
var document1 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program1"));
112
var document2 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program2"));
137
var document1 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program1"));
142
var document1 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program1"));
167
var document1 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program1"));
172
var document1 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program1"));
197
var document1 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program1"));
202
var document2 = solution.Projects.Single().
Documents
.Single(d => d.FilePath!.Contains("Program2"));
CodeGeneration\SyntaxGeneratorTests.cs (2)
36
var document = solution.Projects.Single().
Documents
.Single();
70
var document = solution.Projects.Single().
Documents
.Single();
Completion\CompletionServiceTests.cs (1)
212
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
Debugging\LocationInfoGetterTests.cs (1)
29
workspace.CurrentSolution.Projects.Single().
Documents
.Single(),
DecompiledSource\DecompiledSourceFormattingTests.cs (1)
242
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (7)
53
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
82
var ideEngineDocument = ideEngineWorkspace.CurrentSolution.Projects.Single().
Documents
.Single();
118
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
164
var sourceDocument = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
194
var ideEngineDocument = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
250
var ideEngineDocument = ideEngineWorkspace.CurrentSolution.Projects.Single().
Documents
.Single();
771
var document = project.
Documents
.Single();
EditAndContinue\ActiveStatementTrackingServiceTests.cs (2)
68
var document1 = project.
Documents
.Single(d => d.Name == "1.cs");
69
var document2 = project.
Documents
.Single(d => d.Name == "2.cs");
Formatting\FormattingEngineTests.cs (1)
342
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
NavigateTo\NavigateToSearcherTests.cs (5)
409
var firstDocument = project.
Documents
.Single(d => d.FilePath!.Contains("file1"));
410
var secondDocument = project.
Documents
.Single(d => d.FilePath!.Contains("file2"));
469
var firstDocument = project.
Documents
.Single(d => d.FilePath!.Contains("file1"));
470
var secondDocument = project.
Documents
.Single(d => d.FilePath!.Contains("file2"));
537
public INavigableItem.NavigableDocument Document => INavigableItem.NavigableDocument.FromDocument(workspace.CurrentSolution.Projects.Single().
Documents
.Single());
OnTheFlyDocs\OnTheFlyDocsUtilitiesTests.cs (3)
33
var document = solution.Projects.First().
Documents
.First();
69
var document = solution.Projects.First().
Documents
.First();
115
var document = solution.Projects.First().
Documents
.First();
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (1)
200
var document = workspace.CurrentSolution.Projects.First().
Documents
.First();
QuickInfo\SyntacticQuickInfoSourceTests.cs (1)
628
var document = workspace.CurrentSolution.Projects.First().
Documents
.First();
Workspaces\WorkspaceTests_EditorFeatures.cs (15)
249
var tree = await currentSnapshot.Projects.First().
Documents
.First().GetSyntaxTreeAsync();
393
Assert.Empty(workspace.CurrentSolution.Projects.Single().
Documents
);
716
var doc = solution.Projects.Single().
Documents
.First();
777
Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
798
Assert.Equal(0, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
1068
Assert.Equal(1, project.
Documents
.Count());
1092
Assert.Equal(1, project.
Documents
.Count());
1256
Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
1266
Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
1292
Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
1302
Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
1325
Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
1332
Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
1353
Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
1360
Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).
Documents
.Count());
Microsoft.CodeAnalysis.CSharp.Features (1)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
73
source: project.
Documents
,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (14)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (12)
295
var oldDocument = oldProject.
Documents
.Single();
362
var oldDocument = oldProject.
Documents
.Single();
390
var oldDocument = oldProject.
Documents
.Single();
425
var oldDocument = oldProject.
Documents
.Single();
460
var oldDocument = oldProject.
Documents
.Single();
507
var oldDocument = oldProject.
Documents
.Single();
539
var oldDocument = oldProject.
Documents
.Single();
577
var oldDocument = oldProject.
Documents
.Single();
617
var oldDocument = oldProject.
Documents
.Single();
666
Assert.Equal(2, newProject.
Documents
.Count());
712
Assert.Equal(2, newProject.
Documents
.Count());
796
var documentId = oldProject.
Documents
.Single().Id;
EnableNullable\EnableNullableTests.cs (2)
30
var document = project.
Documents
.First();
46
var document = project.
Documents
.First();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (7)
BracePairs\AbstractBracePairsTests.cs (1)
30
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
Debugging\AbstractDataTipInfoGetterTests.cs (1)
67
workspace.CurrentSolution.Projects.First().
Documents
.First(),
Diagnostics\GenerateType\GenerateTypeTestState.cs (1)
57
ExistingDocument = ProjectToBeModified.
Documents
.FirstOrDefault(doc => doc.Name.Equals(existingFileName));
Formatting\AbstractNewDocumentFormattingServiceTests.cs (1)
30
var document = workspace.CurrentSolution.Projects.First().
Documents
.First();
ObsoleteSymbol\AbstractObsoleteSymbolTests.cs (1)
29
var documents = project.
Documents
.ToImmutableArray();
ReassignedVariable\AbstractReassignedVariableTests.cs (1)
28
var documents = project.
Documents
.ToImmutableArray();
SpellCheck\AbstractSpellCheckSpanTests.cs (1)
28
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (36)
CodeFixes\CodeFixServiceTests.cs (5)
59
var document = project.
Documents
.Single();
280
document = project.
Documents
.Single();
369
TextDocumentKind.Document => project.
Documents
.Single(),
749
var document = project.
Documents
.Single();
1047
sourceDocument = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
CodeGeneration\CodeGenerationTests.cs (2)
882
this.Document = Workspace.CurrentSolution.Projects.Single().
Documents
.Single();
893
var semanticModel = await workspace.CurrentSolution.Projects.Single().
Documents
.Single().GetSemanticModelAsync();
CodeRefactorings\CodeRefactoringServiceTest.cs (5)
50
var document = project.
Documents
.Single();
87
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
107
var document = project.
Documents
.Single();
263
project.
Documents
.Single(t => t.Name == "test.editorconfig"),
268
project.
Documents
.Single(t => t.Name == "test.cs"),
Completion\CompletionServiceTests.cs (1)
46
var document = project.
Documents
.Single();
Diagnostics\DiagnosticAnalyzerServiceTests.cs (10)
448
var document = project.
Documents
.Single();
560
var document = isSourceGenerated ? (await project.GetSourceGeneratedDocumentsAsync(CancellationToken.None)).Single() : project.
Documents
.Single();
633
var document = documentAnalysis ? project.
Documents
.Single() : null;
658
var document = documentAnalysis ? project.
Documents
.Single() : null;
690
var document = documentAnalysis ? project.
Documents
.Single() : null;
720
var document = documentAnalysis ? project.
Documents
.Single() : null;
771
var document = documentAnalysis ? project.
Documents
.Single() : null;
815
var document = project.
Documents
.Single();
881
var document = project.
Documents
.Single();
918
var document = project.
Documents
.Single();
Diagnostics\DiagnosticDataTests.cs (2)
151
var document = additionalDocument.Project.
Documents
.Single();
187
var document = additionalDocument.Project.
Documents
.Single();
Formatting\InferredIndentationTests.cs (3)
26
var options = await testWorkspace.CurrentSolution.Projects.Single().
Documents
.Single().GetLineFormattingOptionsAsync(CancellationToken.None);
39
var options = await testWorkspace.CurrentSolution.Projects.Single().
Documents
.Single().GetLineFormattingOptionsAsync(CancellationToken.None);
53
var options = await testWorkspace.CurrentSolution.Projects.Single().
Documents
.Single().GetLineFormattingOptionsAsync(CancellationToken.None);
LanguageServer\VSTypeScriptHandlerTests.cs (2)
48
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
71
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (1)
103
var linkedDocument = document.Project.Solution.Projects.Single(p => p != document.Project).
Documents
.Single();
Preview\PreviewWorkspaceTests.cs (2)
80
var changedSolution = previewWorkspace.CurrentSolution.Projects.First().
Documents
.First().WithText(SourceText.From(text)).Project.Solution;
82
Assert.Equal(previewWorkspace.CurrentSolution.Projects.First().
Documents
.First().GetTextAsync().Result.ToString(), text);
SymbolFinder\SymbolFinderTests.cs (2)
648
var csDoc = csProject.
Documents
.Single();
866
solution = solution.GetProject(referencedProjectId).
Documents
.Single().WithText(SourceText.From(code.Replace('0', '1')))
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
43
var csDocument = solution.Projects.Single(p => p.Language == LanguageNames.CSharp).
Documents
.Single();
Microsoft.CodeAnalysis.ExternalAccess.HotReload.UnitTests (1)
HotReloadMSBuildWorkspaceTests.cs (1)
108
Assert.Equal(["A", "B"], project2.
Documents
.Select(d => d.Name));
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
Internal\DescriptionService.cs (1)
54
var codeDocument = project.
Documents
.FirstOrDefault();
Microsoft.CodeAnalysis.Features (15)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (1)
63
document.Project.
Documents
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (2)
55
foreach (var document in project.
Documents
)
77
foreach (var document in project.
Documents
)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
76
foreach (var document in _project.
Documents
)
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
164
foreach (var document in project.
Documents
)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
181
foreach (var document in project.
Documents
)
Completion\Providers\ImportCompletionProvider\ExtensionMemberImportCompletionHelper.cs (1)
251
foreach (var document in project.
Documents
)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
491
foreach (var document in project.
Documents
)
Diagnostics\Service\DiagnosticAnalyzerService_ComputeDiagnosticAnalysisResults.cs (1)
129
foreach (var textDocument in project.AdditionalDocuments.Concat(project.
Documents
))
ExternalAccess\UnitTesting\API\UnitTestingSearchHelpers.cs (1)
174
var streams = project.
Documents
.SelectAsArray(d => GetSourceLocationsInProcessAsync(d, comparer, container, symbolName, symbolArity, query, cancellationToken));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
547
foreach (var document in project.
Documents
)
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
79
var documentKeys = projects.SelectManyAsArray(p => p.
Documents
.Select(DocumentKey.ToDocumentKey));
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
220
Prioritize(project.
Documents
, highPriDocs.Contains),
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
277
var firstDocument = navigateProject.
Documents
.First(d => d.FilePath?.Equals(firstDocumentFilePath, StringComparison.OrdinalIgnoreCase) ?? false);
StackTraceExplorer\StackTraceExplorerService.cs (1)
104
var allDocuments = project.
Documents
.Concat(project.AdditionalDocuments);
Microsoft.CodeAnalysis.Features.Test.Utilities (7)
EditAndContinue\EditAndContinueTestVerifier.cs (4)
155
var oldDocuments = oldProject.
Documents
.ToArray();
156
var newDocuments = newProject.
Documents
.ToArray();
517
foreach (var oldDocument in oldProject.
Documents
)
586
foreach (var document in project.
Documents
)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (2)
94
return (solution, solution.Projects.Single().
Documents
.Single());
299
project.
Documents
.Select(d => (d.GetTextSynchronously(CancellationToken.None), d.FilePath ?? throw ExceptionUtilities.UnexpectedValue(null))),
SolutionExplorer\AbstractSolutionExplorerSymbolTreeItemProviderTests.cs (1)
26
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
Microsoft.CodeAnalysis.Features.UnitTests (46)
EditAndContinue\ActiveStatementsMapTests.cs (3)
123
var document = project.
Documents
.Single();
180
var document = project.
Documents
.Single();
233
var document = project.
Documents
.Single();
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (32)
263
var document1 = solution.Projects.Single().
Documents
.Single();
351
var document1 = solution.Projects.Single().
Documents
.Single();
1450
var document1 = solution.Projects.Single().
Documents
.Single();
1489
var document1 = solution.Projects.Single().
Documents
.Single();
1658
var document1 = solution.Projects.Single().
Documents
.Single();
1796
var document1 = solution.Projects.Single().
Documents
.Single();
1940
var document2 = solution.Projects.Single().
Documents
.Single();
1984
var document2 = solution.Projects.Single().
Documents
.Single();
2144
var document1 = solution.Projects.Single().
Documents
.Single();
2146
var document2 = solution.Projects.Single().
Documents
.Single();
2276
var documentC = projectC.
Documents
.Single(d => d.Name == "C.cs");
2805
var documentId = solution.Projects.Single().
Documents
.Single().Id;
2953
var documentId = solution.Projects.Single().
Documents
.Single().Id;
2965
var document2 = solution.Projects.Single().
Documents
.Single();
2992
var documentId = solution.Projects.Single().
Documents
.Single().Id;
3004
var document2 = solution.Projects.Single().
Documents
.Single();
3035
var document1 = solution.Projects.Single().
Documents
.Single();
3037
var document2 = solution.Projects.Single().
Documents
.Single();
3148
var document3 = solution.Projects.Single().
Documents
.Single();
3201
var document3 = solution.Projects.Single().
Documents
.Single();
3351
var document3 = solution.Projects.Single().
Documents
.Single();
3627
var documentA = project.
Documents
.First();
3628
var documentB = project.
Documents
.Skip(1).First();
4239
var documentId = solution.Projects.Single().
Documents
.Single().Id;
4251
var document2 = solution.Projects.Single().
Documents
.Single();
4318
solution = solution.WithDocumentText(projectA.
Documents
.Single().Id, CreateText(source2));
4319
solution = solution.WithDocumentText(projectB.
Documents
.Single().Id, CreateText(source2));
4366
solution = solution.WithDocumentText(projectA.
Documents
.Single().Id, CreateText(source3));
4367
solution = solution.WithDocumentText(projectB.
Documents
.Single().Id, CreateText(source3));
4636
var document1 = solution.Projects.Single().
Documents
.Single();
4878
var documents = solution.Projects.Single().
Documents
;
4981
var document = project.
Documents
.Single();
EditAndContinue\EditSessionActiveStatementsTests.cs (5)
184
var document1 = project.
Documents
.Single(d => d.Name == "test1.cs");
185
var document2 = project.
Documents
.Single(d => d.Name == "test2.cs");
349
var document = project.
Documents
.Single();
529
var document = project.
Documents
.Single();
670
var document = project.
Documents
.Single();
FindUsages\DefinitionItemFactoryTests.cs (6)
930
var document = project.
Documents
.Single();
1335
var document = project.
Documents
.Single();
1395
var document = project.
Documents
.Single();
1446
var document = project.
Documents
.Single();
1510
var document = project.
Documents
.Single();
1581
var document = project.
Documents
.Single();
Microsoft.CodeAnalysis.LanguageServer (2)
FileBasedPrograms\CanonicalMiscFilesProjectLoader.cs (2)
227
var document = solution.GetRequiredProject(primordial.PrimordialProjectId).
Documents
.Single();
273
documents: [newDocumentInfo, .. await Task.WhenAll(canonicalProject.
Documents
.Select(document => GetDocumentInfoAsync(document, document.FilePath)))],
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
ExternalAccess\Razor\FormatNewFileHandler.cs (1)
74
var hintDocument = project.
Documents
.FirstOrDefault();
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDocumentsAndProjectDiagnosticSourceProvider.cs (1)
74
AddDocumentSources(project.
Documents
);
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (1)
73
var documents = project.
Documents
;
Handler\Tasks\WorkspaceTaskDiagnosticSourceProvider.cs (1)
38
foreach (var document in project.
Documents
)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (147)
CodeActions\RunCodeActionsTests.cs (1)
49
var documentForB = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(doc => doc.Name.Equals("B.cs", StringComparison.OrdinalIgnoreCase));
CodeLens\AbstractCodeLensTests.cs (3)
24
var textDocument = CreateTextDocumentIdentifier(testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single().GetURI());
59
var textDocument = CreateTextDocumentIdentifier(testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single().GetURI());
82
var textDocument = CreateTextDocumentIdentifier(testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single().GetURI());
CodeLens\CSharpCodeLensTests.cs (1)
430
var documentUri = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single().GetURI();
Completion\CompletionFeaturesTests.cs (15)
92
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
126
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
213
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
277
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
342
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
419
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
469
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
538
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
663
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
707
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
770
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
804
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
858
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
972
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
1041
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
Completion\CompletionResolveTests.cs (1)
195
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
Completion\CompletionTests.cs (18)
93
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
146
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
181
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
216
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
256
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
286
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
370
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
433
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
466
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
494
var document = solution.Projects.First().
Documents
.First();
533
var document = solution.Projects.First().
Documents
.First();
572
var document = solution.Projects.First().
Documents
.First();
632
var document = solution.Projects.First().
Documents
.First();
730
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
763
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
793
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
821
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
1506
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
Diagnostics\DiagnosticsPullCacheTests.cs (3)
35
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
65
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
96
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
Diagnostics\NonLocalDiagnosticTests.cs (1)
36
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.First();
Diagnostics\PullDiagnosticTests.cs (48)
45
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
76
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
96
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
178
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
195
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
218
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
236
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
250
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
278
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
301
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
328
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
348
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
376
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
393
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
426
var csproj1Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj1").Single().
Documents
.First();
427
var csproj2Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj2").Single().
Documents
.First();
479
var csproj1Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj1").Single().
Documents
.First();
480
var csproj2Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj2").Single().
Documents
.First();
538
var csproj1Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj1").Single().
Documents
.First();
539
var csproj2Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj2").Single().
Documents
.First();
590
var csproj1Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj1").Single().
Documents
.First();
591
var csproj2Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj2").Single().
Documents
.First();
620
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
640
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
669
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
751
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
786
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
826
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
855
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
896
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
922
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
944
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
971
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
1260
var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single();
1300
var openDocument = project.
Documents
.First();
1301
var closedDocument = project.
Documents
.Skip(1).First();
1400
var firstDocument = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.First();
1415
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
1463
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
1646
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.First();
1732
var csproj2Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj2").Single().
Documents
.First();
1814
var csproj3Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj3").Single().
Documents
.First();
1888
var csproj2Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj2").Single().
Documents
.First();
1956
var csproj2Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj2").Single().
Documents
.First();
2019
var csproj2Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj2").Single().
Documents
.First();
2075
var csproj2Document = testLspServer.GetCurrentSolution().Projects.Where(p => p.Name == "CSProj2").Single().
Documents
.First();
2152
var uri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First().GetURI();
2240
var uri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First().GetURI();
DocumentChanges\DocumentChangesTests.LinkedDocuments.cs (2)
41
foreach (var document in solution.Projects.First().
Documents
)
86
foreach (var document in solution.Projects.First().
Documents
)
DocumentChanges\DocumentChangesTests.WithFindAllReferences.cs (1)
39
var originalDocument = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
FoldingRanges\FoldingRangesTests.cs (1)
162
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
InlayHint\AbstractInlayHintTests.cs (1)
25
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
InlayHint\CSharpInlayHintTests.cs (1)
112
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
MapCode\MapCodeTests.cs (1)
96
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
Metadata\LspMetadataAsSourceWorkspaceTests.cs (1)
128
var docs = await testLspServer.GetManagerAccessor().GetMiscellaneousDocumentsAsync(static p => p.
Documents
).ToImmutableArrayAsync(CancellationToken.None);
Options\SolutionAnalyzerConfigOptionsUpdaterTests.cs (2)
174
var treeWithConfig = projectWithConfig.
Documents
.Single().GetSyntaxTreeSynchronously(CancellationToken.None);
213
var treeWithoutConfig = projectWithoutConfig.
Documents
.Single().GetSyntaxTreeSynchronously(CancellationToken.None);
SemanticTokens\AbstractSemanticTokensTests.cs (1)
77
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
SemanticTokens\SemanticTokensRangeTests.cs (6)
121
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
181
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
233
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
294
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
377
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
488
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
SpellCheck\SpellCheckTests.cs (16)
39
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
58
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
89
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
121
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
159
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
194
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
211
document = lspSolution!.Projects.Single().
Documents
.Single();
243
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
282
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
308
var document = testLspServer.GetCurrentSolution().Projects.Single().
Documents
.Single();
343
var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.First();
420
var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.First();
460
var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.First();
498
var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.First();
514
document = lspSolution!.Projects.Single().
Documents
.First();
554
var document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.First();
Symbols\DocumentSymbolsTests.cs (1)
104
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
UriTests.cs (2)
104
var workspaceDocument = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single();
137
var fileDocumentUri = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single().GetURI();
Workspaces\LspWorkspaceManagerTests.cs (18)
31
var documentUri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First().GetURI();
58
var firstDocumentUri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.Single(d => d.FilePath!.Contains("test1")).GetURI();
59
var secondDocumentUri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.Single(d => d.FilePath!.Contains("test2")).GetURI();
110
var firstDocumentUri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.Single(d => d.FilePath!.Contains("test1")).GetURI();
112
var secondDocument = testLspServer.GetCurrentSolution().Projects.First().
Documents
.Single(d => d.FilePath!.Contains("test2"));
148
var documentUri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.Single(d => d.FilePath!.Contains("test1")).GetURI();
172
var documentUri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.Single(d => d.FilePath!.Contains("test1")).GetURI();
214
var documentUri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.Single(d => d.FilePath!.Contains("test1")).GetURI();
440
var documentUri = testWorkspace.CurrentSolution.Projects.First().
Documents
.First().GetURI();
476
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
477
var documentUri = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First().GetURI();
522
(await testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single().GetTextAsync()).ToString());
535
(await testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single().GetTextAsync()).ToString());
538
Assert.Empty(await testLspServer.GetManagerAccessor().GetMiscellaneousDocumentsAsync(static p => p.
Documents
).ToImmutableArrayAsync(CancellationToken.None));
561
var documentUri = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single().GetURI();
576
document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single();
585
document = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single();
600
var documentUri = testLspServer.TestWorkspace.CurrentSolution.Projects.Single().
Documents
.Single().GetURI();
Workspaces\SourceGeneratedDocumentTests.cs (2)
280
initialSolution.Projects.Single().
Documents
.Single().Id,
382
var document = testLspServer.GetCurrentSolution().Projects.First().
Documents
.First();
Microsoft.CodeAnalysis.LanguageServer.UnitTests (20)
FileBasedProgramsWorkspaceTests.cs (19)
69
return workspaceFactory.HostWorkspace.CurrentSolution.GetRequiredProject(project.Id).
Documents
.Single();
98
Assert.Equal(1, looseDocumentOne.Project.
Documents
.Count());
109
Assert.Contains(canonicalDocumentOne.Project.
Documents
, d => d.Name == "Canonical.AssemblyInfo.cs");
125
Assert.DoesNotContain(canonicalDocumentTwo.Project.
Documents
, d => d.Name == looseDocumentOne.Name);
129
Assert.Contains(canonicalDocumentTwo.Project.
Documents
, d => d.Name == "Canonical.AssemblyInfo.cs");
147
Assert.Equal(1, primordialDocument.Project.
Documents
.Count());
163
Assert.Contains(canonicalDocument.Project.
Documents
, d => d.Name == "Canonical.AssemblyInfo.cs");
193
Assert.Equal(1, document.Project.
Documents
.Count());
219
Assert.Equal(1, looseDocumentOne.Project.
Documents
.Count());
231
Assert.Contains(canonicalDocumentOne.Project.
Documents
, d => d.Name == "Canonical.AssemblyInfo.cs");
283
Assert.Single(looseDocument.Project.
Documents
);
318
Assert.Equal(1, looseDocumentOne.Project.
Documents
.Count());
330
Assert.Contains(canonicalDocumentOne.Project.
Documents
, d => d.Name == "Canonical.AssemblyInfo.cs");
350
Assert.Equal(1, document.Project.
Documents
.Count());
490
Assert.Equal(1, document.Project.
Documents
.Count());
516
Assert.Equal(1, looseDocumentOne.Project.
Documents
.Count());
528
Assert.Contains(canonicalDocumentOne.Project.
Documents
, d => d.Name == "Canonical.AssemblyInfo.cs");
559
Assert.Contains(fullFileBasedDocumentOne!.Project.
Documents
, d => d.Name == "SomeFile.AssemblyInfo.cs");
584
Assert.Contains(canonicalDocument.Project.
Documents
, d => d.Name == "Canonical.AssemblyInfo.cs");
WorkspaceProjectFactoryServiceTests.cs (1)
52
var document = Assert.Single(project.
Documents
);
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\TestUtils.cs (1)
236
foreach (var document in project.
Documents
.Concat(project.AdditionalDocuments).Concat(project.AnalyzerConfigDocuments))
Microsoft.CodeAnalysis.Workspaces (10)
CodeFixes\FixAllOccurrences\FixAllState.FixMultipleDiagnosticProvider.cs (1)
42
foreach (var document in project.
Documents
)
CodeRefactorings\FixAllOccurences\RefactorAllState.cs (2)
111
documentsToRefactor = Project.
Documents
;
115
documentsToRefactor = Project.Solution.Projects.SelectMany(p => p.
Documents
);
Diagnostics\DiagnosticData.cs (1)
218
document = project.
Documents
.FirstOrDefault(d => d.FilePath == diagnostic.Location.GetLineSpan().Path);
Rename\Renamer.RenameDocumentActionSet.cs (1)
141
return project.
Documents
.FirstOrDefault(d => d.Name == _documentName && d.Folders.SequenceEqual(_documentFolders))
Rename\RenameUtilities.cs (2)
140
return projectIdsOfRenameSymbolDeclaration.SelectMany(p => solution.GetRequiredProject(p).
Documents
);
148
return relevantProjects.SelectMany(p => solution.GetRequiredProject(p).
Documents
);
Workspace\Solution\Project.cs (2)
327
foreach (var document in this.
Documents
)
492
var results = await Task.WhenAll(this.
Documents
.Select(predicateAsync)).ConfigureAwait(false);
Workspace\Workspace.cs (1)
2028
project.
Documents
.Select(CreateDocumentInfoWithText),
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (51)
NetCoreTests.cs (10)
94
var document = project.
Documents
.First(d => d.Name == "Program.cs");
163
var document = libraryProject.
Documents
.First(d => d.Name == "Class1.cs");
203
var document = project.
Documents
.First(d => d.Name == "Program.cs");
263
var document = project.
Documents
.First(d => d.Name == "Program.cs");
375
document = project.
Documents
.First(d => d.Name == "Program.cs");
379
document = project.
Documents
.First(d => d.Name == "Class1.cs");
456
var libraryFs = fsharpLib.
Documents
.Single(d => Path.GetFileName(d.FilePath) == "Library.fs");
520
Assert.Contains(fsharpProj.
Documents
, d => Path.GetFileName(d.FilePath) == "Library.fs");
526
Assert.Contains(csharpProj.
Documents
, d => Path.GetFileName(d.FilePath) == "Class1.cs");
638
var document = project.
Documents
.First(d => d.Name == "Program.vb");
VisualStudioMSBuildWorkspaceTests.cs (41)
65
var document = project.
Documents
.First();
289
Assert.All(project.
Documents
, d => Assert.Equal(SourceHashAlgorithm.Sha1, d.GetTextSynchronously(default).ChecksumAlgorithm));
307
Assert.All(project.
Documents
, d => Assert.Equal(SourceHashAlgorithms.Default, d.GetTextSynchronously(default).ChecksumAlgorithm));
344
var d1 = p1.
Documents
.First();
401
var document = project.
Documents
.First();
444
var document = project.
Documents
.First();
465
var document = project.
Documents
.First();
483
var document = project.
Documents
.First();
597
Assert.NotEmpty(project.
Documents
);
610
Assert.NotEmpty(project.
Documents
);
769
var documents = project.
Documents
.ToList();
851
var documents = project.
Documents
.Where(d => d.Name == "CSharpClass.cs").ToList();
894
], project.
Documents
.Select(d => d.Name));
917
var document = project.
Documents
.First();
936
var document = project.
Documents
.First();
978
var doc = solution.Projects.First().
Documents
.First(d => d.FilePath == sourceFile);
1012
var doc = solution.Projects.First().
Documents
.First(d => d.FilePath == sourceFile);
1181
], project.
Documents
.Select(d => d.Name));
1971
var documents = project.
Documents
.ToList();
1999
var documents = project2.
Documents
.ToList();
2018
var documentsB = projectB.
Documents
.ToList();
2033
var document = project.
Documents
.Single(d => d.Name == "CSharpClass.cs");
2042
var documents = project2.
Documents
.ToList();
2067
var document = project.
Documents
.Single(d => d.Name == "CSharpClass.cs");
2075
Assert.DoesNotContain(project2.
Documents
, d => d.Name == "CSharpClass.cs");
2093
var documents = solution.GetProjectsByName("CSharpProject").FirstOrDefault().
Documents
.ToList();
2217
var doc = workspace.CurrentSolution.Projects.First().
Documents
.First();
2247
var doc = workspace.CurrentSolution.Projects.First().
Documents
.First();
2349
var document = project.
Documents
.Single(d => d.Name == "CSharpClass.cs");
2369
var doc = proj.
Documents
.First();
2769
var document = project.
Documents
.First(d => d.Name == "class1.cs");
2788
var document = project.
Documents
.First(d => d.Name == "class1.cs");
2807
var document = project.
Documents
.First(d => d.Name == "class1.cs");
2822
var document = project.GetObjectReference(static p => p.
Documents
.First());
2858
var document = project.
Documents
.First(d => d.Name == "class1.cs");
2970
var docs = proj.
Documents
.ToList();
3087
Assert.Contains(proj.
Documents
, d => d.Name == "AssemblyInfo.cs");
3314
var document = project.
Documents
.First(d => d.Name == "class1.cs");
3333
var document = project.
Documents
.Single(d => d.Name == "MyClass.cs");
3346
var linkedDocument = project.
Documents
.Single(d => d.Name == "Foo.cs");
3359
var linkedDocument = project.
Documents
.Single(d => d.Name == "MyClass.cs");
Microsoft.CodeAnalysis.Workspaces.UnitTests (56)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (5)
36
Assert.Equal(1, project.
Documents
.Count());
38
var gooDoc = project.
Documents
.First(d => d.Name == "CSharpClass.cs");
64
Assert.Equal(2, project.
Documents
.Count());
66
var gooDoc = project.
Documents
.First(d => d.Name == "goo.cs");
70
var barDoc = project.
Documents
.First(d => d.Name == "bar.cs");
SolutionTests\SolutionTests.cs (33)
2892
Assert.Empty(finalProject.
Documents
);
2911
Assert.All(solution.Projects, p => Assert.Single(p.
Documents
));
2915
Assert.All(solution.Projects, p => Assert.Empty(p.
Documents
));
3072
var docs = project.
Documents
.ToList();
4474
var frozenDocument = project.
Documents
.Single().WithFrozenPartialSemantics(CancellationToken.None);
4488
var frozenDocument = project.
Documents
.First().WithFrozenPartialSemantics(CancellationToken.None);
4490
Assert.Single(frozenDocument.Project.
Documents
);
4507
var frozenDocument = forkedProject.
Documents
.Single().WithFrozenPartialSemantics(CancellationToken.None);
4513
Assert.Equal(2, frozenDocument.Project.
Documents
.Count());
4516
Assert.True(frozenCompilation.ContainsSyntaxTree(await originalProject.
Documents
.Single().GetSyntaxTreeAsync()));
4531
var frozenDocument = forkedProject.
Documents
.Single().WithFrozenPartialSemantics(CancellationToken.None);
4541
Assert.Equal(2, frozenDocument.Project.
Documents
.Count());
4544
Assert.True(frozenCompilation.ContainsSyntaxTree(await originalProject.
Documents
.Single().GetSyntaxTreeAsync()));
5797
Assert.Empty(frozenProject.
Documents
);
5816
Assert.Single(frozenProject.
Documents
);
5820
Assert.True(frozenCompilation.ContainsSyntaxTree(await frozenProject.
Documents
.Single().GetSyntaxTreeAsync()));
5838
Assert.Single(frozenProject1.
Documents
);
5841
Assert.Empty(frozenProject2.
Documents
);
5845
Assert.True(frozenCompilation1.ContainsSyntaxTree(await frozenProject1.
Documents
.Single().GetSyntaxTreeAsync()));
5868
Assert.Single(frozenProject1.
Documents
);
5872
Assert.True(frozenCompilation1.ContainsSyntaxTree(await frozenProject1.
Documents
.Single().GetSyntaxTreeAsync()));
5875
Assert.Empty(frozenProject2.
Documents
);
5898
Assert.Single(frozenProject1.
Documents
);
5902
Assert.True(frozenCompilation1.ContainsSyntaxTree(await frozenProject1.
Documents
.Single().GetSyntaxTreeAsync()));
5905
Assert.Single(frozenProject2.
Documents
);
5909
Assert.True(frozenCompilation2.ContainsSyntaxTree(await frozenProject2.
Documents
.Single().GetSyntaxTreeAsync()));
5924
var syntaxTree1 = await project1.
Documents
.Single().GetSyntaxTreeAsync();
5928
var forkedProject1 = frozenSolution.WithDocumentText(project1.
Documents
.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id);
5929
var forkedDocument1 = forkedProject1.
Documents
.Single();
5957
var syntaxTree1 = await project1.
Documents
.Single().GetSyntaxTreeAsync();
5967
var forkedProject1 = frozenSolution.WithDocumentText(project1.
Documents
.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id);
5968
var forkedDocument1 = forkedProject1.
Documents
.Single();
6001
Assert.Single(frozenProject.
Documents
);
SolutionTests\SolutionWithSourceGeneratorTests.cs (10)
347
var partialProject = project.
Documents
.Single().WithFrozenPartialSemantics(forceFreeze, CancellationToken.None).Project;
467
project = project.
Documents
.Single(d => d.Name == "RegularDocument.cs").WithFrozenPartialSemantics(CancellationToken.None).Project;
489
project = project.
Documents
.Single().WithText(SourceText.From("// Change")).Project;
565
var existingText = await project.
Documents
.Single().GetTextAsync();
567
project = project.
Documents
.Single().WithText(newText).Project;
725
var documentToFreeze = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
760
var document = project.
Documents
.Single().WithFrozenPartialSemantics(forceFreeze: true, CancellationToken.None);
789
var document = project.
Documents
.Single().WithFrozenPartialSemantics(CancellationToken.None);
996
var ordinaryDocument = project.
Documents
.First();
1580
Assert.Equal(2, finalSolution.Projects.Single().
Documents
.Count());
SyntaxReferenceTests.cs (6)
55
var tree = await solution.Projects.First().
Documents
.First().GetRequiredSyntaxTreeAsync(CancellationToken.None);
77
var tree = await solution.Projects.First().
Documents
.First().GetRequiredSyntaxTreeAsync(CancellationToken.None);
101
var tree = await solution.Projects.First().
Documents
.First().GetRequiredSyntaxTreeAsync(CancellationToken.None);
124
var tree = await solution.Projects.First().
Documents
.First().GetRequiredSyntaxTreeAsync(CancellationToken.None);
148
var tree = await solution.Projects.First().
Documents
.First().GetRequiredSyntaxTreeAsync(CancellationToken.None);
175
var tree = await solution.Projects.First().
Documents
.First().GetRequiredSyntaxTreeAsync(CancellationToken.None);
WorkspaceTests\AdhocWorkspaceTests.cs (2)
178
Assert.Equal(1, proj.
Documents
.Count());
180
var doc = proj.
Documents
.First();
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
100
foreach (var doc in proj.
Documents
)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
100
foreach (var doc in proj.
Documents
)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
100
foreach (var doc in proj.
Documents
)
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
100
foreach (var doc in proj.
Documents
)
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
100
foreach (var doc in proj.
Documents
)
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
100
foreach (var doc in proj.
Documents
)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
100
foreach (var doc in proj.
Documents
)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
55
project.
Documents
.FirstOrDefault(IsPropertiesAssemblyInfo) ??
Microsoft.VisualStudio.LanguageServices (9)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
129
return ImmutableHashSet.CreateRange<Document>(currentProject.
Documents
);
CodeCleanup\AbstractCodeCleanUpFixer.cs (1)
215
source: project.
Documents
,
GenerateType\GenerateTypeDialogViewModel.cs (5)
357
if (this.SelectedProject.
Documents
.Where(n => n != null).Where(n => n.FilePath == FullFilePath).Any() ||
359
this.SelectedProject.
Documents
.Where(n => n.Name != null && n.Folders.Count > 0 && n.Name == this.FileName && this.Folders.SequenceEqual(n.Folders)).Any()) ||
493
_previouslyPopulatedDocumentList.AddRange(_document.Project.
Documents
499
_previouslyPopulatedDocumentList.AddRange(SelectedProject.
Documents
503
this.SelectedDocument = SelectedProject.
Documents
.FirstOrDefault();
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
303
foreach (var document in project.
Documents
)
Venus\ContainedDocument.cs (1)
184
foreach (var document in _workspace.CurrentSolution.GetProject(_project.Id).
Documents
)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (40)
CodeModel\AbstractFileCodeElementTests.cs (1)
57
=> GetCurrentProject().
Documents
.Single();
CodeModel\FileCodeModelTestHelpers.cs (1)
37
var document = project.
Documents
.Single().Id;
F1Help\F1HelpTests.cs (1)
30
var actualText = await service.GetHelpTermAsync(workspace.CurrentSolution.Projects.First().
Documents
.First(), workspace.Documents.First().SelectedSpans.First(), CancellationToken.None);
Interactive\Commands\ResetInteractiveTests.cs (1)
52
var document = project.
Documents
.FirstOrDefault(d => d.FilePath == "ResetInteractiveTestsDocument");
PersistentStorage\AbstractPersistentStorageTests.cs (22)
120
var document = project.
Documents
.First();
239
var document = solution.Projects.Single().
Documents
.Single();
287
DoSimultaneousWrites(s => storage.WriteStreamAsync(solution.Projects.Single().
Documents
.Single(), streamName1, EncodeString(s)));
288
var value = int.Parse(ReadStringToEnd(await storage.ReadStreamAsync(solution.Projects.Single().
Documents
.Single(), streamName1)));
326
Assert.True(await storage.WriteStreamAsync(solution.Projects.Single().
Documents
.Single(), streamName1, EncodeString(GetData1(size)), GetChecksum1(withChecksum)));
327
DoSimultaneousReads(async () => ReadStringToEnd(await storage.ReadStreamAsync(solution.Projects.Single().
Documents
.Single(), streamName1, GetChecksum1(withChecksum))), GetData1(size));
480
var document = solution.Projects.Single().
Documents
.Single();
501
var document = solution.Projects.Single().
Documents
.Single();
522
var document = solution.Projects.Single().
Documents
.Single();
543
var document = solution.Projects.Single().
Documents
.Single();
564
var document = solution.Projects.Single().
Documents
.Single();
588
var document = solution.Projects.Single().
Documents
.Single();
612
var document = solution.Projects.Single().
Documents
.Single();
636
var document = solution.Projects.Single().
Documents
.Single();
660
var document = solution.Projects.Single().
Documents
.Single();
681
var document = solution.Projects.Single().
Documents
.Single();
702
var document = solution.Projects.Single().
Documents
.Single();
723
var document = solution.Projects.Single().
Documents
.Single();
744
var document = solution.Projects.Single().
Documents
.Single();
768
var document = solution.Projects.Single().
Documents
.Single();
792
var document = solution.Projects.Single().
Documents
.Single();
816
var document = solution.Projects.Single().
Documents
.Single();
ProjectSystemShim\CPS\SourceFileHandlingTests.cs (9)
31
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().
Documents
;
68
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().
Documents
;
118
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().
Documents
;
160
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().
Documents
;
214
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().
Documents
;
253
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().
Documents
;
292
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().
Documents
;
326
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().
Documents
;
372
IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().
Documents
;
ProjectSystemShim\LegacyProject\SourceFileHandlingTests.cs (5)
29
Assert.Empty(environment.Workspace.CurrentSolution.Projects.Single().
Documents
);
43
var document = environment.Workspace.CurrentSolution.Projects.Single().
Documents
.Single();
56
var document = environment.Workspace.CurrentSolution.Projects.Single().
Documents
.Single();
70
var document = environment.Workspace.CurrentSolution.Projects.Single().
Documents
.Single();
84
var document = environment.Workspace.CurrentSolution.Projects.Single().
Documents
.Single();
Microsoft.VisualStudio.LanguageServices.Implementation (1)
ProjectSystem\CPS\TempPECompiler.cs (1)
48
foreach (var document in project.
Documents
)
Microsoft.VisualStudio.LanguageServices.LiveShare (2)
ProjectsHandler.cs (2)
29
foreach (var sourceFile in project.
Documents
)
46
SourceFiles = [.. project.
Documents
.Select(d => requestContext.ProtocolConverter.ToProtocolUri(new Uri(d.FilePath)))],
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\WorkspacePanel.xaml.cs (1)
82
from document in project.
Documents
Roslyn.VisualStudio.Next.UnitTests (34)
Services\ServiceHubServicesTests.cs (7)
103
var oldDocument = solution.Projects.First().
Documents
.First();
164
var priorityDocumentId = solution.Projects.Single().
Documents
.Single().Id;
176
Assert.Equal(solution.Projects.Single().
Documents
.Single().Id, info.DocumentId);
214
workspace.CurrentSolution.Projects.Single().
Documents
.Single(),
1929
var document = workspace.CurrentSolution.Projects.Single().
Documents
.Single();
2066
var document = project.
Documents
.First(d => string.Equals(d.Name, documentName, StringComparison.OrdinalIgnoreCase));
2075
documentName => project.
Documents
.First(d => string.Equals(d.Name, documentName, StringComparison.OrdinalIgnoreCase)));
Services\ServiceHubServicesTests_ExtensionMessageHandler.cs (12)
102
workspace.CurrentSolution.Projects.Single().
Documents
.Single(), "MessageName", "JsonMessage", CancellationToken.None);
350
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
376
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
411
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
449
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
496
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
507
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
541
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
572
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
608
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
661
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
691
localWorkspace.CurrentSolution.Projects.Single().
Documents
.Single(),
Services\SolutionServiceTests.cs (15)
292
=> VerifySolutionUpdate(@"class Test { void Method() { } }", s => s.WithDocumentFolders(s.Projects.First().
Documents
.First().Id, ["test"]));
428
var currentSolution = remoteSolution1.WithDocumentText(remoteSolution1.Projects.First().
Documents
.First().Id, SourceText.From(code + " class Test2 { }"));
437
currentSolution = oopSolution2.WithDocumentText(oopSolution2.Projects.First().
Documents
.First().Id, SourceText.From(code + " class Test3 { }"));
1022
var document1 = project1.
Documents
.Single();
1041
var document1 = project1.
Documents
.Single();
1073
var document1 = project1.
Documents
.First();
1074
var document2 = project1.
Documents
.Last();
1112
var document1 = project1.
Documents
.First();
1113
var document2 = project1.
Documents
.Last();
1114
var document3 = project2.
Documents
.Single();
1137
var document1 = project1.
Documents
.Single();
1164
var document1 = project1.
Documents
.Single();
1193
var document1 = project1.
Documents
.Single();
1240
var document1 = project1.
Documents
.First();
1241
var document2 = project1.
Documents
.Last();