Coding F# on macOS

Lately, I wanted to code some F# scripts. I started up Visual Studio Code on my MacBook and created an fsx file. Then I noticed that intellisense was not working anymore despite active code highlighting. That was the start for a long journey. I ended up on installing (again):

Intellisense was now working in F# projects and somehow/sometimes in fsx files within the context of an F# project. Then I tried it out in a stand-alone fsx file. Intellisense was not working again… Then I found some notes about the ‘FSharp.useSdkScripts’ option of the ionide-fsharp extension of Visual Studio Code. I activated the setting:

Visual Studio Code settings: Activate “Fsharp: Use Sdk Scripts: Use ‘dotnet fsi’ instead of ‘fsi.exe’/’fsharpi'”.

What a wonder, intellisense is working for F# fsx script files! With this setting enabled, I am no longer working with mono but with the .NET Core version of fsi (FSharp Interactive). With that, I think I don’t actually need mono.

References

Leave a Reply

Your email address will not be published. Required fields are marked *