Skip to content

Commit f414a44

Browse files
authored
Add support for Hylang (#4331)
1 parent 3c011dd commit f414a44

File tree

5 files changed

+62
-0
lines changed

5 files changed

+62
-0
lines changed

CHANGELOG.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
* Add Jsonnet support
106106
* Add support for ~ada-ts-mode~.
107107
* Allow customizing Ada semantic token and token modifier faces.
108+
* Add Hylang support.
108109
** Release 8.0.0
109110
* Add ~lsp-clients-angular-node-get-prefix-command~ to get the Angular server from another location which is still has ~/lib/node_modules~ in it.
110111
* Set ~lsp-clients-angular-language-server-command~ after the first connection to speed up subsequent connections.

clients/lsp-hy.el

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
;;; lsp-rpm-spec.el --- lsp-mode integration for Hy -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2024 emacs-lsp maintainers
4+
5+
;; Author: emacs-lsp maintainers
6+
;; Keywords: lsp, hy, hylang
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 Hylang
24+
25+
;;; Code:
26+
27+
(require 'lsp-mode)
28+
29+
(defgroup lsp-hy nil
30+
"LSP support for Hy."
31+
:group 'lsp-mode
32+
:link '(url-link ""))
33+
34+
(defcustom lsp-clients-hy-server-executable
35+
'("hyuga")
36+
"LSP support for the Hy Programming Language, using the hyuga."
37+
:group 'lsp-hy
38+
:risky t
39+
:type '(repeat string))
40+
41+
(lsp-register-client
42+
(make-lsp-client :new-connection (lsp-stdio-connection (lambda () lsp-clients-hy-server-executable))
43+
:activation-fn (lsp-activate-on "hy")
44+
:priority 0
45+
:completion-in-comments? t
46+
:major-modes '(hy-mode)
47+
:server-id 'hyuga))
48+
49+
(lsp-consistency-check lsp-hy)
50+
51+
(provide 'lsp-hy)

docs/lsp-clients.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,14 @@
389389
"lsp-install-server": "html-ls",
390390
"debugger": "Not available"
391391
},
392+
{
393+
"name": "hyuga",
394+
"full-name": "Hy",
395+
"server-name": "hyuga",
396+
"server-url": "https://github.com/sakuraiyuta/hyuga",
397+
"installation": "pip install hyuga --user",
398+
"debugger": "Not available"
399+
},
392400
{
393401
"name": "idris",
394402
"full-name": "Idris",

lsp-mode.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ Changes take effect only when a new session is started."
769769
("\\.go\\'" . "go")
770770
("\\.html$" . "html")
771771
("\\.hx$" . "haxe")
772+
("\\.hy$" . "hy")
772773
("\\.java\\'" . "java")
773774
("\\.js$" . "javascript")
774775
("\\.json$" . "json")

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ nav:
8686
- Hack: page/lsp-hack.md
8787
- HTML: page/lsp-html.md
8888
- Haskell: https://emacs-lsp.github.io/lsp-haskell
89+
- Hy (hyuga): page/lsp-hy.md
8990
- Idris: page/lsp-idris.md
9091
- Java: https://emacs-lsp.github.io/lsp-java
9192
- Javascript/Typescript (deno): page/lsp-deno.md

0 commit comments

Comments
 (0)