Setting up the F# in VS Code

2022-12-11 vscode f# ionide setup youtube

How to get going with F# scripting in VSCode editor. As I was looking for some guide on setting it up, I worked through this at youtube:

Here are some notes from watching it.

In order to use Ionide plugin in VSCode, .net Core of some version have to be installed. Quick check on what version is currently installed:

dotnet --info

In the output, look for following section:

.NET SDKs installed:
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.403 [C:\Program Files\dotnet\sdk]
  6.0.403 [C:\Program Files\dotnet\sdk]

Once Ionide is enabled, it helps with editing of the code. Few useful features:

  • when breadcrumb is enabled View: Toggle Breadcrumbs, it shows code structure and allows to move to the items in the file
  • with Alt+Enter, the selected code can be sent into the F# Interactive window
  • provides F# help for cursor element with F#: Open Info Panel
  • refactoring tools: Rename Symbol, Find References, etc

Also used in the video, BenchmarkDotNet library, and use of BenchmarkRunner class.