Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
May 14, 2022 22:50
May 27, 2022 08:51
January 10, 2022 11:12
May 27, 2022 08:51
January 9, 2022 22:09
May 27, 2022 08:51
October 22, 2022 01:27
December 3, 2021 09:10
May 27, 2022 07:47
December 15, 2018 10:07
January 10, 2022 11:12
May 27, 2022 11:03
March 26, 2019 20:03
February 13, 2019 20:50
January 9, 2022 22:09
March 10, 2022 13:04
May 27, 2022 08:53

F# Language Server


Untill I can sort out access to publishing new versions of the original extension, this is the working version of this extension F# Language Server updated

Recent Changes

Now being actively maintained by @faldor20

For changes see the Changelog

Key features i have added: Updated to support fcs 41 and .NET 6.0.

I have used code from FSharpAutoComplete and some adjustments to the original to add some features:

  • Better hover docs
  • Working documentation for system types
  • Semantic tokenization
  • Support semantic tokens
  • Have pretty multiline function signatures in hover docs

I may at some point work on supporting the vim and emacs versions of these extensions but as i use neither, I have not at this time.

My work here is done specifically in response to this issue with Ionide here, which makes it unusuable for me and potentially many others.

Almost all credit for this should go to @georgewfraser(original author) and the guys of at FSAC(where sections of the code and much inspiration comes from)

Main description

This project is an implementation of the language server protocol using the F# Compiler Service.






Method signature help

Signature help

Find symbols in document

Document symbols

Find symbols in workspace

Workspace symbols


Go to definition

Find references

Find references

Rename symbol

Rename symbol

Show errors on save

Show errors

Run & Debug tests

Debug test

Code structure

The 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.

  • client/extension.ts: Client-side VSCode launcher
  • sample: Example projects used by tests
  • scripts: Scripts for building and testing
  • src/LSP: Server-side implementation of language server protocol
  • src/ProjectCracker: Figures out F# compiler options using Buildalyzer and the MSBuild API.
  • src/FSharpLanguageServer: F# language server
  • tests/LSP.Tests
  • tests/ProjectCracker.Tests
  • tests/FSharpLanguageServer.Tests
  • videos: Animated GIFs on this page



Install from the VSCode extension marketplace

Neovim and Vim

Clone this repo to your system and build it:

yarn install
dotnet build -c Release

If using a distribution based on Arch Linux, you can also install it from the AUR (Still installs the old version) Install LanguageClient-neovim

Update your vim config to point LanguageClient-neovim to the FSharp Language Server for fsharp filetypes:

let g:LanguageClient_serverCommands = {
    \ 'fsharp': ['dotnet', '/Users/name/code/fsharp-language-server/src/FSharpLanguageServer/bin/Release/netcoreapp3.0/target/FSharpLanguageServer.dll']
    \ }

Open an fsharp file, move the cursor, and call functions. Mappings are up to you:

  • Hover call LanguageClient#textDocument_hover()
  • Rename: call LanguageClient#textDocument_rename()
  • Definition: call LanguageClient#textDocument_definition()
  • etc...

Neovim with Deoplete completion:

(alternatively there is another vim language server plugin vim-lsp but this one hasn't been tried.



Clone this repo to your system and build it:

yarn install

# Pick the appropriate target based upon your OS 
dotnet publish -c Release
dotnet publish -c Release
dotnet publish -c Release 

Make sure that the FSharpLanguageServer (in src/FSharpLanguageServer/bin/Release/net6.0/publish) is in your PATH. Alternatively, you can set the path to the server executable manually within your .spacemacs user-config:

(setq fsharp2-lsp-executable "/path/to/FSharpLanguageServer")

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.

cp -r spacemacs/fsharp2 ~/.emacs.d/private

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.

  • lsp
  • fsharp2
  • syntax-checking
  • auto-completion


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):

Autocomplete warm


Please do!

Any help is very much appreciated, issues, PR's, even just asking a question about how something works. I'm happy to help and be helped.


Run :

  • yarn install to setup node deps (not needed unless you plan to build the vsix extension package)

  • dotnet tool restore to install paket

  • dotnet paket install to install all dependencies

Then refer to the build scripts.

Essentially you just publish the language server with dotnet publish -c Release src/FSharpLanguageServer then run vsce package -o build.vsix to package it up

If you want to try your newly created extension run code --install-extension build.vsix


Set the Fsharp.debug and fsharp.CustomDll path settings in vscode. fsharp.debug: Stops execution of the langserver until you attach the vscode debugger to the dotnet instance. fsharp.customDllPath: allows you to specify a dll to run instead of the packaged version of fslsp.

Live project:

  • Open two instances of vscode one in a testing project, one in the fsharp-language-server project
  • Make changes to the test project and then run dotnet publish in src\FSharpLanguageServer.
  • use the workspace settings in the test project to set fsharp.debug to true and fsharp.customDllPath to the path of the dll you just published
  • Reload the other instance of vscode and attach the debugger to monitor the changes.


  • Write a test for your problem
  • Change "test" to "ftest"
  • In the vscode debugger dropdown select ".net expecto tests"
  • Debug your test