Skip to content

Commit 3893940

Browse files
authored
feat: add fennel-ls support (#4549)
* feat: add fennel-ls support * docs: document lsp-fennel client
1 parent 8200fa1 commit 3893940

File tree

5 files changed

+62
-1
lines changed

5 files changed

+62
-1
lines changed

CHANGELOG.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* Fix lsp-unzip on windows when unzip was found on the PATH
2222
* Fix zls wrong bin path
2323
* Add support for buf CLI ([[https://github.com/bufbuild/buf/releases/tag/v1.43.0][beta]])
24+
* Add fennel support
2425

2526
** 9.0.0
2627
* Add language server config for QML (Qt Modeling Language) using qmlls.

clients/lsp-fennel.el

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

docs/lsp-clients.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,16 @@
602602
"server-url": "https://github.com/NightrainsRbx/RobloxLsp",
603603
"debugger": "Not available"
604604
},
605+
{
606+
"name": "fennel",
607+
"common-group-name": "fennel",
608+
"full-name": "Fennel",
609+
"server-name": "fennel-ls",
610+
"installation-url": "https://git.sr.ht/~xerool/fennel-ls",
611+
"server-url": "https://git.sr.ht/~xerool/fennel-ls",
612+
"installation": "luarocks install fennel-ls",
613+
"debugger": "Not available"
614+
},
605615
{
606616
"name": "magik",
607617
"full-name": "GE Smallworld Magik",

lsp-mode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ As defined by the Language Server Protocol 3.16."
181181
lsp-fsharp lsp-gdscript lsp-gleam lsp-glsl lsp-go lsp-golangci-lint lsp-grammarly
182182
lsp-graphql lsp-groovy lsp-hack lsp-haskell lsp-haxe lsp-idris lsp-java
183183
lsp-javascript lsp-jq lsp-json lsp-kotlin lsp-latex lsp-lisp lsp-ltex
184-
lsp-lua lsp-magik lsp-markdown lsp-marksman lsp-mdx lsp-meson lsp-metals lsp-mint
184+
lsp-lua lsp-fennel lsp-magik lsp-markdown lsp-marksman lsp-mdx lsp-meson lsp-metals lsp-mint
185185
lsp-mojo lsp-move lsp-mssql lsp-nginx lsp-nim lsp-nix lsp-nushell lsp-ocaml
186186
lsp-openscad lsp-pascal lsp-perl lsp-perlnavigator lsp-php lsp-pls
187187
lsp-purescript lsp-pwsh lsp-pyls lsp-pylsp lsp-pyright lsp-python-ms
@@ -785,6 +785,7 @@ Changes take effect only when a new session is started."
785785
("\\.jsonnet$" . "jsonnet")
786786
("\\.jsx$" . "javascriptreact")
787787
("\\.lua$" . "lua")
788+
("\\.fnl$" . "fennel")
788789
("\\.mdx\\'" . "mdx")
789790
("\\.nu$" . "nushell")
790791
("\\.php$" . "php")

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ nav:
110110
- Lua (EmmyLua): page/lsp-emmy-lua.md
111111
- Lua (Lua Language Server): page/lsp-lua-language-server.md
112112
- Lua (Lua-Lsp): page/lsp-lua-lsp.md
113+
- Fennel: page/lsp-fennel.md
113114
- Magik: page/lsp-magik.md
114115
- Markdown: page/lsp-markdown.md
115116
- Marksman: page/lsp-marksman.md

0 commit comments

Comments
 (0)