ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
412 stars 154 forks source link

Add support for Expecto theory tests #1160

Closed Numpsy closed 1 year ago

Numpsy commented 1 year ago

WHAT

Add support for Expecto 'theory' tests

WHY

https://github.com/haf/expecto/issues/445#issuecomment-1705428537

HOW

Added extra cases to the list (to begin with, see other comments)

Numpsy commented 1 year ago

As it stands, this change alone doesn't pick up the theory tests -

The issue seems to be that in visitExpr it picks up the new test cases, but then doesn't add it to the list of tests because the type of the expression is ArrayOrListComputed instead of one of the expected types:

image

I don't know enough about it to say how it should be changed - e.g. just add a | Case, SynExpr.ArrayOrListComputed to the logic? Add a Theory type to go along side Case and List and look for the Array parameter to that?

edit: or maybe it needs another | SynExpr.App case that matches the 3 parameters to the testTheory call more explicitly?

TheAngryByrd commented 1 year ago

FYI I fixed the AST stuff in https://github.com/fsharp/FsAutoComplete/commit/ad2e8ac9f3d80260fb352c5e7d87dad4387ebf7a because yeah that stuff can get gnarly.

Numpsy commented 1 year ago

Ok, VSCode is highlighting all my theory tests in the editor now with Ionide 7.11 :-)