Skip to content
Merged
Changes from all commits
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
11 changes: 10 additions & 1 deletion src/FSharpLanguageServer/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,21 @@ let private findSignatureImplementation(parse: FSharpParseFileResults, name: str

/// Find functions annotated with [<Test>]
let private testFunctions(parse: FSharpParseFileResults): (string list * Ast.SynBinding) list =
let (|XunitTest|_|) str =
match str with
| "Fact" | "Xunit.FactAttribute"
| "Theory" | "Xunit.TheoryAttribute" -> Some true
| _ -> None
let (|NUnitTest|_|) str =
match str with
| "Test" | "NUnit.Framework.Test" -> Some true
| _ -> None
let isTestAttribute(a: Ast.SynAttribute): bool =
let ids = a.TypeName.Lid
let string = String.concat "." [for i in ids do yield i.idText]
match string with
// TODO check for open NUnit.Framework before accepting plain "Test"
| "Test" | "NUnit.Framework.Test" -> true
| NUnitTest _ | XunitTest _ -> true
| _ -> false
let isTestFunction(binding: Ast.SynBinding): bool =
let attrs = match binding with Ast.Binding(_, _, _, _, attrs, _, _, _, _, _, _, _) -> attrs
Expand Down