Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add fennel-ls support #4549

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Fix lsp-unzip on windows when unzip was found on the PATH
* Fix zls wrong bin path
* Add support for buf CLI ([[https://github.com/bufbuild/buf/releases/tag/v1.43.0][beta]])
* Add fennel support

** 9.0.0
* Add language server config for QML (Qt Modeling Language) using qmlls.
Expand Down
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
10 changes: 10 additions & 0 deletions docs/lsp-clients.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,16 @@
"server-url": "https://github.com/NightrainsRbx/RobloxLsp",
"debugger": "Not available"
},
{
"name": "fennel",
"common-group-name": "fennel",
"full-name": "Fennel",
"server-name": "fennel-ls",
"installation-url": "https://git.sr.ht/~xerool/fennel-ls",
"server-url": "https://git.sr.ht/~xerool/fennel-ls",
"installation": "luarocks install fennel-ls",
"debugger": "Not available"
},
{
"name": "magik",
"full-name": "GE Smallworld Magik",
Expand Down
3 changes: 2 additions & 1 deletion lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ As defined by the Language Server Protocol 3.16."
lsp-fsharp lsp-gdscript lsp-gleam lsp-glsl lsp-go lsp-golangci-lint lsp-grammarly
lsp-graphql lsp-groovy lsp-hack lsp-haskell lsp-haxe lsp-idris lsp-java
lsp-javascript lsp-jq lsp-json lsp-kotlin lsp-latex lsp-lisp lsp-ltex
lsp-lua lsp-magik lsp-markdown lsp-marksman lsp-mdx lsp-meson lsp-metals lsp-mint
lsp-lua lsp-fennel lsp-magik lsp-markdown lsp-marksman lsp-mdx lsp-meson lsp-metals lsp-mint
lsp-mojo lsp-move lsp-mssql lsp-nginx lsp-nim lsp-nix lsp-nushell lsp-ocaml
lsp-openscad lsp-pascal lsp-perl lsp-perlnavigator lsp-php lsp-pls
lsp-purescript lsp-pwsh lsp-pyls lsp-pylsp lsp-pyright lsp-python-ms
Expand Down Expand Up @@ -785,6 +785,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
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ nav:
- Lua (EmmyLua): page/lsp-emmy-lua.md
- Lua (Lua Language Server): page/lsp-lua-language-server.md
- Lua (Lua-Lsp): page/lsp-lua-lsp.md
- Fennel: page/lsp-fennel.md
- Magik: page/lsp-magik.md
- Markdown: page/lsp-markdown.md
- Marksman: page/lsp-marksman.md
Expand Down
Loading