Merge pull request #1540 from TOTBWF/lsp-fsharp
lang/fsharp: add LSP support
This commit is contained in:
commit
b07c047068
2 changed files with 18 additions and 8 deletions
|
@ -12,6 +12,7 @@
|
||||||
- [[#mono][Mono]]
|
- [[#mono][Mono]]
|
||||||
- [[#osx][OSX]]
|
- [[#osx][OSX]]
|
||||||
- [[#arch-linux][Arch Linux]]
|
- [[#arch-linux][Arch Linux]]
|
||||||
|
- [[#lsp][LSP]]
|
||||||
- [[#features][Features]]
|
- [[#features][Features]]
|
||||||
- [[#configuration][Configuration]]
|
- [[#configuration][Configuration]]
|
||||||
- [[#troubleshooting][Troubleshooting]]
|
- [[#troubleshooting][Troubleshooting]]
|
||||||
|
@ -28,22 +29,25 @@ This module adds [[https://fsharp.org/][F#]] support.
|
||||||
+ Syntax checking
|
+ Syntax checking
|
||||||
|
|
||||||
** Module Flags
|
** Module Flags
|
||||||
This module provides no flags.
|
+ =+lsp= Enables lsp-fsharp (this requires ~:tools lsp~ to be enabled).
|
||||||
|
|
||||||
** Plugins
|
** Plugins
|
||||||
+ [[https://github.com/fsharp/emacs-fsharp-mod+e][fsharp-mode]]
|
+ [[https://github.com/fsharp/emacs-fsharp-mod+e][fsharp-mode]]
|
||||||
|
+ =+lsp=
|
||||||
|
+ [[https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-fsharp.el][lsp-fsharp]]
|
||||||
** Hacks
|
** Hacks
|
||||||
None so far.
|
None so far.
|
||||||
|
|
||||||
* Prerequisites
|
* Prerequisites
|
||||||
** Mono
|
** Mono
|
||||||
To get code completion/syntax checking, you will need to install [[https://www.mono-project.com/][mono]].
|
To get code completion/syntax checking when not using lsp, you will need to install [[https://www.mono-project.com/][mono]].
|
||||||
*** OSX
|
*** OSX
|
||||||
Do *NOT* install mono via brew. See this [[https://github.com/fsharp/FsAutoComplete/issues/331][issue]].
|
Do *NOT* install mono via brew. See this [[https://github.com/fsharp/FsAutoComplete/issues/331][issue]].
|
||||||
*** Arch Linux
|
*** Arch Linux
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
sudo pacman -S mono
|
sudo pacman -S mono
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
** LSP
|
||||||
|
The language server is automatically installed by [[https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-fsharp.el][lsp-fsharp]].
|
||||||
* Features
|
* Features
|
||||||
An in-depth list of features, how to use them, and their dependencies.
|
An in-depth list of features, how to use them, and their dependencies.
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,20 @@
|
||||||
;;; lang/fsharp/config.el -*- lexical-binding: t; -*-
|
;;; lang/fsharp/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(after! fsharp-mode
|
(after! fsharp-mode
|
||||||
(setq fsharp-ac-use-popup nil) ; Use a buffer for docs rather than a pop-up
|
(if (featurep! +lsp)
|
||||||
(set-lookup-handlers! 'fsharp-mode :async t :definition #'fsharp-ac/gotodefn-at-point)
|
(progn
|
||||||
(set-company-backend! 'fsharp-mode 'fsharp-ac/company-backend)
|
(setq fsharp-ac-intellisense-enabled nil)
|
||||||
|
(setq lsp-fsharp-server-install-dir (concat doom-etc-dir "fsautocomplete/"))
|
||||||
|
(add-hook 'fsharp-mode-local-vars-hook #'lsp!))
|
||||||
|
(setq fsharp-ac-use-popup nil) ; Use a buffer for docs rather than a pop-up
|
||||||
|
(set-lookup-handlers! 'fsharp-mode :async t :definition #'fsharp-ac/gotodefn-at-point)
|
||||||
|
(set-company-backend! 'fsharp-mode 'fsharp-ac/company-backend))
|
||||||
(set-repl-handler! 'fsharp-mode #'run-fsharp)
|
(set-repl-handler! 'fsharp-mode #'run-fsharp)
|
||||||
(map! :localleader
|
(map! :localleader
|
||||||
:map fsharp-mode-map
|
:map fsharp-mode-map
|
||||||
"b" #'fsharp-ac/pop-gotodefn-stack ; Useful for re-tracing your steps
|
"b" #'fsharp-ac/pop-gotodefn-stack ; Useful for re-tracing your steps
|
||||||
"e" #'fsharp-eval-region
|
"e" #'fsharp-eval-region
|
||||||
"l" #'fsharp-load-buffer-file
|
"l" #'fsharp-load-buffer-file
|
||||||
"q" #'fsharp-ac/stop-process
|
(:unless (featurep! +lsp)
|
||||||
"t" #'fsharp-ac/show-tooltip-at-point))
|
"q" #'fsharp-ac/stop-process
|
||||||
|
"t" #'fsharp-ac/show-tooltip-at-point)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue