lsp-nixd.el 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ;;; lsp-nix.el --- lsp-mode nix integration -*- lexical-binding: t; -*-
  2. ;; Copyright (C) 2020 lsp-mode maintainers
  3. ;; Author: Seong Yong-ju <sei40kr@gmail.com>
  4. ;; Keywords: languages
  5. ;; This program is free software; you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; This program is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. ;;; Commentary:
  16. ;; Client for the nixd language server.
  17. ;;; Code:
  18. (require 'lsp-mode)
  19. (defgroup lsp-nixd nil
  20. "LSP support for Nix, using nixd-lsp."
  21. :group 'lsp-mode
  22. :link '(url-link "https://github.com/nix-community/nixd"))
  23. (defcustom lsp-nixd-server-path "nixd"
  24. "Executable path for the server."
  25. :group 'lsp-nixd
  26. :type 'string
  27. :package-version '(lsp-mode . "8.0.0"))
  28. (lsp-register-client
  29. (make-lsp-client :new-connection (lsp-stdio-connection (lambda () lsp-nixd-server-path))
  30. :major-modes '(nix-mode)
  31. :server-id 'nixd-lsp))
  32. (lsp-consistency-check lsp-nixd)
  33. (provide 'lsp-nixd)
  34. ;;; lsp-nixd.el ends here