ionide-vscode-fsharp
ionide-vscode-fsharp copied to clipboard
Type Providers in scripts don't work with SOURCE_DIRECTORY
In a script, if you use Paket to generate load scripts and then try to reference a literal path for a type provider, using SOURCE_DIRECTORY breaks intellisense.
#load ".paket/load/netcoreapp3.1/main.group.fsx"
open FSharp.Data
[<Literal>]
let DealSample = __SOURCE_DIRECTORY__ + "/sample.json"
type Deals = JsonProvider<DealSample> // Deals = Object
If you remove the __SOURCE_DIRECTORY__
bit and just use sample.json
, it all works with intellisense. However, at runtime it fails because FSI thinks that the current path is .paket/load/netcoreapp3.1
.
Using __SOURCE_DIRECTORY__
used to work, so this feels like a breaking change.
Hey @isaacabraham :wave:,
Thanks for backing our project. If possible, We will handle your
issue with priority support. To make sure we don't forget how special
you are, we added a backer
label to your issue.
Thanks again for backing us :tada:!
@baronfel any ideas? Does this sound like something with resolving correct FSharpProjectOptions for script files, or something like that?
Is this caused by https://github.com/dotnet/fsharp/issues/11610 ?