I have tried to use Visual Studio Code for run a simple F# script.
I download all recent versions as today. I install all the plugins at http://ionide.io/. Despite the nice animated gifs that show that it works, I'm unable to see how make to work the Build of code.
I create a .ionide file:
[Fake]
linuxPrefix = "mono"
command = "build.cmd"
build = "build.fsx"
But then, how install Fake? So, I do this from xamarin and install it. Ok, so now I get the build.fsx:
#r "packages/FAKE.4.12.0/tools/FakeLib.dll" // include Fake lib
RestorePackages()
// Properties
let buildDir = "./build/"
let testDir = "./test/"
let deployDir = "./deploy/"
// version info
let version = "0.2" // or retrieve from CI server
// Targets
Target "Clean" (fun _ ->
CleanDirs [buildDir; testDir; deployDir]
)
Target "fakeBuild" (fun _ ->
!! "./*.fsproj"
|> MSBuildRelease buildDir "Build"
|> Log "AppBuild-Output: "
)
Target "Default" (fun _ ->
trace "Hello World from FAKE"
)
// Dependencies
"Clean"
==> "fakeBuild"
==> "Default"
// start build
RunTargetOrDefault "Default"
Run the Fake:Build command and get:
No handler found for the command: 'fake.fakeBuild'. Ensure there is an activation event defined, if you are an extension.
And now get lost.
To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D. The Run and Debug view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings.
In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).
Check that you have the Code Runner extension enabled. The Extensions marketplace is accessible through the fifth button down on the toolbar. If it is installed and enabled, you should see a Run button on the top-right of the tab bar.
install yeoman: ">ext install yeoman" then setup a stand alone project with >yo and follow the instructions and say yes to paket and FAKE.
then >paket init and >paket install and it should work.
to get the > use ctrl+shift+p
For the Atom IDE you also have to install the yeoman npm package which I describe here: http://www.implementingeventsourcingwithfsharp.com/?p=61
how to install the package is descibed here: https://www.npmjs.com/package/generator-fsharp
not sure you need it for Visual Studio Code
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With