Skip to content

Commit

Permalink
feat: add fennel-ls support
Browse files Browse the repository at this point in the history
  • Loading branch information
merrickluo committed Sep 17, 2024
1 parent 12befaa commit bfde1e3
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions clients/lsp-fennel.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
;;; lsp-fennel.el --- lsp-mode for the fennel-ls -*- lexical-binding: t; -*-

;; Copyright (C) 2024 Merrick Luo

;; Author: Merrick Luo
;; Keywords: languages

;; 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 <https://www.gnu.org/licenses/>.

;;; Commentary:

;; LSP client for fennel-ls - an language server for fennel.

;;; Code:

(require 'lsp-mode)

(defgroup lsp-fennel nil
"LSP support for the fennel-ls language server."
:group 'lsp-mode
:link '(url-link "https://git.sr.ht/~xerool/fennel-ls"))

;; TODO: consider find in luarocks install location
(defun lsp-fennel--ls-command ()
(executable-find "fennel-ls"))

(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection #'lsp-fennel--ls-command)
:activation-fn (lsp-activate-on "fennel")
:priority -2
:server-id 'fennel-ls))

(lsp-consistency-check lsp-fennel)

(provide 'lsp-fennel)
;;; lsp-fennel.el ends here
1 change: 1 addition & 0 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ Changes take effect only when a new session is started."
("\\.jsonnet$" . "jsonnet")
("\\.jsx$" . "javascriptreact")
("\\.lua$" . "lua")
("\\.fnl$" . "fennel")
("\\.mdx\\'" . "mdx")
("\\.nu$" . "nushell")
("\\.php$" . "php")
Expand Down

0 comments on commit bfde1e3

Please sign in to comment.