spacemacs/layers/+lang/kotlin/funcs.el

33 lines
950 B
EmacsLisp
Raw Normal View History

2020-07-11 23:04:02 +00:00
;;; funcs.el --- kotlin Layer functions File for Spacemacs
;;
2021-03-22 20:11:29 +00:00
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
2020-07-11 23:04:02 +00:00
;;
;; Author: Maximilian Wolff <smile13241324@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun spacemacs//kotlin-backend ()
"Returns selected backend."
(if kotlin-backend
kotlin-backend
(cond
((configuration-layer/layer-used-p 'lsp) 'lsp)
(t 'company-kotlin))))
(defun spacemacs//kotlin-setup-company ()
"Conditionally setup company based on backend."
(pcase (spacemacs//kotlin-backend)
;; Activate lsp company explicitly to activate
;; standard backends as well
(`lsp (spacemacs|add-company-backends
:backends company-capf
:modes kotlin-mode))))
(defun spacemacs//kotlin-setup-backend ()
"Conditionally setup kotlin backend."
(pcase (spacemacs//kotlin-backend)
(`lsp (lsp))))