2 instantiations of TestLspServer
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
546var server = new TestLspServer(testWorkspace, locations, initializationOptions.ClientCapabilities, languageServer, clientStream); 564var server = new TestLspServer(testWorkspace, locations, clientCapabilities, target, clientStream);
365 references to TestLspServer
IdeBenchmarks (1)
Lsp\LspCompletionBenchmarks.cs (1)
22private TestLspServer? _testServer;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (13)
LanguageServer\AbstractLanguageServerProtocolTests.cs (13)
295private protected Task<TestLspServer> CreateTestLspServerAsync(string markup, LSP.ClientCapabilities clientCapabilities, bool callInitialized = true) 298private protected Task<TestLspServer> CreateTestLspServerAsync(string markup, InitializationOptions? initializationOptions = null) 301private protected Task<TestLspServer> CreateTestLspServerAsync(string[] markups, InitializationOptions? initializationOptions = null) 304private protected Task<TestLspServer> CreateVisualBasicTestLspServerAsync(string markup, InitializationOptions? initializationOptions = null) 307private Task<TestLspServer> CreateTestLspServerAsync(string[] markups, string languageName, InitializationOptions? initializationOptions) 318private async Task<TestLspServer> CreateTestLspServerAsync(TestWorkspace workspace, InitializationOptions initializationOptions) 347return await TestLspServer.CreateAsync(workspace, initializationOptions, TestOutputLspLogger); 350private protected async Task<TestLspServer> CreateXmlTestLspServerAsync( 366return await TestLspServer.CreateAsync(workspace, lspOptions, TestOutputLspLogger); 539internal static async Task<TestLspServer> CreateAsync(TestWorkspace testWorkspace, InitializationOptions initializationOptions, ILspServiceLogger logger) 546var server = new TestLspServer(testWorkspace, locations, initializationOptions.ClientCapabilities, languageServer, clientStream); 561internal static async Task<TestLspServer> CreateAsync(TestWorkspace testWorkspace, LSP.ClientCapabilities clientCapabilities, RoslynLanguageServer target, Stream clientStream) 564var server = new TestLspServer(testWorkspace, locations, clientCapabilities, target, clientStream);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (347)
CodeActions\CodeActionResolveTests.cs (3)
37await using var testLspServer = await CreateTestLspServerAsync(initialMarkup); 88await using var testLspServer = await CreateTestLspServerAsync(initialMarkup); 139TestLspServer testLspServer,
CodeActions\CodeActionsTests.cs (4)
50await using var testLspServer = await CreateTestLspServerAsync(markup); 83await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 119await using var testLspServer = await CreateTestLspServerAsync(markup); 149TestLspServer testLspServer,
CodeActions\RunCodeActionsTests.cs (2)
46await using var testLspServer = await CreateTestLspServerAsync(markup); 62TestLspServer testLspServer,
CodeLens\AbstractCodeLensTests.cs (1)
21private protected static async Task VerifyCodeLensAsync(TestLspServer testLspServer, int expectedNumberOfReferences, bool isCapped = false)
CodeLens\CSharpCodeLensTests.cs (12)
31await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 50await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 70await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 93await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 107await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 118await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 130await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 142await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 156await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 167await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 181await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 190await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions);
CodeLens\VisualBasicCodeLensTests.cs (12)
29await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 42await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 56await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 66await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 76await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 87await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 98await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 110await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 122await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 132await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 144await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 154await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup);
Completion\CompletionResolveTests.cs (11)
60await using var testLspServer = await CreateTestLspServerAsync(markup, clientCapabilities); 85await using var testLspServer = await CreateTestLspServerAsync(markup, new LSP.VSInternalClientCapabilities { SupportsVisualStudioExtensions = true }); 109await using var testLspServer = await CreateTestLspServerAsync(markup, new LSP.VSInternalClientCapabilities { SupportsVisualStudioExtensions = true }); 151await using var testLspServer = await CreateTestLspServerAsync(markup, clientCapabilities); 180await using var testLspServer = await CreateTestLspServerAsync(markup); 243await using var testLspServer = await CreateTestLspServerAsync(markup, clientCapabilities); 305await using var testLspServer = await CreateTestLspServerAsync(markup); 340await using var testLspServer = await CreateTestLspServerAsync(markup, new LSP.VSInternalClientCapabilities { SupportsVisualStudioExtensions = true }); 349private static async Task<LSP.CompletionItem> RunResolveCompletionItemAsync(TestLspServer testLspServer, LSP.CompletionItem completionItem) 386TestLspServer testLspServer, 406TestLspServer testLspServer,
Completion\CompletionTests.cs (33)
74await using var testLspServer = await CreateTestLspServerAsync(markup, clientCapabilities); 121await using var testLspServer = await CreateTestLspServerAsync(markup, clientCapabilities); 154await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 182await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 209await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 234await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 259await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 293await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 317await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 345await using var testLspServer = await CreateTestLspServerAsync(markup); 370await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 407await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 444await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 496await using var testLspServer = await CreateTestLspServerAsync(markup, clientCapabilities); 528await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 591await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 622await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 650await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 676await using var testLspServer = await CreateTestLspServerAsync(markup); 703await using var testLspServer = await CreateTestLspServerAsync(markup); 755await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 807await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 860await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 926await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 992await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 1087await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 1151await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 1210await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 1282await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 1336await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 1376await using var testLspServer = await CreateTestLspServerAsync(markup, s_vsCompletionCapabilities); 1391internal static Task<LSP.CompletionList> RunGetCompletionsAsync(TestLspServer testLspServer, LSP.CompletionParams completionParams) 1397private static CompletionListCache GetCompletionListCache(TestLspServer testLspServer)
Definitions\GoToDefinitionTests.cs (7)
37await using var testLspServer = await CreateTestLspServerAsync(markup); 64await using var testLspServer = await CreateTestLspServerAsync(markups); 82await using var testLspServer = await CreateTestLspServerAsync(string.Empty); 106await using var testLspServer = await CreateTestLspServerAsync(markup); 122await using var testLspServer = await CreateTestLspServerAsync(markup); 149await using var testLspServer = await CreateXmlTestLspServerAsync(markup); 155private static async Task<LSP.Location[]> RunGotoDefinitionAsync(TestLspServer testLspServer, LSP.Location caret)
Definitions\GoToTypeDefinitionTests.cs (4)
34await using var testLspServer = await CreateTestLspServerAsync(markup); 60await using var testLspServer = await CreateTestLspServerAsync(markups); 78await using var testLspServer = await CreateTestLspServerAsync(markup); 84private static async Task<LSP.Location[]> RunGotoTypeDefinitionAsync(TestLspServer testLspServer, LSP.Location caret)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (11)
56TestLspServer testLspServer, 77TestLspServer testLspServer, 101TestLspServer testLspServer, 165private protected static Task CloseDocumentAsync(TestLspServer testLspServer, Document document) => testLspServer.CloseDocumentAsync(document.GetURI()); 202TestLspServer testLspServer, 213private protected static Task OpenDocumentAsync(TestLspServer testLspServer, Document document) => testLspServer.OpenDocumentAsync(document.GetURI()); 216TestLspServer testLspServer, 227TestLspServer testLspServer, 297private protected Task<TestLspServer> CreateTestWorkspaceWithDiagnosticsAsync(string markup, BackgroundAnalysisScope scope, bool useVSDiagnostics, bool pullDiagnostics = true) 300private protected Task<TestLspServer> CreateTestWorkspaceWithDiagnosticsAsync(string[] markups, BackgroundAnalysisScope scope, bool useVSDiagnostics, bool pullDiagnostics = true) 303private protected Task<TestLspServer> CreateTestWorkspaceFromXmlAsync(string xmlMarkup, BackgroundAnalysisScope scope, bool useVSDiagnostics, bool pullDiagnostics = true)
Diagnostics\AdditionalFileDiagnosticsTests.cs (3)
38await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics); 67await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics); 110await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics: true);
Diagnostics\PullDiagnosticTests.cs (55)
42await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 56await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 77await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 115await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics: true); 140await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 163await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 191await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics, pullDiagnostics: false); 208await using var testLspServer = await CreateTestLspServerAsync(markup, 227await using var testLspServer = await CreateTestLspServerAsync(markup, 246await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 278await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 305await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 338await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 361await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 390await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 411await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 443await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 492await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics: false); 546await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 592await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 622await using var testLspServer = await CreateTestLspServerAsync(markup, 647await using var testLspServer = await CreateTestLspServerAsync(markup, 669await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics, pullDiagnostics: true); 701await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 740await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 766await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics); 801await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 815await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 834await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 850await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 880await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 903await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 928await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 957await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 984await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 999await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.FullSolution, useVSDiagnostics, pullDiagnostics: true); 1019await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(markup, BackgroundAnalysisScope.OpenFiles, useVSDiagnostics, pullDiagnostics: true); 1040await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 1063await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 1076await using var testLspServer = await CreateTestLspServerAsync( 1100await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 1132await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 1160await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 1193await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 1233await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 1254await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 1291await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 1363await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 1431await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 1494await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 1549await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 1605await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 1651await using var testLspServer = await CreateTestWorkspaceFromXmlAsync(workspaceXml, BackgroundAnalysisScope.FullSolution, useVSDiagnostics).ConfigureAwait(false); 1667await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync( 1691await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (2)
29await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(string.Empty, BackgroundAnalysisScope.FullSolution, useVSDiagnostics); 48await using var testLspServer = await CreateTestWorkspaceWithDiagnosticsAsync(string.Empty, BackgroundAnalysisScope.FullSolution, useVSDiagnostics);
DocumentChanges\DocumentChangesTests.cs (5)
323private async Task<(TestLspServer, LSP.Location, string)> GetTestLspServerAndLocationAsync(string source) 325var testLspServer = await CreateTestLspServerAsync(source, CapabilitiesWithVSExtensions); 332private static Task DidOpen(TestLspServer testLspServer, Uri uri) => testLspServer.OpenDocumentAsync(uri); 334private static async Task DidChange(TestLspServer testLspServer, Uri uri, params (int line, int column, string text)[] changes) 337private static async Task DidClose(TestLspServer testLspServer, Uri uri) => await testLspServer.CloseDocumentAsync(uri);
DocumentChanges\DocumentChangesTests.LinkedDocuments.cs (3)
31await using var testLspServer = await CreateXmlTestLspServerAsync(workspaceXml); 72await using var testLspServer = await CreateXmlTestLspServerAsync(workspaceXml); 102private static async Task<Solution> GetLSPSolutionAsync(TestLspServer testLspServer, Uri uri)
FoldingRanges\FoldingRangesTests.cs (4)
30await using var testLspServer = await CreateTestLspServerAsync(markup); 46await using var testLspServer = await CreateTestLspServerAsync(markup); 62await using var testLspServer = await CreateTestLspServerAsync(markup); 71private static async Task<LSP.FoldingRange[]> RunGetFoldingRangeAsync(TestLspServer testLspServer)
Formatting\FormatDocumentOnTypeTests.cs (3)
44await using var testLspServer = await CreateTestLspServerAsync(markup); 75await using var testLspServer = await CreateTestLspServerAsync(markup); 86TestLspServer testLspServer,
Formatting\FormatDocumentRangeTests.cs (3)
42await using var testLspServer = await CreateTestLspServerAsync(markup); 70await using var testLspServer = await CreateTestLspServerAsync(markup); 80TestLspServer testLspServer,
Formatting\FormatDocumentTests.cs (4)
43await using var testLspServer = await CreateTestLspServerAsync(markup); 71await using var testLspServer = await CreateTestLspServerAsync(markup); 99await using var testLspServer = await CreateTestLspServerAsync(markup); 109TestLspServer testLspServer,
Highlights\DocumentHighlightTests.cs (4)
40await using var testLspServer = await CreateTestLspServerAsync(markup); 65await using var testLspServer = await CreateTestLspServerAsync(markup); 89await using var testLspServer = await CreateTestLspServerAsync(markup); 95private static async Task<LSP.DocumentHighlight[]> RunGetDocumentHighlightAsync(TestLspServer testLspServer, LSP.Location caret)
Hover\HoverTests.cs (10)
40await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 64await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 87await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 115await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 138await using var testLspServer = await CreateTestLspServerAsync(markup); 187await using var testLspServer = await CreateXmlTestLspServerAsync(workspaceXml, initializationOptions: new InitializationOptions { ClientCapabilities = CapabilitiesWithVSExtensions }); 241await using var testLspServer = await CreateTestLspServerAsync(markup, clientCapabilities); 311await using var testLspServer = await CreateTestLspServerAsync(markup); 371await using var testLspServer = await CreateTestLspServerAsync(markup, clientCapabilities); 395TestLspServer testLspServer,
InlineCompletions\InlineCompletionsTests.cs (3)
248await using var testLspServer = await CreateTestLspServerAsync(markup); 273await using var testLspServer = await CreateTestLspServerAsync(markup); 290TestLspServer testLspServer,
LanguageServerTargetTests.cs (10)
33await using var server = await CreateTestLspServerAsync(""); 45await using var server = await CreateTestLspServerAsync(""); 57await using var server = await CreateTestLspServerAsync(""); 68await using var serverOne = await CreateTestLspServerAsync(""); 69await using var serverTwo = await CreateTestLspServerAsync(""); 84await using var server = await CreateTestLspServerAsync(""); 107await using var server = await CreateTestLspServerAsync("", new InitializationOptions { CallInitialized = false }); 124await using var server = await CreateTestLspServerAsync(""); 140private static void AssertServerAlive(TestLspServer server) 146private static async Task AssertServerQueueClosed(TestLspServer server)
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (10)
38await using var testLspServer = await CreateTestLspServerAsync(string.Empty, new InitializationOptions { ServerKind = WellKnownLspServerKinds.CSharpVisualBasicLspServer }); 61await using var testLspServer = await CreateTestLspServerAsync(string.Empty, new InitializationOptions { ServerKind = WellKnownLspServerKinds.CSharpVisualBasicLspServer }); 94await using var testLspServer = await CreateTestLspServerAsync(string.Empty, new InitializationOptions { ServerKind = WellKnownLspServerKinds.CSharpVisualBasicLspServer }); 119await using var testLspServer = await CreateTestLspServerAsync(markup, new InitializationOptions { ServerKind = WellKnownLspServerKinds.CSharpVisualBasicLspServer }); 140await using var testLspServer = await CreateTestLspServerAsync(string.Empty, new InitializationOptions { ServerKind = WellKnownLspServerKinds.CSharpVisualBasicLspServer }); 188await using var testLspServer = await CreateTestLspServerAsync(string.Empty, new InitializationOptions { ServerKind = WellKnownLspServerKinds.CSharpVisualBasicLspServer }); 205private static async Task AssertFileInMiscWorkspaceAsync(TestLspServer testLspServer, Uri fileUri) 211private static async Task AssertFileInMainWorkspaceAsync(TestLspServer testLspServer, Uri fileUri) 217private static Document? GetMiscellaneousDocument(TestLspServer testLspServer) 222private static async Task<LSP.Hover> RunGetHoverAsync(TestLspServer testLspServer, LSP.Location caret)
OnAutoInsert\OnAutoInsertTests.cs (4)
389Task<TestLspServer> testLspServerTask; 403await using var testLspServer = await testLspServerTask; 419await using var testLspServer = await CreateTestLspServerAsync(markup); 429TestLspServer testLspServer,
Options\LspOptionsTests.cs (2)
36await using var testLspServer = await CreateTestLspServerAsync(markup); 50await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup);
Ordering\RequestOrderingTests.cs (13)
43await using var testLspServer = await CreateTestLspServerAsync("class C { }"); 60await using var testLspServer = await CreateTestLspServerAsync("class C { }"); 77await using var testLspServer = await CreateTestLspServerAsync("class C { }"); 97await using var testLspServer = await CreateTestLspServerAsync("class C { }"); 117await using var testLspServer = await CreateTestLspServerAsync("class C { }"); 140await using var testLspServer = await CreateTestLspServerAsync("class C { }"); 172await using var testLspServer = await CreateTestLspServerAsync("class C { }"); 190await using var testLspServer = await CreateTestLspServerAsync("class C { {|caret:|} }"); 230await using var testLspServer = await CreateTestLspServerAsync("class C { {|caret:|} }"); 243private static async Task ExecuteDidOpen(TestLspServer testLspServer, Uri documentUri) 256private static async Task<Solution?> GetLSPSolution(TestLspServer testLspServer, string methodName) 271private static async Task<TestResponse[]> TestAsync(TestLspServer testLspServer, TestRequest[] requests) 285private static List<Task<TestResponse?>> StartTestRun(TestLspServer testLspServer, TestRequest[] requests, CancellationToken cancellationToken = default)
ProjectContext\GetTextDocumentWithContextHandlerTests.cs (4)
32await using var testLspServer = await CreateXmlTestLspServerAsync(workspaceXml); 58await using var testLspServer = await CreateXmlTestLspServerAsync(workspaceXml); 82await using var testLspServer = await CreateXmlTestLspServerAsync(workspaceXml); 102internal static async Task<LSP.VSProjectContextList?> RunGetProjectContext(TestLspServer testLspServer, Uri uri)
References\FindAllReferencesHandlerFeaturesTests.cs (1)
49await using var testLspServer = await CreateTestLspServerAsync(markup, new LSP.ClientCapabilities());
References\FindAllReferencesHandlerTests.cs (10)
50await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 86await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 136await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 179await using var testLspServer = await CreateTestLspServerAsync(markups, new InitializationOptions { ClientCapabilities = CapabilitiesWithVSExtensions }); 203await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 222await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 244await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 274await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 286await using var testLspServer = await CreateTestLspServerAsync(markup, CapabilitiesWithVSExtensions); 304internal static async Task<T[]> RunFindAllReferencesAsync<T>(TestLspServer testLspServer, LSP.Location caret, IProgress<object> progress = null)
References\FindImplementationsTests.cs (7)
39await using var testLspServer = await CreateTestLspServerAsync(markup); 68await using var testLspServer = await CreateTestLspServerAsync(markups); 88await using var testLspServer = await CreateTestLspServerAsync(string.Empty); 112await using var testLspServer = await CreateTestLspServerAsync(markup); 127await using var testLspServer = await CreateTestLspServerAsync(markup); 146await using var testLspServer = await CreateTestLspServerAsync(markup); 155private static async Task<LSP.Location[]> RunFindImplementationAsync(TestLspServer testLspServer, LSP.Location caret)
Rename\RenameTests.cs (6)
40await using var testLspServer = await CreateTestLspServerAsync(markup); 63await using var testLspServer = await CreateTestLspServerAsync(markup); 96await using var testLspServer = await CreateXmlTestLspServerAsync(workspaceXml); 142await using var testLspServer = await CreateXmlTestLspServerAsync(workspaceXml); 165await using var testLspServer = await CreateTestLspServerAsync(string.Empty); 198private static async Task<WorkspaceEdit> RunRenameAsync(TestLspServer testLspServer, LSP.RenameParams renameParams)
SemanticTokens\AbstractSemanticTokensTests.cs (2)
28private protected static async Task<LSP.SemanticTokens> RunGetSemanticTokensRangeAsync(TestLspServer testLspServer, LSP.Location caret, LSP.Range range) 51private protected static async Task VerifyBasicInvariantsAndNoMultiLineTokens(TestLspServer testLspServer, int[] tokens)
SemanticTokens\SemanticTokensRangeTests.cs (8)
36await using var testLspServer = await CreateTestLspServerAsync(markup); 58await using var testLspServer = await CreateTestLspServerAsync(markup); 93await using var testLspServer = await CreateTestLspServerAsync(markup); 128await using var testLspServer = await CreateTestLspServerAsync(markup); 170await using var testLspServer = await CreateTestLspServerAsync(markup); 203await using var testLspServer = await CreateTestLspServerAsync(markup); 256await using var testLspServer = await CreateTestLspServerAsync(markup); 324await using var testLspServer = await CreateTestLspServerAsync(markup);
SignatureHelp\SignatureHelpTests.cs (2)
42await using var testLspServer = await CreateTestLspServerAsync(markup); 54private static async Task<LSP.SignatureHelp?> RunGetSignatureHelpAsync(TestLspServer testLspServer, LSP.Location caret)
SpellCheck\SpellCheckTests.cs (19)
35await using var testLspServer = await CreateTestLspServerAsync(markup); 50await using var testLspServer = await CreateTestLspServerAsync(markup); 78await using var testLspServer = await CreateTestLspServerAsync(markup); 118await using var testLspServer = await CreateTestLspServerAsync(markup); 154await using var testLspServer = await CreateTestLspServerAsync(markup); 202await using var testLspServer = await CreateTestLspServerAsync(markup); 243await using var testLspServer = await CreateTestLspServerAsync(markup); 270await using var testLspServer = await CreateTestLspServerAsync(markup); 302await using var testLspServer = await CreateTestLspServerAsync(new[] { markup1, markup2 }); 336await using var testLspServer = await CreateXmlTestLspServerAsync(workspaceXml); 375await using var testLspServer = await CreateTestLspServerAsync(new[] { markup1, markup2 }); 413await using var testLspServer = await CreateTestLspServerAsync(new[] { markup1, markup2 }); 449await using var testLspServer = await CreateTestLspServerAsync(new[] { markup1, markup2 }); 502await using var testLspServer = await CreateTestLspServerAsync(new[] { markup1, markup2 }); 549private static Task OpenDocumentAsync(TestLspServer testLspServer, Document document) 552private static Task CloseDocumentAsync(TestLspServer testLspServer, Document document) 556TestLspServer testLspServer, 579TestLspServer testLspServer, 600TestLspServer testLspServer,
Symbols\DocumentSymbolsTests.cs (5)
44await using var testLspServer = await CreateTestLspServerAsync(markup, clientCapabilities); 65await using var testLspServer = await CreateTestLspServerAsync(markup); 89await using var testLspServer = await CreateTestLspServerAsync(markup); 97await using var testLspServer = await CreateTestLspServerAsync(string.Empty); 103private static async Task<TReturn> RunGetDocumentSymbolsAsync<TReturn>(TestLspServer testLspServer)
Symbols\WorkspaceSymbolsTests.cs (9)
38await using var testLspServer = await CreateTestLspServerAsync(markup); 58await using var testLspServer = await CreateTestLspServerAsync(markup); 84await using var testLspServer = await CreateTestLspServerAsync(markup); 107await using var testLspServer = await CreateTestLspServerAsync(markup); 132await using var testLspServer = await CreateTestLspServerAsync(markup); 164await using var testLspServer = await CreateTestLspServerAsync(markups); 185await using var testLspServer = await CreateTestLspServerAsync(markup); 199await using var testLspServer = await CreateVisualBasicTestLspServerAsync(markup); 209private static Task<LSP.SymbolInformation[]?> RunGetWorkspaceSymbolsAsync(TestLspServer testLspServer, string query, IProgress<LSP.SymbolInformation[]>? progress = null)
ValidateBreakableRange\ValidateBreakableRangeTests.cs (11)
34await using var testLspServer = await CreateTestLspServerAsync(markup); 57await using var testLspServer = await CreateTestLspServerAsync(markup); 78await using var testLspServer = await CreateTestLspServerAsync(markup); 97await using var testLspServer = await CreateTestLspServerAsync(markup); 118await using var testLspServer = await CreateTestLspServerAsync(markup); 140await using var testLspServer = await CreateTestLspServerAsync(markup); 163await using var testLspServer = await CreateTestLspServerAsync(markup); 190await using var testLspServer = await CreateTestLspServerAsync(markup); 213await using var testLspServer = await CreateTestLspServerAsync(markup); 235await using var testLspServer = await CreateTestLspServerAsync(markup); 245private static async Task<LSP.Range?> RunAsync(TestLspServer testLspServer, LSP.Location caret)
VSTypeScriptHandlerTests.cs (4)
47await using var testLspServer = await CreateTsTestLspServerAsync(workspaceXml); 71await using var testLspServer = await CreateTsTestLspServerAsync(workspaceXml, options); 83private async Task<TestLspServer> CreateTsTestLspServerAsync(string workspaceXml, InitializationOptions? options = null) 94return await TestLspServer.CreateAsync(testWorkspace, new ClientCapabilities(), languageServerTarget, clientStream);
Workspaces\LspWorkspaceManagerTests.cs (20)
32await using var testLspServer = await CreateTestLspServerAsync(markup); 59await using var testLspServer = await CreateTestLspServerAsync(new string[] { markupOne, markupTwo }); 98await using var testLspServer = await CreateTestLspServerAsync(new string[] { markupOne, markupTwo }); 126await using var testLspServer = await CreateTestLspServerAsync(markup); 150await using var testLspServer = await CreateTestLspServerAsync(markup); 174await using var testLspServer = await CreateTestLspServerAsync(markup); 199await using var testLspServer = await CreateTestLspServerAsync(markup, new InitializationOptions { ServerKind = WellKnownLspServerKinds.CSharpVisualBasicLspServer }); 253await using var testLspServer = await CreateXmlTestLspServerAsync(firstWorkspaceXml); 289await using var testLspServer = await CreateXmlTestLspServerAsync(firstWorkspaceXml, workspaceKind: WorkspaceKind.MiscellaneousFiles); 320await using var testLspServer = await CreateXmlTestLspServerAsync(firstWorkspaceXml); 379await using var testLspServer = await CreateXmlTestLspServerAsync(firstWorkspaceXml); 435await using var testLspServerOne = await TestLspServer.CreateAsync(testWorkspace, new InitializationOptions(), TestOutputLspLogger); 436await using var testLspServerTwo = await TestLspServer.CreateAsync(testWorkspace, new InitializationOptions(), TestOutputLspLogger); 469await using var testLspServer = await CreateTestLspServerAsync(markup); 484private static async Task<Document> OpenDocumentAndVerifyLspTextAsync(Uri documentUri, TestLspServer testLspServer, string openText = "LSP text") 495private static bool IsWorkspaceRegistered(Workspace workspace, TestLspServer testLspServer) 500private static async Task<(Workspace? workspace, Document? document)> GetLspWorkspaceAndDocumentAsync(Uri uri, TestLspServer testLspServer) 506private static Task<(Workspace?, Solution?)> GetLspHostWorkspaceAndSolutionAsync(TestLspServer testLspServer)
Workspaces\LspWorkspaceRegistrationServiceTests.cs (1)
27await using (var testLspServer = await CreateTestLspServerAsync(markup))
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
DocumentOutline\DocumentOutlineTestsBase.cs (3)
96var testLspServer = await CreateTestLspServerAsync(workspace, new InitializationOptions { ClientCapabilities = clientCapabilities }); 115private async Task<TestLspServer> CreateTestLspServerAsync(TestWorkspace workspace, InitializationOptions initializationOptions) 146return await TestLspServer.CreateAsync(workspace, initializationOptions, _logger);
Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests (1)
ProjectsHandlerTests.cs (1)
25await using var testLspServer = await CreateTestLspServerAsync(string.Empty);