-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrph-mode.el
More file actions
29 lines (22 loc) · 827 Bytes
/
grph-mode.el
File metadata and controls
29 lines (22 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
;; grph-mode.el -*- lexical-binding: t; -*-
(require 'lsp)
(defcustom lsp-grph-executable "grph-lsp"
"Path of the GRPH LSP executable"
:type 'file)
(defconst grph-keywords
(list
'("#[A-Za-z]+" . font-lock-preprocessor-face))
"Highlight commands")
(define-derived-mode grph-mode prog-mode "GRPH"
(setq-local comment-start "//")
; (setq-local indent-tabs-mode t)
(set (make-local-variable 'font-lock-defaults) '(grph-keywords)))
(add-to-list 'auto-mode-alist (cons "\\.grph\\'" 'grph-mode))
(with-eval-after-load 'lsp-mode
(add-to-list 'lsp-language-id-configuration '(grph-mode . "grph"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection (lambda () lsp-grph-executable))
:activation-fn (lsp-activate-on "grph")
:server-id 'grphlsp)))
(provide 'grph-mode)