F# Language ServerIMPORTANTUntill 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 ChangesNow 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:
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 descriptionThis 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 Neovim and 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 (Still installs the old version) 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): ContributingPlease 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. BuildingRun :
Then refer to the build scripts. Essentially you just publish the language server with If you want to try your newly created extension run DebuggingSet 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:
Tests:
|