Ionide-vscode-fsharp: Type Provider issue when using netcore FSAC

Created on 18 Feb 2019  路  12Comments  路  Source: ionide/ionide-vscode-fsharp

Using the netcore version of FSAC doesn't appear to work with type providers. Using it with e.g. JSON TP gives this error:

image

I've tried adding a reference to this System.Private.CoreLib as a #r but no change. Any ideas?

bug

All 12 comments

Cc: @enricosada.

Also CC: @MangelMaxime - it seems that formating in tooltip in above screenshot is wrong. We probably should create separate issue for that

If an issue is opened with a reproduction code I can take a look at fixing the tooltip.

@Krzysztof-Cieslak for the moment I'd like to suggest removing the pop-ups to move over to the netcore FSAC - it's actually not necessarily good advice, since it doesn't work with type providers. Or at the very least it should be able to stop the alert appearing - it currently shows every single time that you start Code.

I think that makes a lot of sense. I think we could easily make it so if there was a user-set value for the fsacRuntime then we'd just ignore the suggestion overall.

@baronfel have just updated to latest ionide but the messages are still showing every time we start.

@baronfel @Krzysztof-Cieslak do you know of any reason why this might not be working? Do I have to first explicitly move to netcore and then back to net before it takes effect or something?

I had issues with this too recently when using the SQLProvider type provider. I read a comment that suggested the wrong version of the compiler might be getting used, and that wiping the .vscode folder from the your windows user folder, and the Code directory from AppData and reinstalling Code might be a solution. This seemed to work for me but I also cleaned my paket cache at the same time so I can't be certain.

Great to see the prompts to switch to netcore each time are being removed! Prompts generally infuriate me, one of the main reasons I switched to vscode is that some other apps can be quite "noisy" in terms of the development experience, so the less popups the better in my view.

Also just to mention that for something like this that can be reproduced with just a few lines of code, it's probably worth including all lines of code, since it could make a difference whether you are doing:

r# "./packages"
#I "PackageFolder/PackageName.dll"

Compared to:

#r ./packages/PackageFolder/PackageName.dll"

Is there a roadmap for this issue? Current status is that AFAICS out of the box Ionide won't work with type providers.

This seems to work now, also on the netcore version of FSAC :-) Closing.

Just a note,
For custom type provider, baseType = None will also trigger this issue,
Replace it to Some typeof<obj>

/// this is will trigger this issue
ProvidedTypeDefinition(baseType = None) 

/// this is will  not trigger this issue
ProvidedTypeDefinition(baseType = Some typeof<obj>) 
Was this page helpful?
0 / 5 - 0 ratings

Related issues

gsomix picture gsomix  路  6Comments

MikaelUmaN picture MikaelUmaN  路  5Comments

isaacabraham picture isaacabraham  路  4Comments

vasily-kirichenko picture vasily-kirichenko  路  6Comments

draganjovanovic1 picture draganjovanovic1  路  3Comments