This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/fsharp
Lucius Hu 925e3a8265 fsharp: refactor
- Moved backend determination to `config.el`
- Replaced unnecessary backquote construct with simple quotation
- Moved function from `packages.el` to `func.el`
2021-04-04 12:48:21 +02:00
..
img
config.el fsharp: refactor 2021-04-04 12:48:21 +02:00
funcs.el fsharp: refactor 2021-04-04 12:48:21 +02:00
layers.el Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
packages.el fsharp: refactor 2021-04-04 12:48:21 +02:00
README.org documentation formatting: Tue Nov 10 22:56:00 UTC 2020 2020-11-12 22:38:27 +01:00

F# layer

/TakeV/spacemacs/media/commit/5ef4960d46fcfb333f59ee32ad19471ee177d64f/layers/+lang/fsharp/img/fsharp.png

Description

This layer adds support for F# language using fsharpbinding and fsharp-mode.

Features:

  • Auto-completion
  • Syntax-checking
  • Syntax highlighting
  • REPL

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add fsharp to the existing dotspacemacs-configuration-layers list in this file. In addition you require the .NET Core executable in your path.

Configuration

All layer configurations can be done by setting layer variables in your dotfile. No custom user config lines are necessary

Choosing a backend

This layer provides two alternative backends to choose from.

Eglot

This is the default choice if nothing is set and no lsp layer is loaded in your dotfile. This mode provides straight forward IDE capabilities by means of an external server using the LSP protocol using eglot-mode a lightweight LSP client. The server is started automatically when a fsharp file is opened.

This backend is best used if small applications are edited. To set explicitly set the following in your dotfile:

  (fsharp :variables fsharp-backend 'eglot)

LSP

For proper IDE support this backend should be used. It is also based on an external LSP server however it is using a more elaborate client providing a lot of standard feature which are not available by the lightweight alternative. The server is started automatically when a fsharp file is opened. The key bindings are the same for all lsp modes so if you are already familiar with one you should be able to work the same in all modes.

To set explicitly do the following in your dotfile:

  (fsharp :variables
          fsharp-backend 'lsp)

Normally LSP mode should install the matching server for you if you require a specific version you need to install it yourself from here.

NOTE: Key bindings for LSP are defined in the LSP layer. Also it is advisable to have a look at the autocomplete layer for an optimal intellisense config for LSP.

Key bindings

Key binding Description
SPC m c c Build the project
SPC m g a Go to alternate file

REPL

Key binding Description
SPC m s b Send buffer to the REPL
SPC m s B Send buffer to the REPL and switch to the REPL in insert state
SPC m s i or SPC m ' Start a REPL process
SPC m s p Send phrase to the REPL
SPC m s P Send phrase to the REPL and switch to the REPL in insert state
SPC m s r Send region to the REPL
SPC m s R Send region to the REPL and switch to the REPL in insert state