Skip to content

Commit

Permalink
Theoritical emacs extension for lsp-mode camel-tooling#2
Browse files Browse the repository at this point in the history
currently unable to configure Emacs with lsp mode so not at the point to
test the Camel extension.

Signed-off-by: Aurélien Pupier <[email protected]>
  • Loading branch information
apupier committed Jul 30, 2019
1 parent 0bb60c2 commit 7120b46
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions lsp-apachecamel.el
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7120b46

Please sign in to comment.