aboutsummaryrefslogtreecommitdiffstats
path: root/sqf-mode.el
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sqf-mode.el20
1 files changed, 15 insertions, 5 deletions
diff --git a/sqf-mode.el b/sqf-mode.el
index 9b23128..39fc04d 100644
--- a/sqf-mode.el
+++ b/sqf-mode.el
@@ -4,11 +4,11 @@
;; Version: 0.1.0
;; Keywords: languages, sqf, arma, arma3, arma2, syntax
;; URL: https://git.hybridlabs.pro/sqf-mode
-;; Package-Requires: ((emacs "30.2") (lsp-mode "10.0.0"))
+;; Package-Requires: ((emacs "27.1") (lsp-mode "7.0"))
;; This file is not part of GNU Emacs.
-;;; Comment:
+;;; Commentary:
;; Major mode for editing SQF scripts used in Arma 2/3 series.
;; Provides basic syntax highlighting and integrates with HEMTT LSP server
@@ -37,6 +37,8 @@ advanced features when available.
(modify-syntax-entry ?* ". 23")
(modify-syntax-entry ?\n "> b")
(modify-syntax-entry ?\" "\"")
+ ;; check if backward slash is escape
+ (modify-syntax-entry ?\\ "\\")
;; Basic keywords for font-lock (instant highlighting)
(setq-local font-lock-defaults
@@ -49,12 +51,20 @@ advanced features when available.
"local" "global" "remoteExec" "remoteExecCall")
'words)
(0 font-lock-keyword-face))))
-
- ;; Soft LSP start (can be configured to disable)
- (add-hook 'lsp-mode-hook #'lsp--open-after-save nil t)
+ (sqf-lsp-setup)
(lsp-deferred))
;;;###autoload
+(defun sqf-lsp-setup ()
+ "Configure lsp-mode for SQF."
+ (add-to-list 'lsp-language-id-configuration '(sqf-mode . "sqf"))
+ (add-to-list 'lsp-server-programs '(sqf-mode "hemtt-language-server"))
+ (add-to-list 'lsp-project-roots "hemtt.toml"))
+
+(with-eval-after-load 'lsp-mode
+ (sqf-lsp-setup))
+
+;;;###autoload
(add-to-list 'auto-mode-alist '("\\.sqf\\'" . sqf-mode))
(provide 'sqf-mode)