-
Notifications
You must be signed in to change notification settings - Fork 13
/
eglot-superbol.el
38 lines (26 loc) · 947 Bytes
/
eglot-superbol.el
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
30
31
32
33
34
35
36
37
38
;;; lsp-superbol.el --- Eglot LSP client for Superbol COBOL -*- lexical-binding: t; -*-
;;
;; Copyright (c) 2023 OCamlPro SAS
;;
;; All rights reserved.
;; This source code is licensed under the MIT license found in the
;; LICENSE.md file in the root directory of this source tree.
;;; Commentary:
;; Eglot LSP client for Superbol COBOL
;;; Code:
(unless (fboundp 'eglot)
(load "eglot-autoloads"))
(require 'eglot)
(require 'cobol-superbol-mode)
(defun eglot-superbol--start ()
"Superbol LSP startup function for Eglot"
;; Actually start the LSP server
(eglot-ensure)
;; Turn on fontification (even if minimal)
(funcall font-lock-fontify-buffer-function))
(add-to-list 'eglot-server-programs
'(cobol-superbol-mode . ("superbol-free" "lsp")))
;; Autostart the LSP when entering superbol-mode
(add-hook 'cobol-superbol-mode-hook #'eglot-superbol--start)
(provide 'eglot-superbol)
;;; eglot-superbol.el ends here