|
| 1 | +;;; lsp-fennel.el --- lsp-mode for the fennel-ls -*- lexical-binding: t; -*- |
| 2 | + |
| 3 | +;; Copyright (C) 2024 Merrick Luo |
| 4 | + |
| 5 | +;; Author: Merrick Luo |
| 6 | +;; Keywords: languages |
| 7 | + |
| 8 | +;; This program is free software; you can redistribute it and/or modify |
| 9 | +;; it under the terms of the GNU General Public License as published by |
| 10 | +;; the Free Software Foundation, either version 3 of the License, or |
| 11 | +;; (at your option) any later version. |
| 12 | + |
| 13 | +;; This program is distributed in the hope that it will be useful, |
| 14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | +;; GNU General Public License for more details. |
| 17 | + |
| 18 | +;; You should have received a copy of the GNU General Public License |
| 19 | +;; along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 20 | + |
| 21 | +;;; Commentary: |
| 22 | + |
| 23 | +;; LSP client for fennel-ls - an language server for fennel. |
| 24 | + |
| 25 | +;;; Code: |
| 26 | + |
| 27 | +(require 'lsp-mode) |
| 28 | + |
| 29 | +(defgroup lsp-fennel nil |
| 30 | + "LSP support for the fennel-ls language server." |
| 31 | + :group 'lsp-mode |
| 32 | + :link '(url-link "https://git.sr.ht/~xerool/fennel-ls")) |
| 33 | + |
| 34 | +;; TODO: consider find in luarocks install location |
| 35 | +(defun lsp-fennel--ls-command () |
| 36 | + (executable-find "fennel-ls")) |
| 37 | + |
| 38 | +(lsp-register-client |
| 39 | + (make-lsp-client |
| 40 | + :new-connection (lsp-stdio-connection #'lsp-fennel--ls-command) |
| 41 | + :activation-fn (lsp-activate-on "fennel") |
| 42 | + :priority -2 |
| 43 | + :server-id 'fennel-ls)) |
| 44 | + |
| 45 | +(lsp-consistency-check lsp-fennel) |
| 46 | + |
| 47 | +(provide 'lsp-fennel) |
| 48 | +;;; lsp-fennel.el ends here |
0 commit comments