config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

lsp-dot.el (1962B)


      1 ;;; lsp-dot.el --- LSP client for the DOT/Graphviz language -*- lexical-binding: t; -*-
      2 
      3 ;; Copyright (C) 2022 Abdelhak Bougouffa
      4 
      5 ;; Author: Abdelhak Bougouffa <abougouffa@fedoraproject.org>
      6 ;; Keywords: languages, tools
      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 the DOT/Graphviz language
     24 
     25 ;;; Code:
     26 
     27 (require 'lsp-mode)
     28 
     29 ;;; DOT Language (Graphviz)
     30 (defgroup lsp-dot nil
     31   "Settings for the DOT Language Server."
     32   :group 'lsp-mode
     33   :link '(url-link "https://github.com/nikeee/dot-language-server")
     34   :package-version '(lsp-mode . "8.0.0"))
     35 
     36 (defun lsp-dot--dot-ls-server-command ()
     37   "Startup command for the DOT language server."
     38   (list (lsp-package-path 'dot-language-server) "--stdio"))
     39 
     40 (lsp-dependency 'dot-language-server
     41                 '(:system "dot-language-server")
     42                 '(:npm :package "dot-language-server"
     43                        :path "dot-language-server"))
     44 
     45 (lsp-register-client
     46  (make-lsp-client
     47   :new-connection (lsp-stdio-connection #'lsp-dot--dot-ls-server-command)
     48   :priority -1
     49   :activation-fn (lsp-activate-on "dot")
     50   :server-id 'dot-ls
     51   :download-server-fn (lambda (_client callback error-callback _update?)
     52                         (lsp-package-ensure 'dot-language-server callback error-callback))))
     53 
     54 (lsp-consistency-check lsp-dot)
     55 
     56 (provide 'lsp-dot)
     57 ;;; lsp-dot.el ends here