From 7120b4698cb8f40de59f3bdffe6ffa8cee955f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Tue, 30 Jul 2019 16:49:15 +0200 Subject: [PATCH] Theoritical emacs extension for lsp-mode #2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit currently unable to configure Emacs with lsp mode so not at the point to test the Camel extension. Signed-off-by: Aurélien Pupier --- lsp-apachecamel.el | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lsp-apachecamel.el diff --git a/lsp-apachecamel.el b/lsp-apachecamel.el new file mode 100644 index 0000000..2757a88 --- /dev/null +++ b/lsp-apachecamel.el @@ -0,0 +1,34 @@ +;;; lsp-apachecamel.el + +;; Version: 0.1 +;; Homepage: https://github.com/camel-tooling/camel-lsp-client-emacs +;; Package-Requires: ((emacs "25.1") (lsp-mode "5")) +;; Keywords: languages, lsp, camel, fuse, integration + +;;; Code: + +(defcustom lsp-apachecamel-executable + "sourcekit" + "Path of the lsp-apachecamel executable." + :type 'file + :group 'apachecamel) + +(defcustom lsp-apachecamel-extra-args + nil + "Additional command line options passed to the lsp-apachecamel executable." + :type '(repeat string) + :group 'apachecamel) + +(defun lsp-apachecamel--lsp-command () + "Generate the language server startup command." + `(,lsp-apachecamel-executable + ,@lsp-apachecamel-extra-args)) + +(lsp-register-client + (make-lsp-client :new-connection (lsp-stdio-connection 'lsp-apachecamel--lsp-command) + :activation-fn (lambda (file-name _mode) + (string= (f-ext file-name) "xml")) + :server-id 'apachecamel-ls)) + +(provide 'lsp-apachecamel) +;;; lsp-apachecamel.el ends here \ No newline at end of file