Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to support FAKE 5 script files? #558

Closed
matthid opened this issue Sep 23, 2017 · 6 comments
Closed

How to support FAKE 5 script files? #558

matthid opened this issue Sep 23, 2017 · 6 comments
Labels
bug language services Problems related to language services - FSAC or FCS

Comments

@matthid
Copy link
Contributor

matthid commented Sep 23, 2017

Assume you start with FAKE5 with the following script.fsx

(* -- Fake Dependencies paket-inline
source https://nuget.org/api/v2
storage: none
generate_load_scripts: true

nuget Fake.Core.Targets prerelease
-- Fake Dependencies -- *)
#if !FAKE
#load "./.fake/script.fsx/.paket/load/netstandard1.6/main.group.fsx"
#endif

open Fake.Core
printfn "test"

You run it initially via fake run script.fsx to restore all dependencies and generate load scripts

Now I expect to get working netcore/netstandard-based intellisense but nothing works in Ionide (or Visual Studio for that matter).
Interestingly Visual Studio is underlining the "#load" line if I add errors to main.group.fsx so it definitely is loading the libraries but is not doing anything useful with them. Ionide is doing nothing but besides showing that Fake is a unknown namespace.

I hope with next FAKE version we can make this work by using the net47 load script instead of netstandard1.6 (or even try to provide compat with net45).

Any pointers or hint why this doesn't work already today are welcome. /cc @Krzysztof-Cieslak

@enricosada
Copy link
Contributor

@matthid if doesnt work, is because of FSAC, let's fix it there.
Probably is more related on how the deps are loaded from script (so projectcracker), but in fsac is easier to diagnose.
Can you move the issue in https://github.com/fsharp/FsAutoComplete/issues and close this one?

Best will be add an integration test about that so is easy to diagnose (and we dont regress).
Integration test in fsac are just a Runner.fsx and an output.json.
Each test save the fsac output to an output.json (committed in repo, as the expected result) and does as git diff to check if test fail.

An example can be https://github.com/fsharp/FsAutoComplete/blob/master/test/FsAutoComplete.IntegrationTests/CompletionFilter/CompletionFilterRunner.fsx
who parse the fsx, and additionally check also completion.

if you need to install something (like .net core 2 sdk), and example can be https://github.com/fsharp/FsAutoComplete/blob/master/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/AppAndLibRunner.fsx

If you can PR the test, i can try check why fails.

@enricosada enricosada added bug language services Problems related to language services - FSAC or FCS labels Sep 23, 2017
@matthid
Copy link
Contributor Author

matthid commented Sep 23, 2017

The problem with netstandard is the masses of assembly references, I'm not sure how to properly reproduce that easily.

Note that I'm not quite there yet. I just wanted to try if I get something work in the current state and give others the opportunity to help out.

Later I'll check if falling back to the full framework load-script is a temporary solution for now (but it will be quite confusing for users...).

@enricosada
Copy link
Contributor

@matthid too much references is not an issue ihmo. is the same with fsproj, who reference same amount of assemblies, passed to fsc.
to reproduce, i think the script in the issue descript is perfect, the test can just fake run script.fsx to generate the load script and restore assemblies, and after that try to parse the script. If the assemblies exists locally, should parse.

if the script run as expected with fsi script.fsx (after the dll are restored, and a the referenced load script #r these), than intellisense should work, if not is a bug.

just guessing, but probably issue is with GetProjectOptionsFromScript who read the fsx or how FSAC call that (like assumeDotNetFramework).

I'll try to check the script in FSAC/FCS later

@matthid
Copy link
Contributor Author

matthid commented Sep 23, 2017

AFAIK fsi is not yet supported on netcore, or is it? If no I cannot really cross check fsi script.fsx as you are suggesting.

Thanks for helping. Like I said this will be lying around for some time (at the very least until I've finished porting FAKE to netcoreapp20)

@Krzysztof-Cieslak
Copy link
Member

Hey @matthid can we close it?

@matthid
Copy link
Contributor Author

matthid commented May 3, 2018

Basically this still is a hack because we generate intellisense for full framework, which is not what fake 5 is actually executing. But if you want you can close it. Also I need to find the time to fix ionide/FsAutoComplete#273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug language services Problems related to language services - FSAC or FCS
Projects
None yet
Development

No branches or pull requests

3 participants