Can I automatically open specific namespaces and libraries in F# Interactive REPL?

164 views Asked by At

I notice that each time I open F# Interactive (FSI) from within Visual Studio to tryout something REPL-style, I always find myself executing a few commands first, often specific for any given project:

open System;;
#r @"r:\projects\currentprjLibs.dll";;
#r @"r:\external\unquote.dll";;
#time;;

This is just an example, but I find myself asking: can this be automated? Now, I could have an fsx script for each project and do a "send to interactive", but this is still quite a bit of work (and #r or #time won't work there). Besides, I have to do it again on each FSI Reset.

Does anybody know of a simpler way? Should I roll my own (I never created a serious add-in for Visual Studio, but maybe now is a good time). Other suggestions?


PS: the solution here is not what I am after, as it applies to every instance of FSI and it doesn't do opens. The 2nd solution there is to add #if INTERACTIVE, but this adds clutter, is difficult to write with relative paths, and Ctrl-A plus Ctrl+Shift+Enter will choke on any namespace, which then also needs to be in #if !INTERACTIVE, adding more clutter.

0

There are 0 answers