201 references to Id
IdeBenchmarks (3)
FormatterBenchmarks.cs (2)
47
var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().
Id
);
60
var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().
Id
);
RegexClassifierBenchmarks.cs (1)
73
var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().
Id
);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (123)
Classification\SemanticClassifierTests.cs (2)
37
var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().
Id
);
3919
var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().
Id
);
Classification\TotalClassifierTests.cs (1)
35
var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().
Id
);
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
917
var documentToModifyId = workspace.Documents[0].
Id
;
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (3)
70
var oldDocumentId = oldDocument.
Id
;
158
var refDocument = workspace.Documents.Where(doc => doc.
Id
!= originalDocumentId).SingleOrDefault();
159
var refDocumentId = refDocument?.
Id
;
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
448
var document = workspace.CurrentSolution.GetRequiredDocument(hostDocument.
Id
);
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
690
var document = workspace.CurrentSolution.GetDocument(hostDocument.
Id
);
1282
var document = workspace.CurrentSolution.GetDocument(hostDocument.
Id
);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (6)
2469
var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument").
Id
;
2722
var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument2").
Id
;
2777
var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument").
Id
;
3061
var document = workspace.CurrentSolution.GetRequiredDocument(testDocument.
Id
);
3196
var document = workspace.CurrentSolution.GetRequiredDocument(testDocument.
Id
);
3250
var document = workspace.CurrentSolution.GetRequiredDocument(testDocument.
Id
);
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (2)
376
var document = workspace.CurrentSolution.GetDocument(testDocument.
Id
);
387
var currentDocument = workspace.CurrentSolution.GetDocument(testDocument.
Id
);
Completion\CompletionServiceTests.cs (2)
133
workspace.OpenDocument(testDocument.
Id
);
138
var document = workspace.CurrentSolution.GetDocument(testDocument.
Id
);
Debugging\ProximityExpressionsGetterTests.cs (1)
76
var document = workspace.CurrentSolution.GetDocument(testDocument.
Id
);
EncapsulateField\EncapsulateFieldTestState.cs (1)
35
TargetDocument = Workspace.CurrentSolution.GetDocument(_testDocument.
Id
);
ExtractMethod\ExtractMethodBase.cs (3)
118
var document = workspace.CurrentSolution.GetDocument(testDocument.
Id
);
167
var document = workspace.CurrentSolution.GetDocument(testDocument.
Id
);
190
var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().
Id
);
Formatting\CodeCleanupTests.cs (3)
818
var document = workspace.CurrentSolution.GetDocument(hostdoc.
Id
);
835
var document = workspace.CurrentSolution.GetDocument(hostdoc.
Id
);
917
var document = workspace.CurrentSolution.GetDocument(hostdoc.
Id
);
Formatting\Indentation\SmartIndenterEnterOnTokenTests.cs (2)
1405
var document = workspace.CurrentSolution.GetDocument(hostdoc.
Id
);
1446
var document = workspace.CurrentSolution.GetDocument(hostdoc.
Id
);
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (1)
3412
var document = workspace.CurrentSolution.GetDocument(testDocument.
Id
);
Intents\IntentTestsBase.cs (1)
106
var priorDocument = workspace.CurrentSolution.GetRequiredDocument(testDocument.
Id
);
LineSeparators\LineSeparatorTests.cs (1)
598
var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().
Id
);
MoveToNamespace\MoveToNamespaceTests.cs (2)
1414
var document = workspace.CurrentSolution.GetDocument(testDocument.
Id
);
1424
foreach (var id in workspace.Documents.Select(d => d.
Id
))
Organizing\AbstractOrganizerTests.cs (1)
29
var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().
Id
);
QuickInfo\SemanticQuickInfoSourceTests.cs (3)
44
var documentId = testDocument.
Id
;
121
var documentId = sourceDocument.
Id
;
273
var documentId = sourceDocument.
Id
;
Rename\CSharpInlineRenameServiceTests.cs (1)
63
var documentId = workspace.Documents.Single().
Id
;
StringIndentation\StringIndentationTests.cs (1)
30
var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().
Id
);
Workspaces\WorkspaceTests_EditorFeatures.cs (82)
174
workspace.OnParseOptionsChanged(document.
Id
.ProjectId,
198
workspace.OpenDocument(document.
Id
);
202
workspace.OnParseOptionsChanged(document.
Id
.ProjectId,
207
workspace.CloseDocument(document.
Id
);
228
.DocumentStates.GetState(document1.
Id
)
235
.DocumentStates.GetState(document2.
Id
)
358
workspace.OpenDocument(document.
Id
);
361
Assert.False(workspace.IsDocumentOpen(document.
Id
));
375
workspace.OpenDocument(document.
Id
);
376
workspace.CloseDocument(document.
Id
);
390
workspace.OpenDocument(document.
Id
);
392
workspace.OnDocumentRemoved(document.
Id
);
505
workspace.OpenDocument(document1.
Id
);
513
var docZ = solutionZ.GetDocument(document1.
Id
);
559
workspace.OpenDocument(document1.
Id
);
560
workspace.OpenDocument(document2.
Id
);
573
var doc1Z = cs.GetDocument(document1.
Id
);
627
trackingService.SetActiveDocument(document2.
Id
);
629
workspace.OpenDocument(document1.
Id
);
630
workspace.OpenDocument(document2.
Id
);
644
var doc1Z = cs.GetDocument(document1.
Id
);
649
var doc2Z = cs.GetDocument(document2.
Id
);
666
var doc1Z = cs.GetDocument(document1.
Id
);
671
var doc2Z = cs.GetDocument(document2.
Id
);
700
workspace.OpenDocument(document.
Id
);
710
workspace.CloseDocument(document.
Id
);
726
workspace.OpenDocument(document.
Id
);
729
Assert.Equal(startText, (await workspace.CurrentSolution.GetDocument(document.
Id
).GetTextAsync()).ToString());
733
var newSolution = oldSolution.WithDocumentText(document.
Id
, SourceText.From(newText));
736
Assert.Equal(startText, (await workspace.CurrentSolution.GetDocument(document.
Id
).GetTextAsync()).ToString());
782
var newSolution = oldSolution.RemoveDocument(document.
Id
);
807
(sender, args) => Assert.True(args.Document.Id == document.
Id
,
811
(sender, args) => Assert.True(args.Document.Id == document.
Id
,
817
workspace.OpenDocument(document.
Id
);
818
workspace.CloseDocument(document.
Id
);
835
workspace.OpenDocument(document.
Id
);
836
workspace.CloseDocument(document.
Id
);
873
(sender, args) => Assert.True(args.Document.Id == document.
Id
,
877
(sender, args) => Assert.True(args.Document.Id == document.
Id
,
883
workspace.OpenSourceGeneratedDocument(document.
Id
);
885
Assert.Equal(document.
Id
, sourceGeneratedDocumentId);
904
workspace.OpenSourceGeneratedDocument(document.
Id
);
905
await workspace.CloseSourceGeneratedDocumentAsync(document.
Id
);
937
(sender, args) => Assert.True(args.Document.Id == document.
Id
,
941
(sender, args) => Assert.True(args.Document.Id == document.
Id
,
947
workspace.OpenAdditionalDocument(document.
Id
);
948
workspace.CloseAdditionalDocument(document.
Id
);
965
workspace.OpenAdditionalDocument(document.
Id
);
966
workspace.CloseAdditionalDocument(document.
Id
);
998
(sender, args) => Assert.True(args.Document.Id == document.
Id
,
1002
(sender, args) => Assert.True(args.Document.Id == document.
Id
,
1008
workspace.OpenAnalyzerConfigDocument(document.
Id
);
1009
workspace.CloseAnalyzerConfigDocument(document.
Id
);
1026
workspace.OpenAnalyzerConfigDocument(document.
Id
);
1027
workspace.CloseAnalyzerConfigDocument(document.
Id
);
1059
var doc = project.GetDocument(additionalDoc.
Id
);
1062
var additionalDocument = project.GetAdditionalDocument(additionalDoc.
Id
);
1083
var doc = project.GetDocument(analyzerConfigDoc.
Id
);
1086
var analyzerConfigDocument = project.GetAnalyzerConfigDocument(analyzerConfigDoc.
Id
);
1107
workspace.OpenAdditionalDocument(additionalDoc.
Id
);
1114
var newSolution = oldSolution.WithAdditionalDocumentText(additionalDoc.
Id
, SourceText.From(newText));
1122
var doc = workspace.CurrentSolution.GetAdditionalDocument(additionalDoc.
Id
);
1140
workspace.OpenAnalyzerConfigDocument(analyzerConfigDoc.
Id
);
1147
var newSolution = oldSolution.WithAnalyzerConfigDocumentText(analyzerConfigDoc.
Id
, SourceText.From(newText));
1155
var doc = workspace.CurrentSolution.GetAnalyzerConfigDocument(analyzerConfigDoc.
Id
);
1173
workspace.OpenAdditionalDocument(additionalDoc.
Id
);
1178
Assert.Equal(additionalDoc.
Id
, openDocumentIds.Single());
1180
workspace.CloseAdditionalDocument(additionalDoc.
Id
);
1186
workspace.OpenAdditionalDocument(additionalDoc.
Id
);
1187
workspace.CloseAdditionalDocument(additionalDoc.
Id
);
1202
workspace.OpenAnalyzerConfigDocument(analyzerConfigDoc.
Id
);
1207
Assert.Equal(analyzerConfigDoc.
Id
, openDocumentIds.Single());
1209
workspace.CloseAnalyzerConfigDocument(analyzerConfigDoc.
Id
);
1215
workspace.OpenAnalyzerConfigDocument(analyzerConfigDoc.
Id
);
1216
workspace.CloseAnalyzerConfigDocument(analyzerConfigDoc.
Id
);
1239
var doc = workspace.CurrentSolution.GetAdditionalDocument(additionalDoc.
Id
);
1275
var doc = workspace.CurrentSolution.GetAnalyzerConfigDocument(analyzerConfigDoc.
Id
);
1366
Assert.Equal(document.
Id
, documentIdsWithFilePath.Single());
1370
Assert.Equal(additionalDoc.
Id
, documentIdsWithFilePath.Single());
1386
Assert.Equal(document.
Id
, documentIdsWithFilePath.Single());
1390
Assert.Equal(analyzerConfigDoc.
Id
, documentIdsWithFilePath.Single());
1425
AssertEx.SetEqual(workspace.Projects.SelectMany(p => p.Documents).Select(d => d.
Id
), eventArgs.Select(e => e.DocumentId));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (35)
BraceMatching\AbstractBraceMatcherTests.cs (1)
27
var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().
Id
);
CodeLens\AbstractCodeLensTest.cs (8)
25
var document = workspace.CurrentSolution.GetDocument(annotatedDocument.
Id
);
35
var result = await new CodeLensReferencesService().GetReferenceCountAsync(workspace.CurrentSolution, annotatedDocument.
Id
,
53
var document = workspace.CurrentSolution.GetDocument(annotatedDocument.
Id
);
63
annotatedDocument.
Id
, declarationSyntaxNode, CancellationToken.None);
79
var document = workspace.CurrentSolution.GetDocument(annotatedDocument.
Id
);
89
annotatedDocument.
Id
, declarationSyntaxNode, CancellationToken.None);
105
var document = workspace.CurrentSolution.GetDocument(annotatedDocument.
Id
);
115
annotatedDocument.
Id
, declarationSyntaxNode, CancellationToken.None);
Completion\AbstractCompletionProviderTests.cs (5)
813
var documentId = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").
Id
;
869
var documentId = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").
Id
;
1042
workspace.OnDocumentSourceCodeKindChanged(hostDocument.
Id
, sourceCodeKind);
1049
var document = workspace.CurrentSolution.GetDocument(hostDocument.
Id
);
1091
workspace.OnDocumentSourceCodeKindChanged(hostDocument.
Id
, sourceCodeKind);
Diagnostics\GenerateType\GenerateTypeTestState.cs (1)
50
InvocationDocument = Workspace.CurrentSolution.GetDocument(_testDocument.
Id
);
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
109
Assert.False(testState.Workspace.Documents.Select(d => d.
Id
).Contains(result.NavigationDocumentId));
ExtractInterface\ExtractInterfaceTestState.cs (1)
62
ExtractFromDocument = Workspace.CurrentSolution.GetDocument(_testDocument.
Id
);
Formatting\CoreFormatterTestsBase.cs (1)
183
var document = workspace.CurrentSolution.GetDocument(hostdoc.
Id
);
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (2)
38
var document = workspace.CurrentSolution.GetDocument(hostDocument.
Id
);
62
var document = workspace.CurrentSolution.GetDocument(hostDocument.
Id
);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
50
var document = workspace.CurrentSolution.GetDocument(testDocument.
Id
);
LanguageServer\AbstractLanguageServerProtocolTests.cs (4)
338
solution = solution.WithDocumentFilePath(document.
Id
, GetDocumentFilePathFromName(document.Name));
340
var documentText = await solution.GetRequiredDocument(document.
Id
).GetTextAsync(CancellationToken.None);
341
solution = solution.WithDocumentText(document.
Id
, SourceText.From(documentText.ToString(), System.Text.Encoding.UTF8, SourceHashAlgorithms.Default));
451
var document = await solution.GetRequiredDocumentAsync(testDocument.
Id
, includeSourceGenerated: true, CancellationToken.None);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (2)
349
var documentId = testWorkspace.Documents.First(d => d.Name == "SourceDocument").
Id
;
468
var documentId = testWorkspace.Documents.Where(d => d.Name == "SourceDocument").Single().
Id
;
Squiggles\TestDiagnosticTagProducer.cs (1)
44
location: new DiagnosticDataLocation(new FileLinePositionSpan(document.FilePath, linePosSpan), document.
Id
),
Structure\AbstractSyntaxStructureProviderTests.cs (2)
51
var document = workspace.CurrentSolution.GetRequiredDocument(hostDocument.
Id
);
70
var document = workspace.CurrentSolution.GetRequiredDocument(hostDocument.
Id
);
TaskList\AbstractTaskListTests.cs (1)
36
var documentId = hostDocument.
Id
;
Workspaces\EditorTestHostDocument.cs (2)
158
foreach (var linkedId in workspace.CurrentSolution.GetDocumentIdsWithFilePath(FilePath).Concat(this.
Id
))
168
var document = threadingContext.JoinableTaskFactory.Run(() => workspace.CurrentSolution.GetSourceGeneratedDocumentAsync(testDocument.
Id
, CancellationToken.None).AsTask());
Workspaces\TestWorkspaceFixture.cs (2)
91
GetWorkspace().OnDocumentSourceCodeKindChanged(hostDocument.
Id
, sourceCodeKind);
93
return GetWorkspace().CurrentSolution.GetDocument(hostDocument.
Id
);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (18)
Diagnostics\DiagnosticDataTests.cs (1)
185
var documentId = hostDocument.
Id
;
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
65
var documentId = workspace.Documents[0].
Id
;
InheritanceMargin\InheritanceMarginTests.cs (2)
97
var document = testWorkspace.CurrentSolution.GetRequiredDocument(testHostDocument.
Id
);
334
var document = testWorkspace.CurrentSolution.GetRequiredDocument(testHostDocument.
Id
);
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (2)
77
var documentId = workspace.Documents.Single(d => !d.IsLinkFile).
Id
;
80
var linkedDocumentId = workspace.Documents.Single(d => d.IsLinkFile).
Id
;
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
311
var document = Workspace.CurrentSolution.GetRequiredDocument(testDocument.
Id
);
RenameTracking\RenameTrackingTestState.cs (1)
170
var document = this.Workspace.CurrentSolution.GetDocument(HostDocument.
Id
);
Snippets\RoslynLSPSnippetConvertTests.cs (3)
402
var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().
Id
);
413
var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().
Id
);
495
var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().
Id
);
StackTraceExplorer\StackTraceExplorerTests.cs (1)
47
var doc = workspace.CurrentSolution.GetRequiredDocument(cursorDoc.
Id
);
Structure\BlockStructureServiceTests.cs (1)
116
var document = workspace.CurrentSolution.GetDocument(hostDocument.
Id
);
Structure\StructureTaggerTests.cs (1)
403
var document = workspace.CurrentSolution.GetDocument(hostdoc.
Id
);
SymbolFinder\FindSymbolAtPositionTests.cs (1)
21
var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.Single().
Id
);
Tagging\AsynchronousTaggerTests.cs (2)
166
var document = workspace.CurrentSolution.GetRequiredDocument(testDocument.
Id
);
221
var document = workspace.CurrentSolution.GetRequiredDocument(testDocument.
Id
);
ValueTracking\AbstractBaseValueTrackingTests.cs (1)
29
var document = testWorkspace.CurrentSolution.GetRequiredDocument(cursorDocument.
Id
);
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
RelatedDocuments\AbstractRelatedDocumentsTests.cs (2)
30
var documentId = caretDocument.
Id
;
48
var expectedSortedResults = workspace.Documents.Where(d => d.SelectedSpans.Count > 0).Select(d => d.
Id
).OrderBy(d => d.Id);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (6)
Workspaces\TestHostDocument.cs (2)
167
Contract.ThrowIfFalse(project.Id == this.
Id
.ProjectId);
205
return DocumentInfo.Create(
Id
, Name, Folders, SourceCodeKind, Loader, FilePath, isGenerated: false)
Workspaces\TestWorkspace`1.cs (4)
316
return hostDocument.
Id
;
320
=> this.Documents.FirstOrDefault(d => d.
Id
== documentId);
323
=> this.AdditionalDocuments.FirstOrDefault(d => d.
Id
== documentId);
326
=> this.AnalyzerConfigDocuments.FirstOrDefault(d => d.
Id
== documentId);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (4)
DesignerAttribute\DesignerAttributeServiceTests.cs (1)
120
var documentId = hostDocument.
Id
;
DocumentOutline\DocumentOutlineTestsBase.cs (3)
106
solution = solution.WithDocumentFilePath(document.
Id
, PathRoot + document.Name);
108
var documentText = await solution.GetRequiredDocument(document.
Id
).GetTextAsync(CancellationToken.None);
109
solution = solution.WithDocumentText(document.
Id
, SourceText.From(documentText.ToString(), System.Text.Encoding.UTF8));
Microsoft.VisualStudio.LanguageServices.UnitTests (10)
CodeModel\AbstractEventCollectorTests.vb (2)
108
Dim codeDocument = workspace.CurrentSolution.GetDocument(workspace.Documents(0).
Id
)
111
Dim changeDocument = workspace.CurrentSolution.GetDocument(workspace.Documents(1).
Id
)
CodeModel\CSharp\FileCodeModelTests.vb (1)
1022
Dim changeDocument = changedWorkspace.CurrentSolution.GetDocument(changedWorkspace.Documents(0).
Id
)
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
293
Dim workspaceDoc = workspace.CurrentSolution.GetDocument(doc.
Id
)
Progression\ProgressionTestState.vb (2)
37
Dim document = Workspace.CurrentSolution.GetDocument(hostDocument.
Id
)
79
Dim document = Workspace.CurrentSolution.GetDocument(hostDocument.
Id
)
Venus\DocumentService_IntegrationTests.vb (2)
276
Dim mappedTestDocument = testWorkspace.Documents.First(Function(d) d.Id <> testDocument.
Id
)
314
Dim mappedTestDocument = testWorkspace.Documents.First(Function(d) d.Id <> testDocument.
Id
)
VsNavInfo\VsNavInfoTests.vb (2)
829
Dim document = workspace.CurrentSolution.GetDocument(hostDocument.
Id
)
867
Dim document = workspace.CurrentSolution.GetDocument(hostDocument.
Id
)