Skip to content

Commit bc25dfb

Browse files
authored
Add support for vala-language-server. (#2294)
1 parent 761b5aa commit bc25dfb

File tree

4 files changed

+61
-2
lines changed

4 files changed

+61
-2
lines changed

CHANGELOG.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Provided automatic installers for `lsp-clojure` (`clojure-lsp`).
1010
* Added ~lsp-modeline-workspace-status-mode~ and option to disable it via ~lsp-modeline-workspace-status-enable~.
1111
* Automatically download [[https://github.com/eclipse/lemminx][XML language server Lemminx]]
12+
* Add Vala support.
1213
** Release 7.0.1
1314
* Introduced ~lsp-diagnostics-mode~.
1415
* Safe renamed ~lsp-flycheck-default-level~ -> ~lsp-diagnostics-flycheck-default-level~

clients/lsp-vala.el

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
;;; lsp-vala.el --- Vala Client settings -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2020 Daniel Svensson
4+
5+
;; Author: Daniel Svensson
6+
;; Keywords: vala lsp
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 Vala
24+
25+
;;; Code:
26+
27+
(require 'lsp-mode)
28+
29+
(defgroup lsp-vala nil
30+
"LSP support for Vala, using vala-language-server"
31+
:group 'lsp-mode
32+
:link '(url-link "https://github.com/benwaffle/vala-language-server")
33+
:package-version `(lsp-mode . "7.1.0"))
34+
35+
(defcustom lsp-clients-vala-ls-executable "vala-language-server"
36+
"Path to the `vala-language-server' binary."
37+
:group 'lsp-vala
38+
:risky t
39+
:type 'file
40+
:package-version `(lsp-mode . "7.1.0"))
41+
42+
(lsp-register-client
43+
(make-lsp-client :new-connection (lsp-stdio-connection (lambda () lsp-clients-vala-ls-executable))
44+
:major-modes '(vala-mode)
45+
:priority -1
46+
:server-id 'valals))
47+
48+
(provide 'lsp-vala)
49+
;;; lsp-vala.el ends here

docs/lsp-clients.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,14 @@
506506
"installation": "cargo install --git https://github.com/latex-lsp/texlab.git",
507507
"debugger": "Not available"
508508
},
509+
{
510+
"name": "vala",
511+
"full-name": "Vala",
512+
"server-name": "vala-language-server",
513+
"server-url": "https://github.com/benwaffle/vala-language-server",
514+
"installation": "meson build && ninja -C build install",
515+
"debugger": "Not available"
516+
},
509517
{
510518
"name": "verilog",
511519
"full-name": "Verilog/SystemVerilog",

lsp-mode.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ unless overridden by a more specific face association."
354354
lsp-hack lsp-groovy lsp-haskell lsp-haxe lsp-java lsp-javascript lsp-json
355355
lsp-kotlin lsp-lua lsp-nim lsp-nix lsp-metals lsp-ocaml lsp-perl lsp-php lsp-pwsh
356356
lsp-pyls lsp-python-ms lsp-purescript lsp-r lsp-rf lsp-rust lsp-solargraph
357-
lsp-tex lsp-terraform lsp-verilog lsp-vetur lsp-vhdl lsp-vimscript lsp-xml
357+
lsp-tex lsp-terraform lsp-vala lsp-verilog lsp-vetur lsp-vhdl lsp-vimscript lsp-xml
358358
lsp-yaml lsp-sqls lsp-svelte)
359359
"List of the clients to be automatically required."
360360
:group 'lsp-mode
@@ -889,7 +889,8 @@ Changes take effect only when a new session is started."
889889
(robot-mode . "robot")
890890
(racket-mode . "racket")
891891
(nix-mode . "nix")
892-
(prolog-mode . "prolog"))
892+
(prolog-mode . "prolog")
893+
(vala-mode . "vala"))
893894
"Language id configuration.")
894895

895896
(defvar lsp--last-active-workspaces nil

0 commit comments

Comments
 (0)