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/packages.el

86 lines
2.8 KiB
EmacsLisp
Raw Normal View History

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.
;;
;; 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
(eglot-fsharp :toggle (eq fsharp-backend 'eglot))
2020-11-09 21:21:30 +00:00
flycheck
fsharp-mode
ggtags
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
(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
:defer t
2015-03-14 05:45:52 +00:00
:init
(progn
(when (eq fsharp-backend 'eglot)
2020-11-09 21:21:30 +00:00
(require 'eglot-fsharp))
(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")
(when (eq fsharp-backend 'eglot)
2020-11-09 21:21:30 +00:00
(spacemacs/declare-prefix-for-mode 'fsharp-mode "mg" "goto"))
(spacemacs/set-leader-keys-for-major-mode 'fsharp-mode
"cc" 'compile
2020-11-09 21:21:30 +00:00
"ga" 'fsharp-find-alternate-file
"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))))
(defun fsharp/post-init-ggtags ()
(add-hook 'fsharp-mode-local-vars-hook #'spacemacs/ggtags-mode-enable))
(defun fsharp/post-init-counsel-gtags ()
(spacemacs/counsel-gtags-define-keys-for-mode 'fsharp-mode))
(defun fsharp/post-init-helm-gtags ()
(spacemacs/helm-gtags-define-keys-for-mode 'fsharp-mode))