如何在我的visual studio代码中使用FSI作为F#4?

问题描述 投票:3回答:1

我的Visual Studio中的终端一直在说F# Interactive for F# 3.1 (Open Source Edition)

如何告诉visual studio将FSI用于F#4?

PS:Visual Studio代码和所有扩展已经更新。

PPS:我正在使用mac

enter image description here

macos visual-studio-code f# mono
1个回答
4
投票

VSC中的终端使用你的默认shell,因此将获取相同的路径,因此fsharpi将与通过Terminal.appiTerm2.app运行它相同。

如果您安装了最新的Mono版本,它将在以下位置放置一个fsharpi shell脚本:

>which fsharpi
/usr/local/bin/fsharpi

这反过来使用mono在fsi.exe CIL-assembly中执行:

/Library/Frameworks/Mono.framework/Versions/4.6.0/lib/mono/4.5

Mono版本4.6.0目前为F#4.1安装F#Interactive

获取最新的OS-X Mono版本here

跑:

cat `which fsharpi` 

矿山回报:

#!/bin/sh
EXEC="exec "

if test x"$1" = x--debug; then
   DEBUG=--debug
   shift
fi

if test x"$1" = x--gdb; then
   shift
   EXEC="gdb --eval-command=run --args "
fi

if test x"$1" = x--valgrind; then
  shift
  EXEC="valgrind $VALGRIND_OPTIONS"
fi

# Beware this line must match the regular expression " (\/.*)\/fsi\.exe" when fsi.exe is fsi.exe.
# That's because the FSharp MonoDevelop addin looks inside the text of this script to determine the installation
# location of the default FSharp install in order to find the FSharp compiler binaries (see
# fsharpbinding/MonoDevelop.FSharpBinding/Services/CompilerLocationUtils.fs). That's a pretty unfortunate
# way of finding those binaries. And really should be changed.
$EXEC /Library/Frameworks/Mono.framework/Versions/4.6.0/bin/mono $DEBUG $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/4.6.0/lib/mono/4.5/fsi.exe --exename:$(basename "$0") "$@"
© www.soinside.com 2019 - 2024. All rights reserved.