3 instantiations of EditorTestHostDocument
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Workspaces\EditorTestWorkspace.cs (3)
83=> new(text, displayName, sourceCodeKind, id, filePath, folders, exportProvider, documentServiceProvider); 98=> new(exportProvider, languageServiceProvider, code, name, filePath, cursorPosition, spans, 342var projectionDocument = new EditorTestHostDocument(
188 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)
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(); 1348var 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\LocationInfoGetterTests.cs (1)
26var testDocument = workspace.Documents.Single();
Debugging\ProximityExpressionsGetterTests.cs (1)
72var testDocument = workspace.Documents.Single();
EditAndContinue\ActiveStatementTrackingServiceTests.cs (2)
60var testDocument1 = new EditorTestHostDocument(text: source1, displayName: "1.cs", exportProvider: workspace.ExportProvider, filePath: "1.cs"); 61var 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)
808var hostdoc = workspace.Documents.Single(); 825var hostdoc = workspace.Documents.Single(); 907var 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)
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 { }"); 488var document2 = new EditorTestHostDocument(""" 539var document1 = new EditorTestHostDocument(@"public class C { }"); 546var document2 = new EditorTestHostDocument(""" 611var document1 = new EditorTestHostDocument(@"public class C { }"); 618var document2 = new EditorTestHostDocument(""" 707var document = new EditorTestHostDocument(string.Empty); 733var document = new EditorTestHostDocument(startText); 766var document = new EditorTestHostDocument(doc1Text); 787var document = new EditorTestHostDocument(doc1Text); 807var document = new EditorTestHostDocument(doc1Text); 874var document = workspace.Documents.Single(); 937var document = new EditorTestHostDocument(); 998var document = new EditorTestHostDocument(); 1059var document = new EditorTestHostDocument("public class C { }"); 1060var additionalDoc = new EditorTestHostDocument("some text"); 1083var document = new EditorTestHostDocument("public class C { }"); 1084var analyzerConfigDoc = new EditorTestHostDocument("root = true"); 1113var document = new EditorTestHostDocument("public class C { }"); 1114var additionalDoc = new EditorTestHostDocument(startText); 1145var document = new EditorTestHostDocument("public class C { }"); 1147var analyzerConfigDoc = new EditorTestHostDocument(startText, filePath: analyzerConfigPath); 1179var document = new EditorTestHostDocument("public class C { }"); 1180var additionalDoc = new EditorTestHostDocument(startText); 1208var document = new EditorTestHostDocument("public class C { }"); 1209var analyzerConfigDoc = new EditorTestHostDocument(startText); 1239var document = new EditorTestHostDocument("public class C { }"); 1240var additionalDoc = new EditorTestHostDocument(startText, "original.config"); 1275var document = new EditorTestHostDocument("public class C { }"); 1276var analyzerConfigDoc = new EditorTestHostDocument(startText, "original.config"); 1313var document = new EditorTestHostDocument("public class C { }"); 1314var additionalDoc = new EditorTestHostDocument(startText, "original.config"); 1341var document = new EditorTestHostDocument("public class C { }"); 1342var analyzerConfigDoc = new EditorTestHostDocument(startText, "original.config"); 1369var document = new EditorTestHostDocument("public class C { }", filePath: docFilePath); 1370var additionalDoc = new EditorTestHostDocument(""" 1390var document = new EditorTestHostDocument("public class C { }", filePath: docFilePath); 1392var analyzerConfigDoc = new EditorTestHostDocument(@"root = true", filePath: analyzerConfigDocFilePath); 1505var document = new EditorTestHostDocument("class C { }");
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (66)
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)
1269var hostDocument = workspace.DocumentWithCursor; 1318var 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();
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
334foreach (var document in workspace.Documents) 450foreach (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)
34public partial class EditorTestWorkspace : TestWorkspace<EditorTestHostDocument, EditorTestHostProject, EditorTestHostSolution>, ILspWorkspace 74private protected override EditorTestHostDocument CreateDocument( 85private protected override EditorTestHostDocument CreateDocument( 108IList<EditorTestHostDocument> documents, 109IList<EditorTestHostDocument>? additionalDocuments = null, 110IList<EditorTestHostDocument>? analyzerConfigDocuments = null, 137foreach (var document in Documents) 142foreach (var document in AdditionalDocuments) 147foreach (var document in AnalyzerConfigDocuments) 152foreach (var document in ProjectionDocuments) 162var testDocument = GetTestDocument(document); 169var testDocument = GetTestAdditionalDocument(document); 176var testDocument = this.GetTestAnalyzerConfigDocument(document); 184var testDocument = GetTestDocument(documentId); 194var testDocument = GetTestAdditionalDocument(documentId); 204var testDocument = GetTestAnalyzerConfigDocument(documentId); 214var testDocument = GetTestDocument(documentId); 292public EditorTestHostDocument CreateProjectionBufferDocument( 294IList<EditorTestHostDocument> baseDocuments, 306foreach (var document in baseDocuments) 342var projectionDocument = new EditorTestHostDocument( 357string markup, IList<EditorTestHostDocument> baseDocuments, 405var 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)
329EditorTestHostDocument? additionalDocument = null, 337EditorTestHostDocument? additionalDocument = null,
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
316var testDocument = Workspace.Documents.Single(d => d.FilePath == "SourceDocument");
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 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,