Ionide-vscode-fsharp: No intuitive error messages when F# is not installed

Created on 23 Jan 2017  路  6Comments  路  Source: ionide/ionide-vscode-fsharp

I'm helping out with a course in F#, using Ionide as the officially supported solution. By and large it's going swimmingly, which I have to thank you guys for. There have been two common failure modes though:

  1. The student forgets to install F#, sees that Ionide doesn't work, and places a support call;
  2. If on Windows, the student installs Visual F# Tools 4.0 but not MS Build Tools 2015, sees that Ionide doesn't work, and places a support call.

Both of these stem from a failure to follow the documentation consistently; you could see that as an indictment of the students, or the documentation, or (like me) you could conclude that getting 150 students to read and follow more than three lines of documentation is a fool's errand.

I'm not sure if this is possible within VS Code, but one thing which would be cool is if ionide-fsharp popped a comprehensive error message when the following conditions were met:

  • User is editing an F# file (.fs, .fsi, .fsx)
  • Either no F# install is found, or running fsi returns an error code
  • Optionally: the user has not seen this error message this session
enhancement up for grabs

All 6 comments

One thing that might be useful is the approach I took to this PR: https://github.com/fsprojects/ProjectScaffold/pull/286

What I did, which may or may not be a good approach for Ionide, was to leverage the MSBuild system (and particularly its MSBuildExtensionsPath32 environment variable) to check for the Microsoft.FSharp.Targets file, and print appropriate error messages for Windows, OS X, and Linux.

I don't have time right now to adapt that approach to Ionide, but I offer it as a suggestion for anyone else who wants to tackle this.

I'm looking into this issue and I had a question on when this check should be done. Does it make sense for the Language Service to do that check as part of it's startup?

That sounds like a great idea to me.

I am looking at this currently and trying to make a modest improvement. I wanted to share thoughts here before I go too far down a wrong path, but having had a bunch of users locally fail with this pattern, I am currently implementing a simple patch that augments the current cryptic "Failed to start language services. Please check if Microsoft Build Tools 2013 are installed" message. Specifically, I want to create a simple page that opens which summarizes the attempts to find the various pieces that ionide is looking for (msbuild, mono, fsautocomplete.exe) and their status, with links to installation instructions and presence/absence on the machine. This should both help diagnose a broken installation and point user towards fixing it. There wasn't enough real estate (or ability to add links) in the error message, hence thoughts about creating a new page that opens. Thoughts on that user design and what you want to see on a status page? (I was recenty a victim of anti virus software assassinating fsautocomplete.exe hence idea of giving user a full report on what's findable or not.

I think I'd go with:

  1. Add entry in our new documentation website
  2. Change the message to something completely different - actually, MsBuild 2013 is not even needed anymore, 2015 is (in some cases), but it would fail later - not on the startup.
  3. You can provide additional items that will be displayed as clickable buttons in the showInformationMessage call - we could add View more info button that would open the documentation in the internet browser (https://github.com/ionide/ionide-vscode-fsharp/blob/master/src/Components/Help.fs#L32)

Additionally:

  1. Probably you could customize the error message depending on the error code returned by node when we spawn FSAC

Given the rise of popularity of .Net Core / dotnet SDK I don't think it's going to be problem in the future as if you install dotnet SDK you have F# installed as part of it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gsomix picture gsomix  路  6Comments

sivabudh picture sivabudh  路  3Comments

vasily-kirichenko picture vasily-kirichenko  路  6Comments

cartermp picture cartermp  路  4Comments

isaacabraham picture isaacabraham  路  5Comments