Skip to content

Commit 1eaf35e

Browse files
author
Eli Dowling
committed
Added test for DU hover fix
1 parent eb2169c commit 1eaf35e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

sample/MainProject/Hover.fs

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@ let aliasedFunc:intFunc = (multiply 1 2)
2222
///``b``: b thing
2323
let docedFunction a b=
2424
a+b
25-
let methodTest=Authorization("a")
25+
let methodTest=Authorization("a")
26+
27+
type DUHover=
28+
|HoverCase of string

tests/Expecto/FsharpLanguageServer/ServerTests.fs

+8-1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ let serverTests=
216216
| None -> failtest "noHover"
217217
| Some hover -> Expect.isNonEmpty hover.contents "Hover list is empty"
218218
}
219+
//See issue #106
220+
test "hover over DU aginst pipe" {
221+
let client, server = createServerAndReadFile("MainProject", "Hover.fs")
222+
match server.Hover(textDocumentPosition("MainProject", "Hover.fs", 28, 10)) |> Async.RunSynchronously with
223+
| None -> failtest "No hover"
224+
| Some hover -> Expect.isNonEmpty hover.contents "Hover list is empty"
225+
}
219226

220227
let labels(items: CompletionItem list) =
221228
[for i in items do yield i.label]
@@ -425,7 +432,7 @@ let serverTests=
425432
test "report no type errors in CSharp reference" {
426433
let client, server = createServerAndReadFile("ReferenceCSharp", "Library.fs")
427434
let messages = diagnosticMessages(client)
428-
Expect.isEmpty messages "got type errors"
435+
Expect.isEmpty messages (sprintf "got type errors: %A" messages)
429436
}
430437
test "Report no errors opening project using net6.0-windows framework" {
431438
//This test is to fix issues with net6.0-windows and isssues discovering frameworks that should be imported based on packages.

0 commit comments

Comments
 (0)