2015-03-14 05:45:52 +00:00
|
|
|
;;; packages.el --- F# Layer packages File for Spacemacs
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-03-14 05:45:52 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-03-10 23:11:29 +00:00
|
|
|
|
2020-11-09 21:21:30 +00:00
|
|
|
(defconst fsharp-packages
|
|
|
|
'(
|
|
|
|
company
|
|
|
|
counsel-gtags
|
2021-03-18 04:08:50 +00:00
|
|
|
(eglot-fsharp :toggle (eq fsharp-backend 'eglot))
|
2020-11-09 21:21:30 +00:00
|
|
|
flycheck
|
|
|
|
fsharp-mode
|
|
|
|
ggtags
|
2021-03-18 04:08:50 +00:00
|
|
|
helm-gtags))
|
2020-11-09 21:21:30 +00:00
|
|
|
|
|
|
|
(defun fsharp/post-init-company ()
|
|
|
|
(spacemacs//fsharp-setup-company))
|
|
|
|
|
|
|
|
(defun fsharp/post-init-flycheck ()
|
|
|
|
(spacemacs/enable-flycheck 'fsharp-mode))
|
2015-03-14 05:45:52 +00:00
|
|
|
|
2021-02-10 21:38:57 +00:00
|
|
|
(defun fsharp/init-eglot-fsharp ()
|
|
|
|
(use-package eglot-fsharp
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(require 'f)
|
|
|
|
(setq eglot-fsharp-server-install-dir
|
|
|
|
(expand-file-name
|
|
|
|
(locate-user-emacs-file (f-join ".cache" "eglot")))))))
|
|
|
|
|
2015-03-10 23:11:29 +00:00
|
|
|
(defun fsharp/init-fsharp-mode ()
|
|
|
|
(use-package fsharp-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-03-14 05:45:52 +00:00
|
|
|
:init
|
2016-01-26 16:31:15 +00:00
|
|
|
(progn
|
2021-03-18 04:08:50 +00:00
|
|
|
(when (eq fsharp-backend 'eglot)
|
2020-11-09 21:21:30 +00:00
|
|
|
(require 'eglot-fsharp))
|
2016-01-26 16:31:15 +00:00
|
|
|
(setq fsharp-doc-idle-delay .2)
|
2020-11-09 21:21:30 +00:00
|
|
|
(spacemacs/register-repl 'fsharp-mode 'fsharp-show-subshell "F#")
|
|
|
|
(add-hook 'fsharp-mode-hook #'spacemacs//fsharp-setup-backend))
|
2015-03-10 23:11:29 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2020-11-09 21:21:30 +00:00
|
|
|
(spacemacs/declare-prefix-for-mode 'fsharp-mode "ms" "repl")
|
2017-09-24 16:50:49 +00:00
|
|
|
(spacemacs/declare-prefix-for-mode 'fsharp-mode "mc" "compile")
|
2021-03-18 04:08:50 +00:00
|
|
|
(when (eq fsharp-backend 'eglot)
|
2020-11-09 21:21:30 +00:00
|
|
|
(spacemacs/declare-prefix-for-mode 'fsharp-mode "mg" "goto"))
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'fsharp-mode
|
|
|
|
"cc" 'compile
|
2020-11-09 21:21:30 +00:00
|
|
|
"ga" 'fsharp-find-alternate-file
|
2015-11-18 00:38:05 +00:00
|
|
|
"sb" 'fsharp-load-buffer-file
|
|
|
|
"sB" 'spacemacs/fsharp-load-buffer-file-focus
|
|
|
|
"si" 'fsharp-show-subshell
|
|
|
|
"sp" 'fsharp-eval-phrase
|
|
|
|
"sP" 'spacemacs/fsharp-eval-phrase-focus
|
|
|
|
"sr" 'fsharp-eval-region
|
|
|
|
"sR" 'spacemacs/fsharp-eval-region-focus
|
2020-11-09 21:21:30 +00:00
|
|
|
"'" 'fsharp-show-subshell))))
|
2016-04-05 04:08:34 +00:00
|
|
|
|
|
|
|
(defun fsharp/post-init-ggtags ()
|
2016-08-15 19:24:44 +00:00
|
|
|
(add-hook 'fsharp-mode-local-vars-hook #'spacemacs/ggtags-mode-enable))
|
2016-04-05 04:08:34 +00:00
|
|
|
|
2017-08-26 21:18:09 +00:00
|
|
|
(defun fsharp/post-init-counsel-gtags ()
|
|
|
|
(spacemacs/counsel-gtags-define-keys-for-mode 'fsharp-mode))
|
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun fsharp/post-init-helm-gtags ()
|
|
|
|
(spacemacs/helm-gtags-define-keys-for-mode 'fsharp-mode))
|