ionide-vscode-fsharp
ionide-vscode-fsharp copied to clipboard
Add option to switch target framework
.NET Core SDK fsproj (msbuild15 based) can define multiple target frameworks (crossgen) in same fsproj project.
So will be awesome if is possibile to change the framework inside vscode.
Dunno about UI, ideas?
- list of target frameworks can be obtained by
TargetFrameworks
property orTargetFramework
if is only one. - pass target fw to FSAC
workaround for crossgen atm is set TargetFramework
env var AFTER restore, but BEFORE opening code
This is tied into the functionality i've been building for Protoworkspace.
I don't think we'll be able to get the full value out of this feature without the ability to switch between different build configurations as well. The build configurations tend to include the DEFINE_CONSTANTS that need to be fed into FCS for the proper #ifdef
blocks to be activated.
Sure people could reorganize the location of their define constants so that they fall as children of the target framework, but getting them to know that's what they need to do will be a problem.
This one's a bit tricky and I think we should save it for one of the last things we do.
Current implementation just read the responsefile created after dotnet build
.
atm just search first one. but changing target framework just mean "read from obj{targetframework}\dotnet-compile-fsc.rsp" file
Ok, now FSAC just need to pass the choosen target framework, like /p:TargetFramework=netstandard1.6
when is parsing fsproj to get fsc args.
That mean:
- ask user for specific string (the target framework), if not choosen, use default (like now)
- pass choosen target fw to FSAC, who will initialize using that fw.
- need a new FSAC method?
- can FSAC maintain multiple target fw or require invalidate and restart?
@Krzysztof-Cieslak i got a crazy idea.
because the target framework and configuration are set in .tasks.json
for build, cannot we just parse these?
so adding -f netcoreapp1.0
mean ionide will ask FSAC for that target framework.
No combo needed, no third party config file, just update the file needed already to build that framework.
"taskName": "build",
"args": [ "c1", "-f netcoreapp1.0" ],
Can be done? is something ionide can read?
As used experience willl be good i think, just one place to edit these info