1 instantiation of EditorTestWorkspace
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\EditorTestWorkspace_Create.cs (1)
34var workspace = new EditorTestWorkspace(composition, workspaceKind, ignoreUnchangeableDocumentsWhenApplyingChanges: ignoreUnchangeableDocumentsWhenApplyingChanges);
783 references to EditorTestWorkspace
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (431)
AddMissingImports\CSharpAddMissingImportsRefactoringProviderTests.cs (2)
25protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters) 28protected override void InitializeWorkspace(EditorTestWorkspace workspace, TestParameters parameters)
AutomaticCompletion\AutomaticBraceCompletionTests.cs (3)
566using var session = CreateSession(EditorTestWorkspace.CreateCSharp(code), '(', ')'); 593using var session = CreateSession(EditorTestWorkspace.CreateCSharp(code), '(', ')'); 1682EditorTestWorkspace.CreateCSharp(code),
AutomaticCompletion\AutomaticBracketCompletionTests.cs (1)
326EditorTestWorkspace.CreateCSharp(code),
AutomaticCompletion\AutomaticLessAndGreaterThanCompletionTests.cs (1)
437EditorTestWorkspace.CreateCSharp(code),
AutomaticCompletion\AutomaticLineEnderTests.cs (2)
3326protected override Action CreateNextHandler(EditorTestWorkspace workspace) 3329internal override IChainedCommandHandler<AutomaticLineEnderCommandArgs> GetCommandHandler(EditorTestWorkspace workspace)
AutomaticCompletion\AutomaticLiteralCompletionTests.cs (2)
650EditorTestWorkspace.CreateCSharp(code), 657EditorTestWorkspace.CreateCSharp(code),
AutomaticCompletion\AutomaticParenthesisCompletionTests.cs (1)
199EditorTestWorkspace.CreateCSharp(code),
BlockCommentEditing\BlockCommentEditingTests.cs (3)
717protected override EditorTestWorkspace CreateTestWorkspace(string initialMarkup) 718=> EditorTestWorkspace.CreateCSharp(initialMarkup); 723internal override ICommandHandler<ReturnKeyCommandArgs> GetCommandHandler(EditorTestWorkspace workspace)
BlockCommentEditing\CloseBlockCommentTests.cs (3)
369protected override EditorTestWorkspace CreateTestWorkspace(string initialMarkup) 370=> EditorTestWorkspace.CreateCSharp(initialMarkup); 375internal override ICommandHandler<TypeCharCommandArgs> GetCommandHandler(EditorTestWorkspace workspace)
BraceHighlighting\BraceHighlightingTests.cs (2)
19protected override EditorTestWorkspace CreateWorkspace(string markup, ParseOptions options) 20=> EditorTestWorkspace.CreateCSharp(markup, parseOptions: options);
BraceMatching\CSharpBraceMatcherTests.cs (2)
17protected override EditorTestWorkspace CreateWorkspaceFromCode(string code, ParseOptions options) 18=> EditorTestWorkspace.CreateCSharp(code, options);
BracePairs\CSharpBracePairsTests.cs (2)
14protected override EditorTestWorkspace CreateWorkspace(string input) 15=> EditorTestWorkspace.CreateCSharp(input);
ChangeSignature\ChangeSignature_Delegates.cs (1)
20protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters)
ChangeSignature\RemoveParametersTests.cs (2)
365using var workspace = EditorTestWorkspace.Create(XElement.Parse("""
Classification\AbstractCSharpClassifierTests.cs (2)
17protected static EditorTestWorkspace CreateWorkspace(string code, ParseOptions options, TestHost testHost) 20return EditorTestWorkspace.CreateCSharp(code, parseOptions: options, composition: composition, isMarkup: false);
Classification\SemanticClassifierTests.cs (3)
36using var workspace = CreateWorkspace(code, options, testHost); 3918using var workspace = EditorTestWorkspace.CreateCSharp("");
Classification\SyntacticClassifierTests.cs (3)
23using var workspace = CreateWorkspace(code, options, testHost); 5673using var workspace = CreateWorkspace(source, options: null, TestHost.InProcess); 5701using var workspace = CreateWorkspace(source, options: null, TestHost.InProcess);
Classification\SyntacticTaggerTests.cs (4)
38using var workspace = EditorTestWorkspace.CreateCSharp(code); 90using var workspace = EditorTestWorkspace.CreateCSharp(code);
Classification\TotalClassifierTests.cs (5)
34using var workspace = CreateWorkspace(code, options, testHost); 3037using var workspace = EditorTestWorkspace.CreateCSharp("""" 3139using var workspace = EditorTestWorkspace.CreateCSharp(""""
CodeActions\AddUsing\AddUsingNuGetTests.cs (1)
34protected override void InitializeWorkspace(EditorTestWorkspace workspace, TestParameters parameters)
CodeActions\ApplyChangesOperationTests.cs (2)
22protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters) 239using var workspace = CreateWorkspaceFromOptions(workspaceXml, parameters);
CodeActions\ImplementInterface\ImplementExplicitlyTests.cs (1)
24protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters)
CodeActions\ImplementInterface\ImplementImplicitlyTests.cs (1)
26protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters)
CodeActions\InitializeParameter\InitializeMemberFromParameterTests.cs (1)
21protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters)
CodeActions\InitializeParameter\InitializeMemberFromPrimaryConstructorParameterTests.cs (1)
21protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters)
CodeActions\InlineMethod\CSharpInlineMethodTests_CrossLanguage.cs (2)
19protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters) 24var workspace = CreateWorkspaceFromOptions(initialMarkup);
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
916using var workspace = CreateWorkspaceFromOptions(originalCode);
CodeActions\PreviewExceptionTests.cs (8)
29using var workspace = CreateWorkspaceFromOptions("class D {}", new TestParameters()); 42using var workspace = CreateWorkspaceFromOptions("class D {}", new TestParameters()); 55using var workspace = CreateWorkspaceFromOptions("class D {}", new TestParameters()); 67private static async Task GetPreview(EditorTestWorkspace workspace, CodeRefactoringProvider provider) 75private static void DisplayText(EditorTestWorkspace workspace, CodeRefactoringProvider provider) 83private static async Task ActionSets(EditorTestWorkspace workspace, CodeRefactoringProvider provider) 91private static CodeRefactoringSuggestedAction CreateRefactoringSuggestedAction(EditorTestWorkspace workspace, CodeRefactoringProvider provider, out EditorLayerExtensionManager.ExtensionManager extensionManager) 103EditorTestWorkspace workspace, CodeRefactoringProvider provider, List<CodeAction> codeActions,
CodeActions\PreviewTests.cs (3)
40protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters) 91private async Task<(Document document, SolutionPreviewResult previews)> GetMainDocumentAndPreviewsAsync(TestParameters parameters, EditorTestWorkspace workspace) 110using var workspace = CreateWorkspaceFromOptions("class D {}", parameters);
CodeActions\PullMemberUp\CSharpPullMemberUpTests.cs (2)
30protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters) 44using var workspace = CreateWorkspaceFromOptions(initialMarkup, parametersValue);
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (6)
32protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters) 63using (var workspace = (EditorTestWorkspace)CreateWorkspaceFromOptions(initialMarkup, testOptions)) 108EditorTestWorkspace workspace, 141using (var workspace = CreateWorkspaceFromOptions(initialMarkUp, testOptions)) 220async Task<Tuple<Solution, Solution>> TestOperationAsync(TestParameters parameters, EditorTestWorkspace workspace)
CodeGeneration\SyntaxGeneratorTests.cs (4)
25using var workspace = EditorTestWorkspace.CreateCSharp(""" 59using var workspace = EditorTestWorkspace.CreateCSharp("""
CommentSelection\CSharpCommentSelectionTests.cs (2)
130using var workspace = EditorTestWorkspace.CreateCSharp(markup);
CommentSelection\CSharpToggleBlockCommentCommandHandlerTests.cs (3)
242internal override AbstractCommentSelectionBase<ValueTuple> GetToggleCommentCommandHandler(EditorTestWorkspace workspace) 248internal override EditorTestWorkspace GetWorkspace(string markup, TestComposition composition) 249=> EditorTestWorkspace.CreateCSharp(markup, composition: composition);
CommentSelection\CSharpToggleLineCommentCommandHandlerTests.cs (3)
1131internal override AbstractCommentSelectionBase<ValueTuple> GetToggleCommentCommandHandler(EditorTestWorkspace workspace) 1137internal override EditorTestWorkspace GetWorkspace(string markup, TestComposition composition) 1138=> EditorTestWorkspace.CreateCSharp(markup, composition: composition);
CompleteStatement\CSharpCompleteStatementCommandHandlerTests.cs (3)
4683internal override ICommandHandler GetCommandHandler(EditorTestWorkspace workspace) 4983protected override EditorTestWorkspace CreateTestWorkspace(string code) 4984=> EditorTestWorkspace.CreateCSharp(code);
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (3)
43protected override EditorTestWorkspace CreateWorkspace(string fileContents) 44=> EditorTestWorkspace.CreateCSharp(fileContents, composition: GetComposition()); 167using var workspace = CreateWorkspace(initialMarkup);
Completion\CompletionProviders\AbstractInteractiveCSharpCompletionProviderTests.cs (1)
14protected override EditorTestWorkspace CreateWorkspace(string fileContents)
Completion\CompletionProviders\CrefCompletionProviderTests.cs (2)
444using var workspace = EditorTestWorkspace.Create(LanguageNames.CSharp, new CSharpCompilationOptions(OutputKind.ConsoleApplication), new CSharpParseOptions(), [text], composition: GetComposition());
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (4)
687using var workspace = EditorTestWorkspace.CreateCSharp(markup, composition: GetComposition()); 1279using var workspace = EditorTestWorkspace.CreateCSharp(markup, composition: GetComposition());
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (12)
2463using var testWorkspace = EditorTestWorkspace.Create(xmlString, composition: GetComposition()); 2716using var testWorkspace = EditorTestWorkspace.Create(xmlString, composition: GetComposition()); 2771using var testWorkspace = EditorTestWorkspace.Create(xmlString, composition: GetComposition()); 3058using var workspace = EditorTestWorkspace.Create(LanguageNames.CSharp, new CSharpCompilationOptions(OutputKind.ConsoleApplication), new CSharpParseOptions(), [text], composition: GetComposition()); 3184using var workspace = EditorTestWorkspace.Create(text, composition: GetComposition()); 3222using var workspace = EditorTestWorkspace.Create(source, composition: GetComposition());
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (2)
372using var workspace = EditorTestWorkspace.CreateCSharp(code);
Completion\CompletionServiceTests.cs (1)
128using var workspace = new EditorTestWorkspace(composition: EditorTestCompositions.EditorFeatures.AddParts(typeof(ThirdPartyCompletionProvider)));
Debugging\DataTipInfoGetterTests.cs (2)
47using var workspace = EditorTestWorkspace.CreateCSharp(markup);
Debugging\LocationInfoGetterTests.cs (2)
24using var workspace = EditorTestWorkspace.CreateCSharp(markup, parseOptions);
Debugging\NameResolverTests.cs (4)
22using var workspace = EditorTestWorkspace.CreateCSharp(text); 33using var workspace = EditorTestWorkspace.CreateCSharp(" ");
Debugging\ProximityExpressionsGetterTests.cs (2)
71using var workspace = EditorTestWorkspace.CreateCSharp(markup);
DecompiledSource\DecompiledSourceFormattingTests.cs (2)
255using var workspace = EditorTestWorkspace.CreateCSharp(input);
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (20)
56using var workspace = EditorTestWorkspace.CreateCSharp(source, TestOptions.Regular, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService); 87using (var ideEngineWorkspace = EditorTestWorkspace.CreateCSharp(source, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService)) 104using var compilerEngineWorkspace = EditorTestWorkspace.CreateCSharp(source, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService); 123using var workspace = EditorTestWorkspace.CreateCSharp(source, TestOptions.Regular, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService); 162using var workspace = EditorTestWorkspace.CreateCSharp(TestResource.AllInOneCSharpCode, TestOptions.Regular, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService); 198using var workspace = EditorTestWorkspace.CreateCSharp(source, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService); 255using (var ideEngineWorkspace = EditorTestWorkspace.CreateCSharp(source, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService)) 277using (var compilerEngineWorkspace = EditorTestWorkspace.CreateCSharp(source, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService)) 337using var compilerEngineWorkspace = EditorTestWorkspace.CreateCSharp(source); 777using var workspace = EditorTestWorkspace.CreateCSharp("class Class { }", TestOptions.Regular, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService);
Diagnostics\MockDiagnosticAnalyzerTests.cs (2)
56using var workspace = EditorTestWorkspace.CreateCSharp(source, composition: GetComposition());
DocumentationComments\DocumentationCommentTests.cs (3)
2358internal override ICommandHandler CreateCommandHandler(EditorTestWorkspace workspace) 2363protected override EditorTestWorkspace CreateTestWorkspace(string code) 2364=> EditorTestWorkspace.CreateCSharp(code);
DocumentationComments\XmlTagCompletionTests.cs (3)
19private protected override IChainedCommandHandler<TypeCharCommandArgs> CreateCommandHandler(EditorTestWorkspace workspace) 22private protected override EditorTestWorkspace CreateTestWorkspace(string initialMarkup) 23=> EditorTestWorkspace.CreateCSharp(initialMarkup);
EditAndContinue\ActiveStatementTrackingServiceTests.cs (1)
31using var workspace = new EditorTestWorkspace();
EncapsulateField\EncapsulateFieldCommandHandlerTests.cs (2)
194using var workspace = EditorTestWorkspace.Create(XElement.Parse("""
EncapsulateField\EncapsulateFieldTestState.cs (4)
27public EditorTestWorkspace Workspace { get; } 31public EncapsulateFieldTestState(EditorTestWorkspace workspace) 44var workspace = EditorTestWorkspace.CreateCSharp(markup, composition: EditorTestCompositions.EditorFeatures);
ExtractInterface\ExtractInterfaceTests.cs (2)
1441using var workspace = EditorTestWorkspace.Create(XElement.Parse("""
ExtractMethod\ExtractMethodBase.cs (13)
36using var workspace = EditorTestWorkspace.CreateCSharp(codeWithMarker, parseOptions: parseOptions); 47using var workspace = EditorTestWorkspace.CreateCSharp(codeWithMarker, parseOptions: parseOptions); 67using var workspace = EditorTestWorkspace.CreateCSharp(codeWithMarker); 81using var workspace = EditorTestWorkspace.CreateCSharp(codeWithMarker, parseOptions: parseOptions); 114EditorTestWorkspace workspace, 163using var workspace = EditorTestWorkspace.CreateCSharp(codeWithMarker, parseOptions: parseOptions); 189using var workspace = EditorTestWorkspace.CreateCSharp(code, CodeAnalysis.CSharp.Test.Utilities.TestOptions.Regular);
ExtractMethod\ExtractMethodTests.cs (2)
11229using var workspace = EditorTestWorkspace.Create(XElement.Parse("""
ExtractMethod\MiscTests.cs (2)
129using var workspace = EditorTestWorkspace.CreateCSharp(markupCode, composition: EditorTestCompositions.EditorFeaturesWpf);
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandlerTests.cs (6)
25private static EditorTestWorkspace CreateTestWorkspace(string inputMarkup) 27var workspace = EditorTestWorkspace.CreateCSharp(inputMarkup); 34private static (string quoteCharSnapshotText, int quoteCharCaretPosition) TypeQuoteChar(EditorTestWorkspace workspace) 60using var workspace = CreateTestWorkspace(inputMarkup); 79using var workspace = CreateTestWorkspace(inputMarkup);
Formatting\CodeCleanupTests.cs (8)
796using var workspace = EditorTestWorkspace.CreateCSharp(code, composition: EditorTestCompositions.EditorFeaturesWpf.AddParts(typeof(TCodefix))); 833using var workspace = GetTestWorkspaceForLanguage(language); 843static EditorTestWorkspace GetTestWorkspaceForLanguage(string language) 847return EditorTestWorkspace.CreateCSharp(string.Empty, composition: EditorTestCompositions.EditorFeaturesWpf); 852return EditorTestWorkspace.CreateVisualBasic(string.Empty, composition: EditorTestCompositions.EditorFeaturesWpf); 885using var workspace = EditorTestWorkspace.CreateCSharp(code, composition: EditorTestCompositions.EditorFeaturesWpf);
Formatting\CSharpNewDocumentFormattingServiceTests.cs (2)
33protected override EditorTestWorkspace CreateTestWorkspace(string testCode, ParseOptions? parseOptions) 34=> EditorTestWorkspace.CreateCSharp(testCode, parseOptions);
Formatting\FormattingEngineTests.cs (4)
436using var workspace = EditorTestWorkspace.CreateCSharp(code); 2915using var workspace = EditorTestWorkspace.CreateCSharp(code, parseOptions: parseOptions);
Formatting\Indentation\CSharpFormatterTestsBase.cs (5)
48EditorTestWorkspace workspace, 60EditorTestWorkspace workspace, 71private static async Task TokenFormatWorkerAsync(EditorTestWorkspace workspace, ITextBuffer buffer, int indentationLine, char ch, bool useTabs) 110using var workspace = EditorTestWorkspace.CreateCSharp(code, composition: s_composition);
Formatting\Indentation\SmartIndenterEnterOnTokenTests.cs (4)
1399using var workspace = EditorTestWorkspace.CreateCSharp(code); 1439using var workspace = EditorTestWorkspace.CreateCSharp(code);
Formatting\Indentation\SmartIndenterTests.cs (6)
3458using var workspace = EditorTestWorkspace.CreateCSharp(markup, parseOptions: option, composition: s_compositionWithTestFormattingRules); 3514using var workspace = EditorTestWorkspace.CreateCSharp(code, parseOptions: option); 3543using var workspace = EditorTestWorkspace.CreateCSharp(code, parseOptions: option);
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (4)
3372using var workspace = EditorTestWorkspace.CreateCSharp(markup); 3406using var workspace = EditorTestWorkspace.CreateCSharp(initialMarkup);
Formatting\Indentation\SmartTokenFormatterFormatTokenTests.cs (2)
611using var workspace = EditorTestWorkspace.CreateCSharp(code);
GenerateConstructorFromMembers\GenerateConstructorFromMembersTests.cs (1)
23protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters)
InlineDiagnostics\InlineDiagnosticsTaggerProviderTests.cs (5)
39using var workspace = EditorTestWorkspace.CreateCSharp(content, composition: SquiggleUtilities.WpfCompositionWithSolutionCrawler); 45using var workspace = EditorTestWorkspace.CreateCSharp( 53private static async Task<ImmutableArray<TagSpan<InlineDiagnosticsTag>>> GetTagSpansAsync(EditorTestWorkspace workspace)
Intents\IntentTestsBase.cs (5)
33using var workspace = EditorTestWorkspace.CreateCSharp(priorDocumentText, composition: EditorTestCompositions.EditorFeatures); 60using var workspace = EditorTestWorkspace.CreateCSharp(documentSet, composition: EditorTestCompositions.EditorFeatures); 94EditorTestWorkspace workspace,
Interactive\BraceMatching\InteractiveBraceHighlightingTests.cs (9)
31EditorTestWorkspace workspace, 53using var workspace = EditorTestWorkspace.CreateCSharp(code, parseOptions: TestOptions.Script); 81using var workspace = EditorTestWorkspace.CreateCSharp(code, TestOptions.Script); 110using var workspace = EditorTestWorkspace.CreateCSharp(code, parseOptions: TestOptions.Script); 166using var workspace = EditorTestWorkspace.CreateCSharp(code, parseOptions: TestOptions.Script);
Interactive\NavigateTo\InteractiveNavigateToTests.cs (2)
25protected override EditorTestWorkspace CreateWorkspace(string content, TestComposition composition) 26=> EditorTestWorkspace.CreateCSharp(content, parseOptions: Options.Script, composition: composition);
KeywordHighlighting\AbstractCSharpKeywordHighlighterTests.cs (2)
17protected override EditorTestWorkspace CreateWorkspaceFromFile(string code, ParseOptions options) 18=> EditorTestWorkspace.CreateCSharp(code, options, composition: Composition);
LineSeparators\LineSeparatorTests.cs (2)
597using var workspace = EditorTestWorkspace.CreateCSharp(contents, options);
MoveToNamespace\MoveToNamespaceTests.cs (4)
1255using var workspace = EditorTestWorkspace.CreateCSharp(code, composition: s_compositionWithoutOptions); 1410using var workspace = EditorTestWorkspace.Create(System.Xml.Linq.XElement.Parse(input), composition: s_composition, openDocuments: false);
NavigateTo\NavigateToSearcherTests.cs (13)
120using var workspace = EditorTestWorkspace.CreateCSharp(""); 155using var workspace = EditorTestWorkspace.CreateCSharp(""); 195using var workspace = EditorTestWorkspace.CreateCSharp(""); 232using var workspace = EditorTestWorkspace.CreateCSharp(""); 269using var workspace = EditorTestWorkspace.CreateCSharp(""); 300using var workspace = EditorTestWorkspace.Create(""" 393private sealed class TestNavigateToSearchResult(EditorTestWorkspace workspace, TextSpan sourceSpan)
NavigateTo\NavigateToTests.cs (22)
27protected override EditorTestWorkspace CreateWorkspace(string content, TestComposition composition) 28=> EditorTestWorkspace.CreateCSharp(content, composition: composition); 1297using var workspace = EditorTestWorkspace.Create(""" 1378using var workspace = EditorTestWorkspace.Create(""" 1410using var workspace = EditorTestWorkspace.Create(""" 1443using var workspace = EditorTestWorkspace.Create(""" 1473using var workspace = EditorTestWorkspace.Create(""" 1506using var workspace = EditorTestWorkspace.Create(""" 1540using var workspace = EditorTestWorkspace.Create(""" 1565using var workspace = EditorTestWorkspace.Create(""" 1591using var workspace = EditorTestWorkspace.Create(""" 1616using var workspace = EditorTestWorkspace.CreateCSharp(
ObsoleteSymbol\CSharpObsoleteSymbolTests.cs (2)
14protected override EditorTestWorkspace CreateWorkspace(string markup) 15=> EditorTestWorkspace.CreateCSharp(markup);
Organizing\AbstractOrganizerTests.cs (2)
28using var workspace = EditorTestWorkspace.CreateCSharp(initial, options);
Organizing\OrganizeTypeDeclarationTests.cs (2)
1167using var workspace = EditorTestWorkspace.Create(XElement.Parse("""
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (4)
127using var workspace = (EditorTestWorkspace)project.Solution.Workspace; 218var workspace = EditorTestWorkspace.Create(@$"
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (20)
54var workspace = (EditorTestWorkspace)project.Solution.Workspace; 93var workspace = (EditorTestWorkspace)project.Solution.Workspace; 135var workspace = (EditorTestWorkspace)project.Solution.Workspace; 164var workspace = EditorTestWorkspace.Create(@$" 231var workspace = EditorTestWorkspace.Create(@$" 292var workspace = EditorTestWorkspace.Create(@$" 347var workspace = EditorTestWorkspace.Create(@$" 398var workspace = EditorTestWorkspace.Create(@$" 463var workspace = EditorTestWorkspace.Create(@$" 521var workspace = EditorTestWorkspace.Create(@$"
PdbSourceDocument\PdbSourceDocumentTests.cs (16)
478var workspace = EditorTestWorkspace.Create(@$" 525var workspace = EditorTestWorkspace.Create(@$" 879using var workspace = (EditorTestWorkspace)project.Solution.Workspace; 930var workspace = EditorTestWorkspace.Create(@$" 969using var workspace = (EditorTestWorkspace)project.Solution.Workspace; 994using var workspace = (EditorTestWorkspace)project.Solution.Workspace; 1020using var workspace = (EditorTestWorkspace)project.Solution.Workspace; 1045using var workspace = (EditorTestWorkspace)project.Solution.Workspace;
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (5)
178protected static async Task AssertContentIsAsync(EditorTestWorkspace workspace, Document document, int position, string expectedDescription, 189private static async Task<QuickInfoItem> GetQuickinfo(EditorTestWorkspace workspace, Document document, int position) 197protected static async Task AssertNoContentAsync(EditorTestWorkspace workspace, Document document, int position) 209using var workspace = EditorTestWorkspace.CreateCSharp(code, parseOptions);
QuickInfo\SemanticQuickInfoSourceTests.cs (11)
30using var workspace = EditorTestWorkspace.CreateCSharp(markup, options); 36using var workspace = EditorTestWorkspace.CreateCSharp(markup, compilationOptions: options); 40private static async Task TestWithOptionsAsync(EditorTestWorkspace workspace, params Action<QuickInfoItem>[] expectedResults) 118using var workspace = EditorTestWorkspace.Create(xmlString); 270using var workspace = EditorTestWorkspace.Create(xmlString); 6285using var workspace = EditorTestWorkspace.Create(XElement.Parse(workspaceDefinition), workspaceKind: WorkspaceKind.Interactive);
QuickInfo\SyntacticQuickInfoSourceTests.cs (4)
534EditorTestWorkspace workspace, 543EditorTestWorkspace workspace, 601using var workspace = EditorTestWorkspace.CreateCSharp(code, parseOptions);
ReassignedVariable\CSharpReassignedVariableTests.cs (2)
15protected override EditorTestWorkspace CreateWorkspace(string markup) 16=> EditorTestWorkspace.CreateCSharp(markup);
SpellCheck\SpellCheckFixerProviderTests.cs (2)
15protected override EditorTestWorkspace CreateWorkspace(string content) 16=> EditorTestWorkspace.CreateCSharp(content);
SpellCheck\SpellCheckSpanTests.cs (2)
16protected override EditorTestWorkspace CreateWorkspace(string content) 17=> EditorTestWorkspace.CreateCSharp(content);
SplitComment\SplitCommentCommandHandlerTests.cs (2)
16protected override EditorTestWorkspace CreateWorkspace(string markup) 17=> EditorTestWorkspace.CreateCSharp(markup);
SplitStringLiteral\SplitStringLiteralCommandHandlerTests.cs (2)
52using var workspace = EditorTestWorkspace.Create(workspaceXml);
SymbolKey\SymbolKeyTests.cs (8)
41using var workspace = EditorTestWorkspace.Create(workspaceXml); 76using var workspace = EditorTestWorkspace.Create(workspaceXml); 115using var workspace = EditorTestWorkspace.Create(workspaceXml); 161using var workspace = EditorTestWorkspace.Create(workspaceXml);
TaskList\CSharpTaskListTests.cs (2)
16protected override EditorTestWorkspace CreateWorkspace(string codeWithMarker, TestComposition composition) 17=> EditorTestWorkspace.CreateCSharp(codeWithMarker, composition: composition);
TaskList\NoCompilationTaskListTests.cs (3)
28protected override EditorTestWorkspace CreateWorkspace(string codeWithMarker, TestComposition composition) 30var workspace = EditorTestWorkspace.CreateWorkspace(XElement.Parse(
TextStructureNavigation\TextStructureNavigatorTests.cs (4)
25protected override EditorTestWorkspace CreateWorkspace(string code) 26=> EditorTestWorkspace.CreateCSharp(code); 507using var workspace = EditorTestWorkspace.CreateCSharp(code, options);
Workspaces\WorkspaceTests_EditorFeatures.cs (53)
35private static EditorTestWorkspace CreateWorkspace( 44private static async Task WaitForWorkspaceOperationsToComplete(EditorTestWorkspace workspace) 56using var workspace = CreateWorkspace(); 84using var workspace = CreateWorkspace(); 100using var workspace = CreateWorkspace(); 115using var workspace = CreateWorkspace(); 131using var workspace = CreateWorkspace(); 142using var workspace = CreateWorkspace(); 156using var workspace = CreateWorkspace(); 183using var workspace = CreateWorkspace(); 213using var workspace = CreateWorkspace(); 240private static async Task VerifyRootTypeNameAsync(EditorTestWorkspace workspaceSnapshotBuilder, string typeName) 259using var workspace = CreateWorkspace(); 273using var workspace = CreateWorkspace(); 295using var workspace = CreateWorkspace(); 312using var workspace = CreateWorkspace(); 334using var workspace = CreateWorkspace(); 351using var workspace = CreateWorkspace(); 368using var workspace = CreateWorkspace(); 383using var workspace = CreateWorkspace(); 402using var workspace = CreateWorkspace(); 421using var workspace = CreateWorkspace(); 445using var workspace = CreateWorkspace(); 474using var workspace = CreateWorkspace(composition: EditorTestCompositions.EditorFeatures.AddParts(typeof(TestWorkspaceConfigurationService))); 532using var workspace = CreateWorkspace(disablePartialSolutions: false); 595using var workspace = CreateWorkspace(disablePartialSolutions: false, composition: composition); 692using var workspace = CreateWorkspace(); 717using var workspace = CreateWorkspace(); 750using var workspace = CreateWorkspace(); 772using var workspace = CreateWorkspace(); 793using var workspace = CreateWorkspace(); 861using var workspace = EditorTestWorkspace.Create(workspaceElement, composition: EditorTestCompositions.EditorFeatures); 924using var workspace = CreateWorkspace(); 985using var workspace = CreateWorkspace(); 1046using var workspace = CreateWorkspace(); 1070using var workspace = CreateWorkspace(); 1094using var workspace = CreateWorkspace(); 1130using var workspace = CreateWorkspace(); 1163using var workspace = CreateWorkspace(); 1194using var workspace = CreateWorkspace(); 1223using var workspace = CreateWorkspace(); 1261using var workspace = CreateWorkspace(); 1297using var workspace = CreateWorkspace(); 1327using var workspace = CreateWorkspace(); 1355using var workspace = CreateWorkspace(); 1376using var workspace = CreateWorkspace(); 1409using var workspace = EditorTestWorkspace.Create(input, composition: EditorTestCompositions.EditorFeatures, openDocuments: true); 1462using var workspace1 = CreateWorkspace(); 1481using var workspace2 = CreateWorkspace(); 1490using var primaryWorkspace = CreateWorkspace(); 1491using var secondaryWorkspace = CreateWorkspace();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (152)
AbstractCommandHandlerTestState.cs (2)
28public readonly EditorTestWorkspace Workspace; 62Workspace = EditorTestWorkspace.CreateWorkspace(
AbstractTypingCommandHandlerTest.cs (4)
22internal abstract ICommandHandler<TCommandArgs> GetCommandHandler(EditorTestWorkspace workspace); 24protected abstract EditorTestWorkspace CreateTestWorkspace(string initialMarkup); 28protected void Verify(string initialMarkup, string expectedMarkup, Action<EditorTestWorkspace> initializeWorkspace = null) 30using var workspace = CreateTestWorkspace(initialMarkup);
AutomaticCompletion\AbstractAutomaticBraceCompletionTests.cs (3)
145internal static Holder CreateSession(EditorTestWorkspace workspace, char opening, char closing, OptionsCollection globalOptions = null) 169public EditorTestWorkspace Workspace { get; } 172public Holder(EditorTestWorkspace workspace, IBraceCompletionSession session)
AutomaticCompletion\AbstractAutomaticLineEnderTests.cs (4)
26protected abstract Action CreateNextHandler(EditorTestWorkspace workspace); 28internal abstract IChainedCommandHandler<AutomaticLineEnderCommandArgs> GetCommandHandler(EditorTestWorkspace workspace); 73using var workspace = EditorTestWorkspace.Create(Language, compilationOptions: null, parseOptions: null, [markupCode], composition: EditorTestCompositions.EditorFeaturesWpf);
BraceHighlighting\AbstractBraceHighlightingTests.cs (3)
36using var workspace = CreateWorkspace(text, options); 57internal virtual IBraceMatchingService GetBraceMatchingService(EditorTestWorkspace workspace) 60protected abstract EditorTestWorkspace CreateWorkspace(string markup, ParseOptions options);
BraceHighlighting\MultiCharacterBraceHighlightingTests.cs (3)
22protected override EditorTestWorkspace CreateWorkspace(string markup, ParseOptions options) 23=> EditorTestWorkspace.Create( 26internal override IBraceMatchingService GetBraceMatchingService(EditorTestWorkspace workspace)
BraceMatching\AbstractBraceMatcherTests.cs (2)
21protected abstract EditorTestWorkspace CreateWorkspaceFromCode(string code, ParseOptions options); 25using var workspace = CreateWorkspaceFromCode(markup, options);
BracePairs\AbstractBracePairsTests.cs (2)
24protected abstract EditorTestWorkspace CreateWorkspace(string input); 28using var workspace = CreateWorkspace(test);
CodeLens\AbstractCodeLensTest.cs (8)
22using var workspace = EditorTestWorkspace.Create(input); 50using var workspace = EditorTestWorkspace.Create(input); 76using var workspace = EditorTestWorkspace.Create(input); 102using var workspace = EditorTestWorkspace.Create(input);
CommentSelection\AbstractToggleCommentTestBase.cs (4)
27internal abstract AbstractCommentSelectionBase<ValueTuple> GetToggleCommentCommandHandler(EditorTestWorkspace workspace); 29internal abstract EditorTestWorkspace GetWorkspace(string markup, TestComposition composition); 36using var workspace = GetWorkspace(markup, composition: EditorTestCompositions.EditorFeatures); 53using var workspace = GetWorkspace(subjectBufferMarkup, composition: EditorTestCompositions.EditorFeatures);
CompleteStatement\AbstractCompleteStatementTests.cs (6)
25internal abstract ICommandHandler GetCommandHandler(EditorTestWorkspace workspace); 27protected abstract EditorTestWorkspace CreateTestWorkspace(string code); 76protected void ExecuteTest(IWpfTextView view, EditorTestWorkspace workspace) 97Action<IWpfTextView, EditorTestWorkspace> execute, 98Action<EditorTestWorkspace>? setOptions = null) 100using var workspace = CreateTestWorkspace(initialMarkup);
Completion\AbstractCompletionProviderTests.cs (5)
117protected abstract EditorTestWorkspace CreateWorkspace(string fileContents); 895using var testWorkspace = EditorTestWorkspace.Create(xmlString, composition: GetComposition()); 1040using var workspace = CreateWorkspace(markup); 1089using var workspace = CreateWorkspace(initialMarkup);
Diagnostics\DiagnosticTaggerWrapper.cs (2)
26private readonly EditorTestWorkspace _workspace; 33EditorTestWorkspace workspace,
Diagnostics\GenerateType\GenerateTypeTestState.cs (2)
20public EditorTestWorkspace Workspace { get; } 28EditorTestWorkspace workspace,
DocumentationComments\AbstractDocumentationCommentTests.cs (4)
27internal abstract ICommandHandler CreateCommandHandler(EditorTestWorkspace workspace); 29protected abstract EditorTestWorkspace CreateTestWorkspace(string code); 126Action<EditorTestWorkspace, IWpfTextView, IEditorOperationsFactoryService> execute, 132using var workspace = CreateTestWorkspace(initialMarkup);
DocumentationComments\AbstractXmlTagCompletionTests.cs (3)
23private protected abstract IChainedCommandHandler<TypeCharCommandArgs> CreateCommandHandler(EditorTestWorkspace testWorkspace); 24private protected abstract EditorTestWorkspace CreateTestWorkspace(string initialMarkup); 28using var workspace = CreateTestWorkspace(initialMarkup);
ExtractInterface\ExtractInterfaceTestState.cs (5)
27public EditorTestWorkspace Workspace { get; } 41var workspace = languageName == LanguageNames.CSharp 42? EditorTestWorkspace.CreateCSharp(markup, composition: Composition, compilationOptions: compilationOptions, parseOptions: parseOptions) 43: EditorTestWorkspace.CreateVisualBasic(markup, composition: Composition, compilationOptions: compilationOptions, parseOptions: parseOptions); 50public ExtractInterfaceTestState(EditorTestWorkspace workspace)
Formatting\AbstractNewDocumentFormattingServiceTests.cs (2)
21protected abstract EditorTestWorkspace CreateTestWorkspace(string testCode, ParseOptions? parseOptions); 25using var workspace = CreateTestWorkspace(testCode, parseOptions);
Formatting\CoreFormatterTestsBase.cs (7)
70EditorTestWorkspace workspace, 132using var workspace = CreateWorkspace(codeWithMarker, parseOptions); 157private EditorTestWorkspace CreateWorkspace(string codeWithMarker, ParseOptions parseOptions = null) 159? EditorTestWorkspace.CreateCSharp(codeWithMarker, composition: s_composition, parseOptions: parseOptions) 160: EditorTestWorkspace.CreateVisualBasic(codeWithMarker, composition: s_composition, parseOptions: parseOptions); 179using var workspace = CreateWorkspace(code); 240using var workspace = CreateWorkspace(codeWithMarker);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (2)
31protected abstract EditorTestWorkspace CreateWorkspaceFromFile(string code, ParseOptions options); 43using var workspace = CreateWorkspaceFromFile(markup, options);
LanguageServer\AbstractLanguageServerProtocolTests.cs (13)
329private async Task<TestLspServer> CreateTestLspServerAsync(EditorTestWorkspace workspace, InitializationOptions initializationOptions, string languageName) 376internal EditorTestWorkspace CreateWorkspace( 379var workspace = new EditorTestWorkspace( 392protected static async Task WaitForWorkspaceOperationsAsync(EditorTestWorkspace workspace) 398private static IAsynchronousOperationWaiter GetWorkspaceWaiter(EditorTestWorkspace workspace) 421protected static async Task<AnalyzerReference> AddGeneratorAsync(ISourceGenerator generator, EditorTestWorkspace workspace) 435protected static async Task RemoveGeneratorAsync(AnalyzerReference reference, EditorTestWorkspace workspace) 446internal static async Task<Dictionary<string, IList<LSP.Location>>> GetAnnotatedLocationsAsync(EditorTestWorkspace workspace, Solution solution) 535public readonly EditorTestWorkspace TestWorkspace; 545EditorTestWorkspace testWorkspace, 581internal static async Task<TestLspServer> CreateAsync(EditorTestWorkspace testWorkspace, InitializationOptions initializationOptions, AbstractLspLogger logger) 612internal static async Task<TestLspServer> CreateAsync(EditorTestWorkspace testWorkspace, LSP.ClientCapabilities clientCapabilities, RoslynLanguageServer target, Stream clientStream) 627private static RoslynLanguageServer CreateLanguageServer(Stream inputStream, Stream outputStream, EditorTestWorkspace workspace, WellKnownLspServerKinds serverKind, AbstractLspLogger logger)
NavigateTo\AbstractNavigateToTests.cs (14)
70protected abstract EditorTestWorkspace CreateWorkspace(string content, TestComposition composition); 80private protected static NavigateToItemProvider CreateProvider(EditorTestWorkspace workspace) 87protected async Task TestAsync(TestHost testHost, Composition composition, string content, Func<EditorTestWorkspace, Task> body) 100protected async Task TestAsync(TestHost testHost, Composition composition, XElement content, Func<EditorTestWorkspace, Task> body) 114string content, Func<EditorTestWorkspace, Task> body, TestHost testHost, 117using var workspace = CreateWorkspace(content, testHost, composition); 122XElement content, Func<EditorTestWorkspace, Task> body, TestHost testHost, 125using var workspace = CreateWorkspace(content, testHost, composition); 129private protected EditorTestWorkspace CreateWorkspace( 136var workspace = EditorTestWorkspace.Create(workspaceElement, composition: composition); 141private protected EditorTestWorkspace CreateWorkspace( 148var workspace = CreateWorkspace(content, composition); 153internal void InitializeWorkspace(EditorTestWorkspace workspace)
ObsoleteSymbol\AbstractObsoleteSymbolTests.cs (2)
21protected abstract EditorTestWorkspace CreateWorkspace(string markup); 25using var workspace = CreateWorkspace(markup);
QuickInfo\AbstractQuickInfoSourceTests.cs (2)
47EditorTestWorkspace workspace, 52EditorTestWorkspace workspace,
ReassignedVariable\AbstractReassignedVariableTests.cs (2)
20protected abstract EditorTestWorkspace CreateWorkspace(string markup); 24using var workspace = CreateWorkspace(markup);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (5)
346using var testWorkspace = EditorTestWorkspace.Create(xmlString); 374EditorTestWorkspace workspace, 465using var testWorkspace = EditorTestWorkspace.Create(xmlString);
SpellCheck\AbstractSpellCheckFixerProviderTests.cs (2)
21protected abstract EditorTestWorkspace CreateWorkspace(string content); 34using var workspace = CreateWorkspace(content);
SpellCheck\AbstractSpellCheckSpanTests.cs (2)
21protected abstract EditorTestWorkspace CreateWorkspace(string content); 25using var workspace = CreateWorkspace(content);
Squiggles\SquiggleUtilities.cs (1)
31EditorTestWorkspace workspace,
Squiggles\TestDiagnosticTagProducer.cs (1)
21EditorTestWorkspace workspace,
TaskList\AbstractTaskListTests.cs (3)
22protected EditorTestWorkspace CreateWorkspace(string codeWithMarker, TestHost host) 25protected abstract EditorTestWorkspace CreateWorkspace(string codeWithMarker, TestComposition testComposition); 29using var workspace = CreateWorkspace(codeWithMarker, host);
TextStructureNavigation\AbstractTextStructureNavigationTests.cs (2)
20protected abstract EditorTestWorkspace CreateWorkspace(string code); 26using var workspace = CreateWorkspace(code);
Workspaces\CSharpTestWorkspaceFixture.cs (2)
14protected override EditorTestWorkspace CreateWorkspace(TestComposition composition = null) 16return EditorTestWorkspace.CreateWithSingleEmptySourceFile(
Workspaces\EditorTestHostDocument.cs (2)
144var workspace = (EditorTestWorkspace?)LanguageServiceProvider?.WorkspaceServices.Workspace;
Workspaces\EditorTestHostProject.cs (2)
48EditorTestWorkspace workspace, 78EditorTestWorkspace workspace,
Workspaces\EditorTestWorkspace_Create.cs (13)
14public static EditorTestWorkspace Create(string xmlDefinition, bool openDocuments = false, TestComposition composition = null) 17public static EditorTestWorkspace CreateWorkspace( 26internal static EditorTestWorkspace Create( 34var workspace = new EditorTestWorkspace(composition, workspaceKind, ignoreUnchangeableDocumentsWhenApplyingChanges: ignoreUnchangeableDocumentsWhenApplyingChanges); 43internal static EditorTestWorkspace Create( 56internal static EditorTestWorkspace Create( 67internal static EditorTestWorkspace Create( 77internal static EditorTestWorkspace Create( 96internal static EditorTestWorkspace CreateWithSingleEmptySourceFile( 115public static EditorTestWorkspace CreateCSharp( 127public static EditorTestWorkspace CreateCSharp( 144public static EditorTestWorkspace CreateVisualBasic( 155public static EditorTestWorkspace CreateVisualBasic(
Workspaces\InteractiveCSharpTestWorkspaceFixture.cs (3)
14internal static EditorTestWorkspace CreateInteractiveWorkspace(string fileContent, TestComposition composition) 24return EditorTestWorkspace.Create(XElement.Parse(workspaceDefinition), composition: composition, workspaceKind: WorkspaceKind.Interactive); 27protected override EditorTestWorkspace CreateWorkspace(TestComposition composition = null)
Workspaces\TestWorkspaceFixture.cs (6)
21private EditorTestWorkspace _workspace; 26public EditorTestWorkspace GetWorkspace(TestComposition composition = null) 32public EditorTestWorkspace GetWorkspace(string markup, TestComposition composition = null, string workspaceKind = null) 42_workspace = EditorTestWorkspace.CreateWorkspace(XElement.Parse(markup), composition: composition, workspaceKind: workspaceKind); 51var workspace = GetWorkspace(composition); 57protected abstract EditorTestWorkspace CreateWorkspace(TestComposition composition);
Workspaces\VisualBasicTestWorkspaceFixture.cs (2)
14protected override EditorTestWorkspace CreateWorkspace(TestComposition composition = null) 16return EditorTestWorkspace.CreateWithSingleEmptySourceFile(
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (75)
CodeFixes\CodeFixServiceTests.cs (16)
82using var workspace = tuple.workspace; 108using var workspace = tuple.workspace; 139using var workspace = tuple.workspace; 175using var workspace = tuple.workspace; 205using var workspace = tuple.workspace; 285using var workspace = tuple.workspace; 312using var workspace = tuple.workspace; 327private static (EditorTestWorkspace workspace, DiagnosticAnalyzerService analyzerService, CodeFixService codeFixService, IErrorLoggerService errorLogger) ServiceSetup( 335private static (EditorTestWorkspace workspace, DiagnosticAnalyzerService analyzerService, CodeFixService codeFixService, IErrorLoggerService errorLogger) ServiceSetup( 347var workspace = EditorTestWorkspace.CreateCSharp(code, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService, openDocuments: true); 378EditorTestWorkspace workspace, 387EditorTestWorkspace workspace, 882using var workspace = tuple.workspace; 899using var workspace2 = tuple.workspace; 1036using var workspace = tuple.workspace;
CommentSelection\ToggleBlockCommentCommandHandlerTests.cs (3)
1501internal override AbstractCommentSelectionBase<ValueTuple> GetToggleCommentCommandHandler(EditorTestWorkspace workspace) 1507internal override EditorTestWorkspace GetWorkspace(string markup, TestComposition composition) 1508=> EditorTestWorkspace.CreateCSharp(markup, composition: composition);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (5)
504using var workspace = EditorTestWorkspace.CreateCSharp("class A {}", composition: s_editorFeaturesCompositionWithMockDiagnosticUpdateSourceRegistrationService.AddParts(typeof(TestDocumentTrackingService))); 614using var workspace = new EditorTestWorkspace(composition); 854using var workspace = EditorTestWorkspace.CreateCSharp("// This file will get a diagnostic", composition: s_featuresCompositionWithMockDiagnosticUpdateSourceRegistrationService.WithTestHostParts(testHost));
FindReferences\FindReferencesCommandHandlerTests.cs (2)
61using var workspace = EditorTestWorkspace.CreateCSharp("class C { C() { new C(); } }");
Formatting\InferredIndentationTests.cs (6)
24using var testWorkspace = CreateWithLines( 34using var testWorkspace = CreateWithLines( 48using var testWorkspace = CreateWithLines( 59private static EditorTestWorkspace CreateWithLines(params string[] lines) 61var workspace = EditorTestWorkspace.CreateCSharp(string.Join("\r\n", lines), openDocuments: true);
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (5)
48protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters) 55using var workspace = EditorTestWorkspace.Create(WorkspaceXml, composition: EditorTestCompositions.EditorFeaturesWpf); 74using var workspace = EditorTestWorkspace.Create(WorkspaceXml);
RenameTracking\RenameTrackingTestState.cs (7)
40public readonly EditorTestWorkspace Workspace; 60var workspace = CreateTestWorkspace(markup, languageName); 70var workspace = CreateTestWorkspace(workspaceXml); 75EditorTestWorkspace workspace, 120private static EditorTestWorkspace CreateTestWorkspace(string code, string languageName) 130private static EditorTestWorkspace CreateTestWorkspace(string xml) 132return EditorTestWorkspace.Create(xml, composition: EditorTestCompositions.EditorFeaturesWpf);
Structure\StructureTaggerTests.cs (17)
56using var workspace = EditorTestWorkspace.CreateCSharp(code, composition: EditorTestCompositions.EditorFeaturesWpf); 123using var workspace = EditorTestWorkspace.CreateCSharp(code, composition: EditorTestCompositions.EditorFeaturesWpf); 168using var workspace = EditorTestWorkspace.CreateCSharp(code, composition: EditorTestCompositions.EditorFeaturesWpf); 213using var workspace = EditorTestWorkspace.CreateCSharp(code, composition: EditorTestCompositions.EditorFeaturesWpf); 265using var workspace = EditorTestWorkspace.CreateVisualBasic(code, composition: EditorTestCompositions.EditorFeaturesWpf); 321using var workspace = EditorTestWorkspace.CreateVisualBasic(code, composition: EditorTestCompositions.EditorFeaturesWpf); 343using var workspace = EditorTestWorkspace.CreateVisualBasic(code, composition: EditorTestCompositions.EditorFeaturesWpf); 375using var workspace = EditorTestWorkspace.CreateCSharp(code, composition: EditorTestCompositions.EditorFeaturesWpf); 396private static async Task<List<IContainerStructureTag>> GetTagsFromWorkspaceAsync(EditorTestWorkspace workspace)
Tagging\AsynchronousTaggerTests.cs (10)
43using var workspace = EditorTestWorkspace.CreateCSharp(""" 98using var workspace = EditorTestWorkspace.CreateCSharp(""" 120using var workspace = EditorTestWorkspace.CreateCSharp(""" 146using var workspace = EditorTestWorkspace.CreateCSharp(""" 202using var workspace = EditorTestWorkspace.CreateCSharp("""
TextEditor\TryGetDocumentTests.cs (4)
24using var workspace = EditorTestWorkspace.CreateCSharp(code); 52using var workspace = EditorTestWorkspace.CreateCSharp(code);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (8)
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (1)
155private static void VerifyValuesInServer(EditorTestWorkspace workspace, List<string> expectedValues)
VSTypeScriptHandlerTests.cs (2)
95var testWorkspace = CreateWorkspace(options, mutatingLspWorkspace: false, workspaceKind: null); 105private static RoslynLanguageServer CreateLanguageServer(Stream inputStream, Stream outputStream, EditorTestWorkspace workspace)
Workspaces\LspWorkspaceManagerTests.cs (5)
301using var testWorkspaceTwo = EditorTestWorkspace.Create( 365using var testWorkspaceTwo = CreateWorkspace(options: null, WorkspaceKind.MSBuild, mutatingLspWorkspace); 424using var testWorkspaceTwo = CreateWorkspace(options: null, workspaceKind: WorkspaceKind.MSBuild, mutatingLspWorkspace); 470using var testWorkspace = CreateWorkspace(options: null, workspaceKind: null, mutatingLspWorkspace);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (20)
CodeModel\AbstractFileCodeElementTests.cs (4)
25private (EditorTestWorkspace workspace, FileCodeModel fileCodeModel)? _workspaceAndCodeModel; 32public (EditorTestWorkspace workspace, FileCodeModel fileCodeModel) WorkspaceAndCodeModel 40protected EditorTestWorkspace GetWorkspace() 59protected static (EditorTestWorkspace workspace, FileCodeModel fileCodeModel) CreateWorkspaceAndFileCodeModelAsync(string file)
CodeModel\FileCodeModelTestHelpers.cs (3)
29public static (EditorTestWorkspace workspace, EnvDTE.FileCodeModel fileCodeModel) CreateWorkspaceAndFileCodeModel(string file) 31var workspace = EditorTestWorkspace.CreateCSharp(file, composition: CodeModelTestHelpers.Composition);
CodeModel\MockInvisibleEditor.cs (2)
15private readonly EditorTestWorkspace _workspace; 17public MockInvisibleEditor(DocumentId document, EditorTestWorkspace workspace)
DocumentOutline\DocumentOutlineTestsBase.cs (5)
43private readonly EditorTestWorkspace _workspace; 49EditorTestWorkspace workspace, 79var workspace = EditorTestWorkspace.CreateCSharp(code, composition: s_composition); 97private async Task<TestLspServer> CreateTestLspServerAsync(EditorTestWorkspace workspace)
Options\OptionViewModelTests.cs (6)
52using var workspace = EditorTestWorkspace.CreateCSharp(""); 75using var workspace = EditorTestWorkspace.CreateCSharp(""); 89using var workspace = EditorTestWorkspace.CreateCSharp("");
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (11)
CallHierarchy\CallHierarchyTestState.vb (4)
28Friend ReadOnly Workspace As EditorTestWorkspace 85Private Sub New(workspace As EditorTestWorkspace) 106Dim workspace = EditorTestWorkspace.Create(markup, composition:=VisualStudioTestCompositions.LanguageServices.AddParts(additionalTypes)) 111Dim workspace = EditorTestWorkspace.CreateCSharp(markup, composition:=VisualStudioTestCompositions.LanguageServices.AddParts(additionalTypes))
CodeModel\CodeModelTestHelpers.vb (1)
52Dim workspace = EditorTestWorkspace.Create(definition, composition:=Composition)
CodeModel\CodeModelTestState.vb (2)
14Public ReadOnly Workspace As EditorTestWorkspace 21workspace As EditorTestWorkspace,
CodeModel\Mocks\MockVisualStudioWorkspace.vb (4)
28Private _workspace As EditorTestWorkspace 37Public Sub SetWorkspace(testWorkspace As EditorTestWorkspace) 97Private ReadOnly _workspace As EditorTestWorkspace 100Public Sub New(documentId As DocumentId, workspace As EditorTestWorkspace)
Microsoft.VisualStudio.LanguageServices.UnitTests (86)
AbstractTextViewFilterTests.vb (9)
38Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices) 75Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices) 105Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices) 137Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices) 167Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices) 202Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices) 233Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices) 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)
ChangeSignature\AddParameterViewModelTests.vb (1)
299Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
459Using workspace = EditorTestWorkspace.Create(workspaceXml)
ClassView\SyncClassViewTests.vb (1)
870Using workspace = EditorTestWorkspace.Create(workspaceDefinition, composition:=VisualStudioTestCompositions.LanguageServices)
CodeModel\AbstractEventCollectorTests.vb (1)
103Using workspace = EditorTestWorkspace.Create(definition, composition:=VisualStudioTestCompositions.LanguageServices)
CodeModel\CSharp\FileCodeModelTests.vb (1)
1017Using changedWorkspace = EditorTestWorkspace.Create(changedDefinition, composition:=CodeModelTestHelpers.Composition)
CodeModel\CSharp\SyntaxNodeKeyTests.vb (1)
230Using workspace = EditorTestWorkspace.Create(definition, composition:=VisualStudioTestCompositions.LanguageServices)
CodeModel\VisualBasic\FileCodeModelTests.vb (1)
1014Using changedworkspace = EditorTestWorkspace.Create(changedDefinition, composition:=CodeModelTestHelpers.Composition)
CommonControls\MemberSelectionViewModelTests.vb (1)
175Using workspace = EditorTestWorkspace.Create(workspaceXml)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
228Using workspace = EditorTestWorkspace.Create(workspaceXml)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (7)
44Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition) 72Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition) 90Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition) 116Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition) 152Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition) 191Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition) 223Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition)
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
291Using workspace = EditorTestWorkspace.Create(workspaceXml)
GenerateType\GenerateTypeViewModelTests.vb (1)
838Using workspace = EditorTestWorkspace.Create(workspaceXml)
GoToDefinition\GoToDefinitionApiTests.vb (1)
21Using workspace = EditorTestWorkspace.Create(workspaceDefinition, composition:=GoToTestHelpers.Composition)
InheritanceMargin\InheritanceMarginViewModelTests.vb (1)
79Using workspace = EditorTestWorkspace.Create(workspaceFile)
LanguageBlockTests.vb (2)
251Using workspace = EditorTestWorkspace.Create(xml, composition:=composition) 269Using workspace = EditorTestWorkspace.Create(xml)
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (1)
25Using workspace = EditorTestWorkspace.Create(workspaceXml)
ObjectBrowser\AbstractObjectBrowserTests.vb (1)
41Dim workspace = EditorTestWorkspace.Create(definition, composition:=CodeModelTestHelpers.Composition)
ObjectBrowser\Helpers.vb (2)
18Private ReadOnly _workspace As EditorTestWorkspace 22Public Sub New(workspace As EditorTestWorkspace, visualStudioWorkspace As VisualStudioWorkspace, libraryManager As AbstractObjectBrowserLibraryManager)
Preview\PreviewChangesTests.vb (3)
79Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=s_composition) 185Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=s_composition) 268Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=s_composition)
Progression\ProgressionTestState.vb (3)
16Public ReadOnly Workspace As EditorTestWorkspace 18Public Sub New(workspace As EditorTestWorkspace) 23Dim workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices)
PullMemberUp\PullMemberUpViewModelTest.vb (1)
247Using workspace = EditorTestWorkspace.Create(workspaceXml)
ReferenceManager\VisualStudioMetadataReferenceManagerTests.vb (1)
18Using workspace = EditorTestWorkspace.CreateCSharp("")
RQName\RQNameTests.vb (1)
242Using workspace = EditorTestWorkspace.Create(workspaceXml)
Snippets\CSharpSnippetExpansionClientTests.vb (3)
308Using workspace = EditorTestWorkspace.Create(workspaceXml, openDocuments:=False, composition:=VisualStudioTestCompositions.LanguageServices) 329Using workspace = EditorTestWorkspace.Create(workspaceXmlWithSubjectBufferDocument, composition:=VisualStudioTestCompositions.LanguageServices) 374Using workspace = EditorTestWorkspace.CreateCSharp(originalCode, composition:=VisualStudioTestCompositions.LanguageServices)
Snippets\VisualBasicSnippetExpansionClientTests.vb (3)
350Using workspace = EditorTestWorkspace.Create(workspaceXml, openDocuments:=False, composition:=VisualStudioTestCompositions.LanguageServices) 395Using workspace = EditorTestWorkspace.Create(workspaceXml, composition:=VisualStudioTestCompositions.LanguageServices) 425Using workspace = EditorTestWorkspace.Create(workspaceXmlWithSubjectBufferDocument, composition:=VisualStudioTestCompositions.LanguageServices)
SolutionExplorer\AnalyzerItemsSourceTests.vb (1)
25Using workspace = EditorTestWorkspace.Create(workspaceXml)
SolutionExplorer\AnalyzerItemTests.vb (2)
24Using workspace = EditorTestWorkspace.Create(workspaceXml) 43Using workspace = EditorTestWorkspace.Create(workspaceXml)
SolutionExplorer\AnalyzersFolderItemTests.vb (2)
23Using workspace = EditorTestWorkspace.Create(workspaceXml) 41Using workspace = EditorTestWorkspace.Create(workspaceXml)
SolutionExplorer\CpsDiagnosticItemSourceTests.vb (1)
29Using workspace = EditorTestWorkspace.Create(workspaceXml)
SolutionExplorer\SourceGeneratorItemTests.vb (10)
29Using workspace = EditorTestWorkspace.Create(workspaceXml) 50Using workspace = EditorTestWorkspace.Create(workspaceXml) 76Using workspace = EditorTestWorkspace.Create(workspaceXml) 111Using workspace = EditorTestWorkspace.Create(workspaceXml) 140Using workspace = EditorTestWorkspace.Create( 181Using workspace = EditorTestWorkspace.Create( 240Using workspace = EditorTestWorkspace.Create(workspaceXml) 267Private Shared Function CreateItemSourceForAnalyzerReference(workspace As EditorTestWorkspace, projectId As ProjectId) As BaseDiagnosticAndGeneratorItemSource 279Private Shared Function CreateSourceGeneratedFilesItemSource(workspace As EditorTestWorkspace, generatorItem As SourceGeneratorItem) As Shell.IAttachedCollectionSource 285Private Shared Function WaitForGeneratorsAndItemSourcesAsync(workspace As EditorTestWorkspace) As Task
Venus\AbstractContainedLanguageCodeSupportTests.vb (4)
32Using workspace = EditorTestWorkspace.Create( 46Protected Function GetWorkspace(code As String) As EditorTestWorkspace 47Return EditorTestWorkspace.Create( 57Protected Function GetDocument(workspace As EditorTestWorkspace) As Document
Venus\DocumentService_IntegrationTests.vb (6)
67Using workspace = EditorTestWorkspace.Create(input, composition:=composition, documentServiceProvider:=TestDocumentServiceProvider.Instance) 137Using workspace = EditorTestWorkspace.Create(input, documentServiceProvider:=TestDocumentServiceProvider.Instance) 181Using workspace = EditorTestWorkspace.Create(input, documentServiceProvider:=TestDocumentServiceProvider.Instance, ignoreUnchangeableDocumentsWhenApplyingChanges:=ignoreUnchangeableDocuments) 221Using workspace = EditorTestWorkspace.Create(input, composition:=s_compositionWithMockDiagnosticUpdateSourceRegistrationService, documentServiceProvider:=TestDocumentServiceProvider.Instance) 273Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, EditorTestWorkspace) 311Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, EditorTestWorkspace)
Venus\DocumentServiceTests.vb (8)
27Using workspace = EditorTestWorkspace.Create( 51Using workspace = EditorTestWorkspace.Create( 83Using workspace = EditorTestWorkspace.Create( 106Using workspace = EditorTestWorkspace.Create( 127Using workspace = EditorTestWorkspace.Create( 165Using workspace = EditorTestWorkspace.Create( 204Using workspace = EditorTestWorkspace.Create( 261Using workspace = EditorTestWorkspace.Create(
VsNavInfo\VsNavInfoTests.vb (2)
825Using workspace = EditorTestWorkspace.Create(workspaceDefinition, composition:=VisualStudioTestCompositions.LanguageServices) 863Using workspace = EditorTestWorkspace.Create(workspaceDefinition, composition:=VisualStudioTestCompositions.LanguageServices)