Learning to setup F# dotnet projects correctly for language server

Hi there,

I’ve been learning F# for over a year now (mostly using scottwlashin’s blog and exercism.io) and I am completely in love with the language.

One thing I keep having trouble with is setting up my projects correctly. I’ll type “dotnet new classlib --lang F#; dotnet build” and will get a compiling project … but no language server support.
Last time that happened I managed to get the project setup correctly after a 1h search on the web … now I’m facing the same issue and don’t know which blogs/docs helped me last time.

I don’t whether it’s a matter of finding the right resource, fixing a quirky setup or grokking something that’s eluding me.
Any pointers welcome.

Details: I’m using Visual Code Studio on MacOSX with F# language server, C# and Ionide-fsharp plugins installed. This works great on my exercism.io projects (code provided by platform) and on some of my past projects. Yet I just created a project and the language server is not working.
It is giving lots of errors but those are also present on the projects where it does work so I don’t know what to make of it. What is actually required for the language server to work?

Failed to create code lens because project options failed to load
No .fsproj or .fsx file references <my .fs file> (even though it does reference the file)
No cracked project references <my .fs file>, looking at uncracked projects…

@chethusk should be able to shed some light on this for you.

By “language server not working” do you mean that you’re not getting auto completion?

@Scott thanks for the ping!

I think @simonvdm also posted on the FSSF slack and got their problem resolved, but the root issue was:

  • having fsharp-language-server and Ionide installed (they are not able to be isntalled at the same time),
  • then, when working in fsx script files an unfamiliarity with the need to open namespaces from the referenced dlls

but after that, all good to go!


Exactly. Thank you for the follow-up @Scott and @chethusk. Much appreciated.