Previously I showed how to install F# on OSX. In this post I’ll start showing you how you can start devloping F# in Visual Studio Code on OSX (macOS… whatever).
- You are using OSX. These instructions may work on Windows, but I haven’t tested on Windows. Let me know if they do.
- You have mono already installed. If not, follow the instructions.
- You have Visual Studio Code (VSCode from now on) installed. If not, download it and install it.
Before we Get Started
These instructions were taken when using mono 4.4.2, VSCode 1.4, OSX 10.11.6, and Ionide extension v2.2.7. If any of the below does not work for you it may be due to differences in the versions of any of the above.
Installing Ionide Extension
The bulk of the F# support comes from the excellent Ionide project which I believe was originally developed for the Atom editor. There are a set of extensions for VS Code.
So as with all other extensions in VSCode, open up the Extensions view via one of these methods:
- click on Extensions icon in View Bar, or
- press ⇧⌘X, or
- Open up the Command Palette (⇧⌘P) and type in Install Extensions and press enter.
Now search for Ionide. You should see at least the three extensions below:
Install each extension (click on the green install button) then restart VSCode (rather than having to enable each extension). I installed them in the following order, though I’m assuming the order doesn’t matter: ionide-fsharp, ionide-fake, ionide-paket.
Now that Ionide is installed, you have should everything needed to get into F# now. There are a couple of ways you can do that:
- Create new F# project using “F#: New Project” command.
- Do repl development using FSI (F# interactive) to run your code.
- Develop using F# script files (FSX).
I’ll describe each in the next set of posts.