F# Language ServerThis project is an implementation of the language server protocol using the F# Compiler Service. FeaturesHoverAutocompleteMethod signature helpFind symbols in documentFind symbols in workspaceGo-to-definitionFind referencesRename symbolShow errors on saveRun & Debug testsCode structureThe language server protocol (LSP) is very similar to the API defined by the F# compiler service (FCS); most of the implementation is devoted to translating between the types used by FCS and the JSON representation of LSP.
InstallationVSCodeInstall from the VSCode extension marketplace VimClone this repo to your system and build it:
If using a distribution based on Arch Linux, you can also install it from the AUR Install LanguageClient-neovim Update your vim config to point LanguageClient-neovim to the FSharp Language Server for fsharp filetypes:
Open an fsharp file, move the cursor, and call functions. Mappings are up to you:
Neovim with Deoplete completion: (alternatively there is another vim language server plugin vim-lsp but this one hasn't been tried. EmacsSpacemacsClone this repo to your system and build it:
Make sure that the FSharpLanguageServer (in
Since the stock fsharp layer does not currently include LSP support, you will need to use the fsharp2 layer (a fork of fsharp) which does. To use fsharp2, copy the custom layer into your Spacemacs private layers directory. In order for this layer to work, you must be on the Spacemacs develop branch, since the LSP layer is not yet available in Spacemacs master.
Finally, make sure that you have these layers enabled in your dotspacemacs-configuration-layers. You will need to remove the fsharp layer if you have it, since fsharp2 conflicts with it.
How is this project different than Ionide?Ionide is a suite of F# plugins for VSCode; F# language server is analagous to the FSAC component. The implementation is a thin wrapper around F# Compiler Service and is heavily focused on performance. For example, autocompleting in medium-sized file in F# Language Server (left) and Ionide (right): |