diff --git a/test/FsAutoComplete.Tests.Lsp/FindReferencesTests.fs b/test/FsAutoComplete.Tests.Lsp/FindReferencesTests.fs index 320be417c..98b12a822 100644 --- a/test/FsAutoComplete.Tests.Lsp/FindReferencesTests.fs +++ b/test/FsAutoComplete.Tests.Lsp/FindReferencesTests.fs @@ -626,9 +626,9 @@ let tests state = rangeTests state ] -let tryFixupRangeTests (sourceTextFactoryName, sourceTextFactory: ISourceTextFactory) = +let tryFixupRangeTests (sourceTextFactory: ISourceTextFactory) = testList - ($"{nameof Tokenizer.tryFixupRange}.{sourceTextFactoryName}") + ($"{nameof Tokenizer.tryFixupRange}") [ let checker = lazy (FSharpChecker.Create()) let getSymbolUses (source: string) cursor = diff --git a/test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs b/test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs index b45c93e3d..433757289 100644 --- a/test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs +++ b/test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs @@ -1641,7 +1641,7 @@ open FSharp.UMX open FsAutoComplete.LspHelpers open Ionide.LanguageServerProtocol.Types -let explicitTypeInfoTests (sourceTextFactoryName, sourceTextFactory: ISourceTextFactory) = +let explicitTypeInfoTests (sourceTextFactory: ISourceTextFactory) = let file = "test.fsx" let checker = lazy (FSharpChecker.Create()) @@ -1797,7 +1797,7 @@ let explicitTypeInfoTests (sourceTextFactoryName, sourceTextFactory: ISourceText testSequenced <| testList - $"detect type and parens.{sourceTextFactoryName}" + $"detect type and parens" [ testList "Expr" [ testList diff --git a/test/FsAutoComplete.Tests.Lsp/Program.fs b/test/FsAutoComplete.Tests.Lsp/Program.fs index a58565b8e..9e09c51e9 100644 --- a/test/FsAutoComplete.Tests.Lsp/Program.fs +++ b/test/FsAutoComplete.Tests.Lsp/Program.fs @@ -41,10 +41,7 @@ let loaders = let adaptiveLspServerFactory toolsPath workspaceLoaderFactory sourceTextFactory = Helpers.createAdaptiveServer (fun () -> workspaceLoaderFactory toolsPath) sourceTextFactory -let lspServers = [ "AdaptiveLspServer", adaptiveLspServerFactory ] - -let sourceTextFactories: (string * ISourceTextFactory) list = - [ "RoslynSourceText", RoslynSourceTextFactory() ] +let sourceTextFactory: ISourceTextFactory = RoslynSourceTextFactory() let mutable toolsPath = Ionide.ProjInfo.Init.init (System.IO.DirectoryInfo Environment.CurrentDirectory) None @@ -53,68 +50,67 @@ let lspTests = testList "lsp" [ for (loaderName, workspaceLoaderFactory) in loaders do - for (lspName, lspFactory) in lspServers do - for (sourceTextName, sourceTextFactory) in sourceTextFactories do - - testList - $"{loaderName}.{lspName}.{sourceTextName}" - [ Templates.tests () - let createServer () = lspFactory toolsPath workspaceLoaderFactory sourceTextFactory - - initTests createServer - closeTests createServer - - Utils.Tests.Server.tests createServer - Utils.Tests.CursorbasedTests.tests createServer - - CodeLens.tests createServer - documentSymbolTest createServer - Completion.autocompleteTest createServer - Completion.autoOpenTests createServer - Completion.fullNameExternalAutocompleteTest createServer - foldingTests createServer - tooltipTests createServer - Highlighting.tests createServer - scriptPreviewTests createServer - scriptEvictionTests createServer - scriptProjectOptionsCacheTests createServer - dependencyManagerTests createServer - interactiveDirectivesUnitTests - - // commented out because FSDN is down - //fsdnTest createServer - - //linterTests createServer - uriTests - formattingTests createServer - analyzerTests createServer - signatureTests createServer - SignatureHelp.tests createServer - InlineHints.tests createServer - CodeFixTests.Tests.tests sourceTextFactory createServer - Completion.tests createServer - GoTo.tests createServer - - FindReferences.tests createServer - Rename.tests createServer - - InfoPanelTests.docFormattingTest createServer - DetectUnitTests.tests createServer - XmlDocumentationGeneration.tests createServer - InlayHintTests.tests createServer - DependentFileChecking.tests createServer - UnusedDeclarationsTests.tests createServer - EmptyFileTests.tests createServer - CallHierarchy.tests createServer ] ] + + testList + $"{loaderName}" + [ + Templates.tests () + let createServer () = + adaptiveLspServerFactory toolsPath workspaceLoaderFactory sourceTextFactory + + initTests createServer + closeTests createServer + + Utils.Tests.Server.tests createServer + Utils.Tests.CursorbasedTests.tests createServer + + CodeLens.tests createServer + documentSymbolTest createServer + Completion.autocompleteTest createServer + Completion.autoOpenTests createServer + Completion.fullNameExternalAutocompleteTest createServer + foldingTests createServer + tooltipTests createServer + Highlighting.tests createServer + scriptPreviewTests createServer + scriptEvictionTests createServer + scriptProjectOptionsCacheTests createServer + dependencyManagerTests createServer + interactiveDirectivesUnitTests + + // commented out because FSDN is down + //fsdnTest createServer + + //linterTests createServer + uriTests + formattingTests createServer + analyzerTests createServer + signatureTests createServer + SignatureHelp.tests createServer + InlineHints.tests createServer + CodeFixTests.Tests.tests sourceTextFactory createServer + Completion.tests createServer + GoTo.tests createServer + + FindReferences.tests createServer + Rename.tests createServer + + InfoPanelTests.docFormattingTest createServer + DetectUnitTests.tests createServer + XmlDocumentationGeneration.tests createServer + InlayHintTests.tests createServer + DependentFileChecking.tests createServer + UnusedDeclarationsTests.tests createServer + EmptyFileTests.tests createServer + CallHierarchy.tests createServer + ] ] /// Tests that do not require a LSP server -let generalTests = - testList - "general" - [ testList (nameof (Utils)) [ Utils.Tests.Utils.tests; Utils.Tests.TextEdit.tests ] - for (name, factory) in sourceTextFactories do - InlayHintTests.explicitTypeInfoTests (name, factory) - FindReferences.tryFixupRangeTests (name, factory) ] +let generalTests = testList "general" [ + testList (nameof (Utils)) [ Utils.Tests.Utils.tests; Utils.Tests.TextEdit.tests ] + InlayHintTests.explicitTypeInfoTests sourceTextFactory + FindReferences.tryFixupRangeTests sourceTextFactory +] [] let tests = testList "FSAC" [ generalTests; lspTests ]