diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-03 06:58:36 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-03 06:58:36 +0300 |
| commit | 92183dad779300590ef39c31760883ef540fd177 (patch) | |
| tree | 7c3b19a5f7c0c37f2080af41c414497b60eb747b /sqf-mode.el | |
| parent | 75e61c249a92003f44dffb96255f3e1a7e157554 (diff) | |
| download | sqf-mode-92183dad779300590ef39c31760883ef540fd177.tar.gz sqf-mode-92183dad779300590ef39c31760883ef540fd177.tar.bz2 sqf-mode-92183dad779300590ef39c31760883ef540fd177.zip | |
upd: some changes
downgrade: package-requires versions for emacs and lsp-mode
fix: ;;; Comment:
remove: unnecessary lsp-mode-hook
add: sqf-lsp-setup()
Diffstat (limited to '')
| -rw-r--r-- | sqf-mode.el | 20 |
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) |
