3 instantiations of EditorTestHostDocument
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Workspaces\EditorTestWorkspace.cs (3)
58=> new(text, displayName, sourceCodeKind, id, filePath, folders, exportProvider, documentServiceProvider); 73=> new(exportProvider, languageServiceProvider, code, name, filePath, cursorPosition, spans, 297var projectionDocument = new EditorTestHostDocument(
187 references to EditorTestHostDocument
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (105)
AddMissingImports\CSharpAddMissingImportsRefactoringProviderTests.cs (1)
31var 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)
69var oldDocument = workspace.Documents[0]; 158var 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)
447var hostDocument = workspace.DocumentWithCursor;
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
688var hostDocument = workspace.Documents.Single(); 1280var hostDocument = workspace.Documents.Single();
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (6)
2464var testDocument = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument"); 2717var testDocument = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument2"); 2772var testDocument = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument"); 3060var testDocument = workspace.Documents.Single(); 3195var testDocument = workspace.Documents.First(d => d.Name == "CurrentDocument.cs"); 3249var 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\DataTipInfoGetterTests.cs (1)
48var testHostDocument = workspace.Documents.Single();
Debugging\LocationInfoGetterTests.cs (1)
26var testDocument = workspace.Documents.Single();
Debugging\ProximityExpressionsGetterTests.cs (1)
72var testDocument = workspace.Documents.Single();
EditAndContinue\ActiveStatementTrackingServiceTests.cs (2)
55var testDocument1 = new EditorTestHostDocument(text: source1, displayName: "1.cs", exportProvider: workspace.ExportProvider, filePath: "1.cs"); 56var 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)
37var testDocument = workspace.Documents.First(); 48var testDocument = workspace.Documents.Single(); 70var testDocument = workspace.Documents.Single(); 82var testDocument = workspace.Documents.Single(); 115EditorTestHostDocument testDocument, 164var testDocument = workspace.Documents.Single();
ExtractMethod\MiscTests.cs (1)
130var testDocument = workspace.Documents.Single();
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandlerTests.cs (1)
28var document = workspace.Documents.Single();
Formatting\CodeCleanupTests.cs (3)
811var hostdoc = workspace.Documents.Single(); 828var hostdoc = workspace.Documents.Single(); 910var hostdoc = workspace.Documents.Single();
Formatting\FormattingEngineTests.cs (2)
437var subjectDocument = workspace.Documents.Single(); 2917var 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)
3374var subjectDocument = workspace.Documents.Single(); 3408var testDocument = workspace.Documents.Single();
Intents\IntentTestsBase.cs (1)
105var testDocument = workspace.Documents.Single(d => d.Name == "test1.cs");
MoveToNamespace\MoveToNamespaceTests.cs (1)
1413var testDocument = workspace.Projects.Single(p => p.Name == "Proj1").Documents.Single();
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (1)
215var 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)
159var document = new EditorTestHostDocument( 186var document = new EditorTestHostDocument( 214var document1 = new EditorTestHostDocument("var x = 1;", displayName: "Sub1", sourceCodeKind: SourceCodeKind.Script); 217var document2 = new EditorTestHostDocument("var x = 2;", displayName: "Sub2", sourceCodeKind: SourceCodeKind.Script, filePath: "a.csx"); 354var document = new EditorTestHostDocument(string.Empty); 371var document = new EditorTestHostDocument(string.Empty); 386var document = new EditorTestHostDocument(string.Empty); 405var document = new EditorTestHostDocument(@"class C { }"); 424var document1 = new EditorTestHostDocument(@"public class C { }"); 427var document2 = new EditorTestHostDocument(@"class D : C { }"); 448var document1 = new EditorTestHostDocument(@"public class C { }"); 451var document2 = new EditorTestHostDocument(""" 481var document1 = new EditorTestHostDocument(@"public class C { }"); 484var document2 = new EditorTestHostDocument(""" 535var document1 = new EditorTestHostDocument(@"public class C { }"); 538var document2 = new EditorTestHostDocument(""" 603var document1 = new EditorTestHostDocument(@"public class C { }"); 606var document2 = new EditorTestHostDocument(""" 695var document = new EditorTestHostDocument(string.Empty); 721var document = new EditorTestHostDocument(startText); 754var document = new EditorTestHostDocument(doc1Text); 775var document = new EditorTestHostDocument(doc1Text); 795var document = new EditorTestHostDocument(doc1Text); 862var document = workspace.Documents.Single(); 925var document = new EditorTestHostDocument(); 986var document = new EditorTestHostDocument(); 1047var document = new EditorTestHostDocument("public class C { }"); 1048var additionalDoc = new EditorTestHostDocument("some text"); 1071var document = new EditorTestHostDocument("public class C { }"); 1072var analyzerConfigDoc = new EditorTestHostDocument("root = true"); 1101var document = new EditorTestHostDocument("public class C { }"); 1102var additionalDoc = new EditorTestHostDocument(startText); 1133var document = new EditorTestHostDocument("public class C { }"); 1135var analyzerConfigDoc = new EditorTestHostDocument(startText, filePath: analyzerConfigPath); 1167var document = new EditorTestHostDocument("public class C { }"); 1168var additionalDoc = new EditorTestHostDocument(startText); 1196var document = new EditorTestHostDocument("public class C { }"); 1197var analyzerConfigDoc = new EditorTestHostDocument(startText); 1227var document = new EditorTestHostDocument("public class C { }"); 1228var additionalDoc = new EditorTestHostDocument(startText, "original.config"); 1263var document = new EditorTestHostDocument("public class C { }"); 1264var analyzerConfigDoc = new EditorTestHostDocument(startText, "original.config"); 1301var document = new EditorTestHostDocument("public class C { }"); 1302var additionalDoc = new EditorTestHostDocument(startText, "original.config"); 1329var document = new EditorTestHostDocument("public class C { }"); 1330var analyzerConfigDoc = new EditorTestHostDocument(startText, "original.config"); 1357var document = new EditorTestHostDocument("public class C { }", filePath: docFilePath); 1358var additionalDoc = new EditorTestHostDocument(""" 1378var document = new EditorTestHostDocument("public class C { }", filePath: docFilePath); 1380var analyzerConfigDoc = new EditorTestHostDocument(@"root = true", filePath: analyzerConfigDocFilePath); 1493var document = new EditorTestHostDocument("class C { }");
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (65)
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)
149var 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)
1269var hostDocument = workspace.DocumentWithCursor; 1318var hostDocument = workspace.DocumentWithCursor;
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();
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
342foreach (var document in workspace.Documents) 458foreach (var testDocument in workspace.Documents)
SpellCheck\AbstractSpellCheckFixerProviderTests.cs (1)
38var document = workspace.Documents.Single();
Squiggles\SquiggleUtilities.cs (1)
38var firstDocument = workspace.Documents.First();
Squiggles\TestDiagnosticTagProducer.cs (1)
27internal 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)
27public partial class EditorTestWorkspace : TestWorkspace<EditorTestHostDocument, EditorTestHostProject, EditorTestHostSolution> 49private protected override EditorTestHostDocument CreateDocument( 60private protected override EditorTestHostDocument CreateDocument( 83IList<EditorTestHostDocument> documents, 84IList<EditorTestHostDocument>? additionalDocuments = null, 85IList<EditorTestHostDocument>? analyzerConfigDocuments = null, 112foreach (var document in Documents) 117foreach (var document in AdditionalDocuments) 122foreach (var document in AnalyzerConfigDocuments) 127foreach (var document in ProjectionDocuments) 137var testDocument = GetTestDocument(document); 144var testDocument = GetTestAdditionalDocument(document); 151var testDocument = this.GetTestAnalyzerConfigDocument(document); 159var testDocument = GetTestDocument(documentId); 169var testDocument = GetTestAdditionalDocument(documentId); 179var testDocument = GetTestAnalyzerConfigDocument(documentId); 189var testDocument = GetTestDocument(documentId); 247public EditorTestHostDocument CreateProjectionBufferDocument( 249IList<EditorTestHostDocument> baseDocuments, 261foreach (var document in baseDocuments) 297var projectionDocument = new EditorTestHostDocument( 312string markup, IList<EditorTestHostDocument> baseDocuments, 360var 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 (11)
CodeFixes\CodeFixServiceTests.cs (2)
331EditorTestHostDocument? additionalDocument = null, 339EditorTestHostDocument? additionalDocument = null,
RenameTracking\RenameTrackingTestState.cs (1)
45public EditorTestHostDocument HostDocument { get; }
Structure\StructureTaggerTests.cs (1)
398var 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.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
References\FindAllReferencesHandlerFeaturesTests.cs (1)
73var testDocument = new EditorTestHostDocument(text: source, displayName: @$"C:\SomeFile{i}.cs", exportProvider: testLspServer.TestWorkspace.ExportProvider, filePath: @$"C:\SomeFile{i}.cs");
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
DocumentOutline\DocumentOutlineTestsBase.cs (1)
101foreach (var document in workspace.Documents)
Microsoft.VisualStudio.LanguageServices.UnitTests (4)
AbstractTextViewFilterTests.vb (2)
247Private Shared Sub TestSpan(workspace As EditorTestWorkspace, document As EditorTestHostDocument, startPosition As Integer, endPosition As Integer, Optional commandId As UInteger = Nothing) 269Private Shared Sub TestSpan(workspace As EditorTestWorkspace, document As EditorTestHostDocument, caretPosition As Integer, startPosition As Integer, endPosition As Integer, Optional commandId As UInteger = Nothing)
Snippets\SnippetExpansionClientTestsHelper.vb (2)
13surfaceBufferDocument As EditorTestHostDocument, 51document As EditorTestHostDocument,