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