3 instantiations of EditorTestHostDocument
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Workspaces\EditorTestWorkspace.cs (3)
62=> new(text, displayName, sourceCodeKind, id, filePath, folders, exportProvider, documentServiceProvider); 77=> new(exportProvider, languageServiceProvider, code, name, filePath, cursorPosition, spans, 321var projectionDocument = new EditorTestHostDocument(
186 references to EditorTestHostDocument
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (104)
AddMissingImports\CSharpAddMissingImportsRefactoringProviderTests.cs (1)
32var hostDocument = workspace.Documents.First();
Classification\SyntacticTaggerTests.cs (2)
39var document = workspace.Documents.First(); 91var document = workspace.Documents.First();
Classification\TotalClassifierTests.cs (2)
3055var document = workspace.Documents.First(); 3157var document = workspace.Documents.First();
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (2)
68var oldDocument = workspace.Documents[0]; 157var refDocument = workspace.Documents.Where(doc => doc.Id != originalDocumentId).SingleOrDefault();
CommentSelection\CSharpCommentSelectionTests.cs (1)
131var doc = workspace.Documents.First();
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
178var hostDocument = workspace.DocumentWithCursor;
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
445var hostDocument = workspace.DocumentWithCursor;
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
688var hostDocument = workspace.Documents.Single(); 1348var hostDocument = workspace.Documents.Single();
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (6)
3002var testDocument = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument"); 3485var testDocument = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument2"); 3544var testDocument = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument"); 3844var testDocument = workspace.Documents.Single(); 3989var testDocument = workspace.Documents.First(d => d.Name == "CurrentDocument.cs"); 4047var testDocument = workspace.Documents.First(d => d.Name == "CurrentDocument.cs");
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (1)
373var testDocument = workspace.Documents.Single();
Completion\CompletionServiceTests.cs (1)
130var testDocument = new EditorTestHostDocument("class C {}");
Debugging\LocationInfoGetterTests.cs (1)
26var testDocument = workspace.Documents.Single();
Debugging\ProximityExpressionsGetterTests.cs (1)
72var testDocument = workspace.Documents.Single();
EditAndContinue\ActiveStatementTrackingServiceTests.cs (2)
58var testDocument1 = new EditorTestHostDocument(text: source1, displayName: "1.cs", exportProvider: workspace.ExportProvider, filePath: "1.cs"); 59var testDocument2 = new EditorTestHostDocument(text: source2, displayName: "2.cs", exportProvider: workspace.ExportProvider, filePath: "2.cs");
EncapsulateField\EncapsulateFieldTestState.cs (1)
26private readonly EditorTestHostDocument _testDocument;
ExtractMethod\ExtractMethodBase.cs (6)
40var testDocument = workspace.Documents.First(); 51var testDocument = workspace.Documents.Single(); 74var testDocument = workspace.Documents.Single(); 87var testDocument = workspace.Documents.Single(); 119EditorTestHostDocument testDocument, 160var testDocument = workspace.Documents.Single();
ExtractMethod\ExtractMethodMiscellaneousTests.cs (1)
135var testDocument = workspace.Documents.Single();
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandlerTests.cs (1)
28var document = workspace.Documents.Single();
Formatting\CodeCleanupTests.cs (3)
806var hostdoc = workspace.Documents.Single(); 823var hostdoc = workspace.Documents.Single(); 905var hostdoc = workspace.Documents.Single();
Formatting\FormattingEngineTests.cs (2)
436var subjectDocument = workspace.Documents.Single(); 2946var subjectDocument = workspace.Documents.Single();
Formatting\Indentation\SmartIndenterEnterOnTokenTests.cs (2)
1401var hostdoc = workspace.Documents.First(); 1440var hostdoc = workspace.Documents.First();
Formatting\Indentation\SmartIndenterTests.cs (2)
3460var subjectDocument = workspace.Documents.Single(); 3462var projectedDocument =
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (2)
3380var subjectDocument = workspace.Documents.Single(); 3414var testDocument = workspace.Documents.Single();
Intents\IntentTestsBase.cs (1)
105var testDocument = workspace.Documents.Single(d => d.Name == "test1.cs");
MoveToNamespace\MoveToNamespaceTests.cs (1)
1445var testDocument = workspace.Projects.Single(p => p.Name == "Proj1").Documents.Single();
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (1)
213var testDocument = workspace.Documents.Single();
QuickInfo\SemanticQuickInfoSourceTests.cs (3)
49var testDocument = workspace.DocumentWithCursor; 130var sourceDocument = workspace.Documents.Single(d => d.Name == "SourceDocument"); 299var sourceDocument = workspace.Documents.First(d => d.Name == "SourceDocument");
QuickInfo\SyntacticQuickInfoSourceTests.cs (1)
602var testDocument = workspace.Documents.Single();
SplitStringLiteral\SplitStringLiteralCommandHandlerTests.cs (1)
61var document = workspace.Documents.Single();
StringCopyPaste\StringCopyPasteCommandHandlerTests.cs (1)
179EditorTestHostDocument document,
Workspaces\WorkspaceTests_EditorFeatures.cs (51)
158var document = new EditorTestHostDocument( 185var document = new EditorTestHostDocument( 213var document1 = new EditorTestHostDocument("var x = 1;", displayName: "Sub1", sourceCodeKind: SourceCodeKind.Script); 216var document2 = new EditorTestHostDocument("var x = 2;", displayName: "Sub2", sourceCodeKind: SourceCodeKind.Script, filePath: "a.csx"); 353var document = new EditorTestHostDocument(string.Empty); 370var document = new EditorTestHostDocument(string.Empty); 385var document = new EditorTestHostDocument(string.Empty); 404var document = new EditorTestHostDocument(@"class C { }"); 423var document1 = new EditorTestHostDocument(@"public class C { }"); 426var document2 = new EditorTestHostDocument(@"class D : C { }"); 447var document1 = new EditorTestHostDocument(@"public class C { }"); 450var document2 = new EditorTestHostDocument(""" 480var document1 = new EditorTestHostDocument(@"public class C { }"); 487var document2 = new EditorTestHostDocument(""" 538var document1 = new EditorTestHostDocument(@"public class C { }"); 545var document2 = new EditorTestHostDocument(""" 610var document1 = new EditorTestHostDocument(@"public class C { }"); 617var document2 = new EditorTestHostDocument(""" 706var document = new EditorTestHostDocument(string.Empty); 732var document = new EditorTestHostDocument(startText); 765var document = new EditorTestHostDocument(doc1Text); 786var document = new EditorTestHostDocument(doc1Text); 806var document = new EditorTestHostDocument(doc1Text); 873var document = workspace.Documents.Single(); 936var document = new EditorTestHostDocument(); 997var document = new EditorTestHostDocument(); 1058var document = new EditorTestHostDocument("public class C { }"); 1059var additionalDoc = new EditorTestHostDocument("some text"); 1082var document = new EditorTestHostDocument("public class C { }"); 1083var analyzerConfigDoc = new EditorTestHostDocument("root = true"); 1112var document = new EditorTestHostDocument("public class C { }"); 1113var additionalDoc = new EditorTestHostDocument(startText); 1144var document = new EditorTestHostDocument("public class C { }"); 1146var analyzerConfigDoc = new EditorTestHostDocument(startText, filePath: analyzerConfigPath); 1178var document = new EditorTestHostDocument("public class C { }"); 1179var additionalDoc = new EditorTestHostDocument(startText); 1207var document = new EditorTestHostDocument("public class C { }"); 1208var analyzerConfigDoc = new EditorTestHostDocument(startText); 1238var document = new EditorTestHostDocument("public class C { }"); 1239var additionalDoc = new EditorTestHostDocument(startText, "original.config"); 1274var document = new EditorTestHostDocument("public class C { }"); 1275var analyzerConfigDoc = new EditorTestHostDocument(startText, "original.config"); 1312var document = new EditorTestHostDocument("public class C { }"); 1313var additionalDoc = new EditorTestHostDocument(startText, "original.config"); 1340var document = new EditorTestHostDocument("public class C { }"); 1341var analyzerConfigDoc = new EditorTestHostDocument(startText, "original.config"); 1368var document = new EditorTestHostDocument("public class C { }", filePath: docFilePath); 1369var additionalDoc = new EditorTestHostDocument(""" 1389var document = new EditorTestHostDocument("public class C { }", filePath: docFilePath); 1391var analyzerConfigDoc = new EditorTestHostDocument(@"root = true", filePath: analyzerConfigDocFilePath); 1504var document = new EditorTestHostDocument("class C { }");
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (64)
AbstractCommandHandlerTestState.cs (1)
77var cursorDocument = Workspace.Documents.First(d => d.CursorPosition.HasValue || d.SelectedSpans.Any(ss => ss.IsEmpty));
AbstractTypingCommandHandlerTest.cs (1)
33var testDocument = workspace.Documents.Single();
AutomaticCompletion\AbstractAutomaticBraceCompletionTests.cs (1)
150var document = workspace.Documents.First();
BraceHighlighting\AbstractBraceHighlightingTests.cs (1)
43var testDocument = workspace.Documents.First();
CodeLens\AbstractCodeLensTest.cs (4)
23foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 51foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 77foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 103foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any()))
CommentSelection\AbstractToggleCommentTestBase.cs (2)
37var doc = workspace.Documents.First(); 54var document = workspace.CreateProjectionBufferDocument(surfaceBufferMarkup, workspace.Documents);
CompleteStatement\AbstractCompleteStatementTests.cs (1)
101var testDocument = workspace.Documents.Single();
Completion\AbstractCompletionProviderTests.cs (2)
1275var hostDocument = workspace.DocumentWithCursor; 1324var hostDocument = workspace.DocumentWithCursor;
Debugging\AbstractDataTipInfoGetterTests.cs (1)
63var testHostDocument = workspace.Documents.Single();
Diagnostics\GenerateType\GenerateTypeTestState.cs (1)
19private readonly EditorTestHostDocument _testDocument;
DocumentationComments\AbstractDocumentationCommentTests.cs (1)
133var testDocument = workspace.Documents.Single();
DocumentationComments\AbstractXmlTagCompletionTests.cs (1)
30var testDocument = workspace.Documents.Single();
Formatting\CoreFormatterTestsBase.cs (5)
53int point, int? expectedIndentation, ITextView textView, EditorTestHostDocument subjectDocument, EditorOptionsService editorOptionsService) 79var document = workspace.Documents.First(); 137var testDocument = workspace.Documents.Single(); 180var hostdoc = workspace.Documents.First(); 244var testDocument = workspace.Documents.Single();
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
44var testDocument = workspace.Documents.Single();
SpellCheck\AbstractSpellCheckFixerProviderTests.cs (1)
38var document = workspace.Documents.Single();
Squiggles\SquiggleUtilities.cs (1)
37var firstDocument = workspace.Documents.First();
Squiggles\TestDiagnosticTagProducer.cs (1)
26internal static DiagnosticData CreateDiagnosticData(EditorTestHostDocument document, TextSpan span)
TaskList\AbstractTaskListTests.cs (1)
34var hostDocument = workspace.Documents.First();
TextStructureNavigation\AbstractTextStructureNavigationTests.cs (1)
27var document = workspace.Documents.First();
Workspaces\EditorTestHostProject.cs (8)
12public class EditorTestHostProject : TestHostProject<EditorTestHostDocument> 21IList<EditorTestHostDocument> documents, 22IList<EditorTestHostDocument>? additionalDocuments = null, 23IList<EditorTestHostDocument>? analyzerConfigDocuments = null, 53IEnumerable<EditorTestHostDocument>? documents = null, 54IEnumerable<EditorTestHostDocument>? additionalDocuments = null, 55IEnumerable<EditorTestHostDocument>? analyzerConfigDocuments = null, 79EditorTestHostDocument document,
Workspaces\EditorTestHostSolution.cs (1)
8: TestHostSolution<EditorTestHostDocument>(projects)
Workspaces\EditorTestWorkspace.cs (23)
31public partial class EditorTestWorkspace : TestWorkspace<EditorTestHostDocument, EditorTestHostProject, EditorTestHostSolution> 53private protected override EditorTestHostDocument CreateDocument( 64private protected override EditorTestHostDocument CreateDocument( 87IList<EditorTestHostDocument> documents, 88IList<EditorTestHostDocument>? additionalDocuments = null, 89IList<EditorTestHostDocument>? analyzerConfigDocuments = null, 116foreach (var document in Documents) 121foreach (var document in AdditionalDocuments) 126foreach (var document in AnalyzerConfigDocuments) 131foreach (var document in ProjectionDocuments) 141var testDocument = GetTestDocument(document); 148var testDocument = GetTestAdditionalDocument(document); 155var testDocument = this.GetTestAnalyzerConfigDocument(document); 163var testDocument = GetTestDocument(documentId); 173var testDocument = GetTestAdditionalDocument(documentId); 183var testDocument = GetTestAnalyzerConfigDocument(documentId); 193var testDocument = GetTestDocument(documentId); 271public EditorTestHostDocument CreateProjectionBufferDocument( 273IList<EditorTestHostDocument> baseDocuments, 285foreach (var document in baseDocuments) 321var projectionDocument = new EditorTestHostDocument( 336string markup, IList<EditorTestHostDocument> baseDocuments, 384var documentWithSpan = baseDocuments.FirstOrDefault(d => d.AnnotatedSpans.ContainsKey(spanName));
Workspaces\TestWorkspaceFixture.cs (4)
22private EditorTestHostDocument _currentDocument; 24public EditorTestHostDocument CurrentDocument => _currentDocument ?? _workspace.Documents.Single(); 80var hostDocument = _currentDocument ?? (GetWorkspace()).Documents.Single(); 109foreach (var document in _workspace?.Documents)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (12)
CodeFixes\CodeFixServiceTests.cs (2)
330EditorTestHostDocument? additionalDocument = null, 338EditorTestHostDocument? additionalDocument = null,
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
314var testDocument = Workspace.Documents.Single(d => d.FilePath == "SourceDocument");
RenameTracking\RenameTrackingTestState.cs (1)
45public EditorTestHostDocument HostDocument { get; }
Structure\StructureTaggerTests.cs (1)
397var hostdoc = workspace.Documents.First();
Tagging\AsynchronousTaggerTests.cs (5)
78var document = workspace.Documents.First(); 107var document = workspace.Documents.First(); 133var document = workspace.Documents.First(); 154var testDocument = workspace.Documents.First(); 210var testDocument = workspace.Documents.First();
TextEditor\TryGetDocumentTests.cs (2)
25var hostDocument = workspace.Documents.First(); 53var hostDocument = workspace.Documents.First();
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
DocumentOutline\DocumentOutlineTestsBase.cs (2)
102foreach (var document in workspace.Documents) 126internal class EditorTestLspServer : AbstractTestLspServer<EditorTestWorkspace, EditorTestHostDocument, EditorTestHostProject, EditorTestHostSolution>
Microsoft.VisualStudio.LanguageServices.UnitTests (4)
AbstractTextViewFilterTests.vb (2)
247Private Shared Async Function TestSpan(workspace As EditorTestWorkspace, document As EditorTestHostDocument, startPosition As Integer, endPosition As Integer, Optional commandId As UInteger = Nothing) As Task 269Private Shared Async Function TestSpan(workspace As EditorTestWorkspace, document As EditorTestHostDocument, caretPosition As Integer, startPosition As Integer, endPosition As Integer, Optional commandId As UInteger = Nothing) As Task
Snippets\SnippetExpansionClientTestsHelper.vb (2)
13surfaceBufferDocument As EditorTestHostDocument, 51document As EditorTestHostDocument,