Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop ISourceTextFactory/IFSharpLspServer from test names #1205

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/FsAutoComplete.Tests.Lsp/FindReferencesTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ let tests state = testList "Find All References tests" [
]


let tryFixupRangeTests (sourceTextFactoryName, sourceTextFactory : ISourceTextFactory) = testList ($"{nameof Tokenizer.tryFixupRange}.{sourceTextFactoryName}") [
let tryFixupRangeTests (sourceTextFactory : ISourceTextFactory) = testList ($"{nameof Tokenizer.tryFixupRange}") [
let checker = lazy (FSharpChecker.Create())
let getSymbolUses (source : string) cursor = async {
let checker = checker.Value
Expand Down
4 changes: 2 additions & 2 deletions test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,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())

Expand Down Expand Up @@ -1798,7 +1798,7 @@ let explicitTypeInfoTests (sourceTextFactoryName, sourceTextFactory: ISourceText

testSequenced
<| testList
$"detect type and parens.{sourceTextFactoryName}"
$"detect type and parens"
[ testList
"Expr"
[ testList
Expand Down
122 changes: 56 additions & 66 deletions test/FsAutoComplete.Tests.Lsp/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +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
Expand All @@ -57,68 +50,65 @@ 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
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
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)
InlayHintTests.explicitTypeInfoTests sourceTextFactory
FindReferences.tryFixupRangeTests sourceTextFactory
]

[<Tests>]
Expand Down
Loading