Ionide-vscode-fsharp: How to use FSI included in .Net Core?

Created on 20 Aug 2018  ·  6Comments  ·  Source: ionide/ionide-vscode-fsharp

The latest release of .Net Core (2.1.400) finally includes a working FSI:

dotnet "C:\Program Files\dotnet\sdk\2.1.400\FSharp\fsi.exe"

Microsoft (R) F# Interactive version 10.2.3 for F# 4.5
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

>

How do I set it in FSharp.fsiFilePath?

TIA

wontfix

Most helpful comment

dotnet fsi is a thing these days. I put this in /usr/local/bin/fsharpi on my mac:

#!/usr/bin/env bash
dotnet fsi

EDIT: Just found the “Use Sdk Scripts: Use 'dotnet fsi' instead of 'fsi.exe'/'fsharpi'” checkbox. It works!

All 6 comments

.NET SDK 2.1.400 does not include a working FSI - you'll find soon that anything beyond trivial code execution will fail, such as using an API from an assembly. It's an artifact of the build of the F# compiler SDK for .NET Core. When F# Interactive works properly for .NET Core, we'll make an announcement and have commands such as dotnet fsi available.

As such there won’t be any effort to integrate it with Ionide in its current shape - we will wait for any true public preview / beta / release candidate.

Was running some simple scripts, did not know it is not official yet.
Sorry about that.

@boyedarat if you are adventurous, create a /usr/bin/fsharpi file that is on your PATH, (remember to chmod +x it) that contains:

dotnet ~/.dotnet/sdk/`dotnet --version`/FSharp/fsi.exe

To extend @abk-x 's comment, for windows:

  1. Create a .cmd file that contains:
    dotnet "{path to fsi.exe within dotnet-sdk }"

    Example fsi.cmd file :

         dotnet "C:\Users\darien.shannon\scoop\apps\dotnet-sdk\2.1.403\sdk\2.1.403\FSharp\fsi.exe"
    
  2. In VS Code settings, set the 'Fsi File Path' to reference this .cmd file:

    Example custom user setting in VS Code :

    "FSharp.fsiFilePath": "C:\\Users\\darien.shannon\\scoop\\apps\\dotnet-sdk\\2.1.403\\sdk\\2.1.403\\FSharp\\fsharpi\\fsi.cmd"
    

dotnet fsi is a thing these days. I put this in /usr/local/bin/fsharpi on my mac:

#!/usr/bin/env bash
dotnet fsi

EDIT: Just found the “Use Sdk Scripts: Use 'dotnet fsi' instead of 'fsi.exe'/'fsharpi'” checkbox. It works!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MangelMaxime picture MangelMaxime  ·  4Comments

vasily-kirichenko picture vasily-kirichenko  ·  6Comments

landy picture landy  ·  5Comments

yuhr picture yuhr  ·  3Comments

cartermp picture cartermp  ·  4Comments