F# support in Rider – what’s there and what’s coming

Back when we opened the public Rider Early Access Program (EAP), we announced Rider as a cross-platform .NET IDE. We started out with C# and VB.NET, but there are of course three major CLR languages, so that means… we have recently added initial F# support to Rider!
F# support in Rider

Go download the latest Rider EAP and give it a try! Read on for an overview F# support in Rider.

What’s supported for F# right now?

Let’s start off with a small disclaimer: we’re introducing initial F# support into Rider, built around the F# Compiler Service. We’re building the foundation on top of which we’ll provide excellent coding, navigation and refactoring features. With this initial release, expect some rough edges still. Some things will work, some will work in the future.

Having that said, expect to find syntax highlighting, code completion, navigation, and displaying of warnings and errors. Of course, IDE features like source control and issue tracker integration, our super-fast NuGet client, database tooling, the built-in terminal and REST client are available, too.

A major feature of every JetBrains IDE, including Rider, is smart navigation. There’s Go To Type, Go To File, Search Everywhere, … Fire up Rider and open a project, then hit Ctrl+T to search and navigate through symbols, types, files, settings and actions.

Search Everywhere to navigate through classes, files and IDE actions

From anywhere in our code, we can press Alt+` and use Navigate To to jump to related symbols (such as base or derived types), find usages of a given type or member, …

Navigate To navigates through codebase

If you try to navigate to a type that you don’t have the source to, we’ll try to fetch the source code from a symbol server or decompile it on the fly, displaying what the C# code would look like.

Rider offers a large number of smart editing features, such as syntax highlighting and code completion.

Code completion for F#, C#, VB.NET, JavaScript, TypeScript, ...

Whenever Rider detects a warning or error in our code, it is displayed inside the editor where we can inspect the details. Warnings and errors are provided by FSC, we’ll eventually be adding our own as well. Note that the right-hand gutter also displays warnings and errors (tip: click to navigate).

Warnings and errors in IDE

From within Rider, we can run and debug code. Rider can build and run .NET Framework and Mono projects, and provides debugging support for them as well. From the Debug tool window we can see call stacks, variables, add watches, …

Rider debugger supports F#

What’s coming in future releases?

We’re not there yet. This initial release for F# support contains basic F# features and introduces the foundation on which we’ll be building more!

Right now, it’s possible to create and open F# projects that target the full .NET framework (not yet .NET Core). Mixed-language solutions are supported as well, so for example a C# project can reference and use types from an F# project and vice-versa. A C# project in Rider can already use an F# project and get completion and navigation, the other way around works after building it first. It’s still work in progress, but having cross-language support would mean navigation and refactoring that span multiple languages becomes possible in the future. The Add reference quick-fix knows about all types in all projects and can add a reference from a C# project to an F# project:

Add reference from C# to F#

Rider has syntax highlighting, code completion, navigation (for .fs and .fsi files, .fsx works partially) and can find and highlight usages of a symbol. Editor features like auto-format will be added soon.

Expect Rider’s code analysis to not only show warnings and errors, but also provide quick-fixes to automatically resolve such issues. Currently, none of the quick-fixes and refactorings available in Rider work with F#, but it’s only a matter of time before they will.

The team is working on improving and enriching F# language support across the board. Expected tools (such as F# Interactive) will be added in future releases.

What does this mean for ReSharper? Will it get F# support as well?

F# support in Rider is being built on F# Compiler Service (FCS) and being integrated into the underlying ReSharper engine. FCS is the basis on top of which we are building goodies like code completion, navigation, refactoring and all that.

While we’re laying the groundwork for F# inside the ReSharper codebase, we’re currently not planning on surfacing it in Visual Studio and ReSharper. We’re not saying never, but our priority and focus is on having full F# support in Rider first!

And for those wondering if we’ll open source this plugin: eventually, when we feel we’re ready to accept contributions. And of course, when a proper Rider plugin SDK is available, too.

Download Rider now and test-drive F# support! We’d love to get your feedback!

This entry was posted in How-To's and tagged , , , , , . Bookmark the permalink.

10 Responses to F# support in Rider – what’s there and what’s coming

  1. Joe Stead says:

    Pretty much all of the F# I use are .fsi scripts. Any chance I can load them into my C# solution without adding them to the sln/a .*proj file of some kind in the RTM version? I guess the same applies to JS/TS too :)

  2. Pingback: Dew Drop - May 9, 2017 (#2475) - Morning Dew

  3. Pingback: 1 – F# support in Rider – what's there and what's coming

  4. Dmitri Nesteruk says:

    I wonder if Rider/R# can go one step ahead of Visual Studio and merge-compile C# and F# by having both types of files in a single project, kind of the same way in which Java and Kotlin files can coexist in a single IDEA project. Probably technically challenging (needs ilmerge) but would be awesome.

  5. Daniel says:

    I’m very happy to see F# support in this responsive IDE! I have two questions/requests regarding function parameter listings.
    – When calling a function: Is there a way to get the same interactive popup with a “guide” of parameters (which you’re currently writing etc.), just as in IntelliJ/Android Studio/Visual Studio for C# etc. I know there is an (unintended?) effect causing the parameter list to be displayed: if you type an opening parenthesis after the function name, but only when typing the first argument, and in F# you often don’t use parenthesis.
    – Is there a way to create a keyboard shortcut to display the same function definition popup as shows up on mouse hover? I’m not talking about the “Quick documentation” or “Quick definition” (which doesn’t seem to display the correct part of the file in its popup), but the “thinner”, one-line display (“val : …”).

    It would be a great help to get this “intellisense information” (Visual Studio 2015 works the exact same way, and VS2017 even worse as of first release..)

    • Eugene Auduchinok says:

      Regarding parameters popup: currently Parameter Info is indeed automatically shown in method invocations with parenthesis only. In some other cases explicit triggering it with Ctrl+P (Cmd+P on macOS) may work. We’ll try to make it work in other scenarios but it may be limited by the F# compiler API we use for that and we’ll have to add it there first.

      We’ll add Quick Definition for F# in future releases. As for triggering tooltips with keyboard, I don’t think such feature exists in IntelliJ mostly because Quick Definition is used instead.

      • Daniel says:

        Thank you for the quick response!
        It’s unfortunate your hands are tied, calling functions is probably the main part of what you type as a functional programmer.

  6. Daniel says:

    I noticed that file order in the .fsproj file is not respected in the UI. The files seem listed alphabetically.

    Unlike e.g. C#, the file order within a project is significant and dictates possible dependencies between components (e.g. functions in lower listed files can call functions in files higher up, but not the other way around). The order of projects in a solution do not matter though.

    Dragging and dropping a file within a project brings up a popup informing about a pending move, but nothing happens. I didn’t find any other way than unloading the project and “manually” editing the order of filenames within the .fsproj file ( section).

  7. Pingback: .NET дайджест #17: высокопроизводительный .NET, обзор .NET Standard 2.0, архитектура .NET приложений : IT лента новостей ⋆ iAMX - Развлекательно-информацио

Leave a Reply

Your email address will not be published. Required fields are marked *