Skip to content

Commit

Permalink
Added test for DU hover fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Eli Dowling committed May 24, 2022
1 parent fb2ac39 commit 993a901
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion sample/MainProject/Hover.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ let aliasedFunc:intFunc = (multiply 1 2)
///``b``: b thing
let docedFunction a b=
a+b
let methodTest=Authorization("a")
let methodTest=Authorization("a")

type DUHover=
|HoverCase of string
9 changes: 8 additions & 1 deletion tests/Expecto/FsharpLanguageServer/ServerTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ let serverTests=
| None -> failtest "noHover"
| Some hover -> Expect.isNonEmpty hover.contents "Hover list is empty"
}
//See issue #106
test "hover over DU aginst pipe" {
let client, server = createServerAndReadFile("MainProject", "Hover.fs")
match server.Hover(textDocumentPosition("MainProject", "Hover.fs", 28, 10)) |> Async.RunSynchronously with
| None -> failtest "No hover"
| Some hover -> Expect.isNonEmpty hover.contents "Hover list is empty"
}

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

0 comments on commit 993a901

Please # to comment.