From 8a6e5e4d837ddf8d611f4a88d7ddabaeb91ea354 Mon Sep 17 00:00:00 2001 From: Robert O'Connor Date: Tue, 1 Oct 2019 13:01:47 -0400 Subject: [PATCH 1/2] Update so it works with lsp-mode's API --- lsp-crystal.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lsp-crystal.el b/lsp-crystal.el index 803eca8..8b5ef34 100644 --- a/lsp-crystal.el +++ b/lsp-crystal.el @@ -43,9 +43,12 @@ (require 'lsp-mode) (require 'crystal-mode) -(lsp-define-stdio-client lsp-crystal "crystal" - #'crystal-find-project-root - '("scry")) +(lsp-register-client + (make-lsp-client :new-connection + (lsp-stdio-connection (lambda () (cons "crystal" #'crystal-find-project-root "scry"))) + :major-modes '(crystal-mode) + :priority 0 + :server-id 'scry)) (provide 'lsp-crystal) ;;; lsp-crystal.el ends here From 6c1a421a8e09b015c1cc667d2f2d366dd8bb1f8b Mon Sep 17 00:00:00 2001 From: Robert O'Connor Date: Tue, 1 Oct 2019 14:51:56 -0400 Subject: [PATCH 2/2] Allow LSP server binary customization Allow for custom paths to the scry binary, or even other language servers squash! Allow LSP server binary customization --- lsp-crystal.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lsp-crystal.el b/lsp-crystal.el index 8b5ef34..0602f5e 100644 --- a/lsp-crystal.el +++ b/lsp-crystal.el @@ -6,7 +6,7 @@ ;; URL: https://github.com/brantou/lsp-crystal.el ;; Keywords: languages crystal ;; Version: 0.1.0 -;; Package-Requires: ((crystal-mode "0.1.0") (lsp-mode "4.0")) +;; Package-Requires: ((crystal-mode "0.2.0") (lsp-mode "6.1")) ;; This file is not part of GNU Emacs. @@ -43,9 +43,16 @@ (require 'lsp-mode) (require 'crystal-mode) + +(defcustom lsp-server-crystal-scry "scry" + "Path to the scry binary" + :type 'string + :group 'lsp-crystal) + + (lsp-register-client (make-lsp-client :new-connection - (lsp-stdio-connection (lambda () (cons "crystal" #'crystal-find-project-root "scry"))) + (lsp-stdio-connection lsp-server-crystal-scry) :major-modes '(crystal-mode) :priority 0 :server-id 'scry))