lsp-cypher.el (2038B)
1 ;;; lsp-cypher.el --- Cypher Client -*- lexical-binding: t; -*- 2 3 ;; Copyright (C) 2023 Gustav Hedengran 4 5 ;; Author: Gustav Hedengran <gustav.hedengran@gmail.com> 6 ;; Keywords: languages lsp cypher 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 ;;; Code: 24 25 (require 'lsp-mode) 26 27 (defgroup lsp-cypher nil 28 "LSP support for Cypher." 29 :group 'lsp-mode 30 :link '(url-link "https://github.com/neo4j/cypher-language-support/blob/main/packages/language-server")) 31 32 (lsp-dependency 'cypher-language-server 33 '(:system "cypher-language-server") 34 '(:npm :package "@neo4j-cypher/language-server" 35 :path "cypher-language-server")) 36 37 (defun lsp-client--cypher-ls-server-command () 38 "Startup command for Cypher language server." 39 (list (lsp-package-path 'cypher-language-server) "--stdio")) 40 41 (lsp-register-client 42 (make-lsp-client :new-connection (lsp-stdio-connection #'lsp-client--cypher-ls-server-command) 43 :activation-fn (lsp-activate-on "cypher") 44 :language-id "cypher" 45 :server-id 'cypher-ls 46 :priority 0 47 :download-server-fn (lambda (_client callback error-callback _update?) 48 (lsp-package-ensure 'cypher-language-server callback error-callback)))) 49 50 (lsp-consistency-check lsp-cypher) 51 52 (provide 'lsp-cypher) 53 ;;; lsp-cypher.el ends here