diff options
-rw-r--r-- | gsp-ts-mode.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gsp-ts-mode.el b/gsp-ts-mode.el index 3bbb45f..100aedf 100644 --- a/gsp-ts-mode.el +++ b/gsp-ts-mode.el @@ -25,6 +25,13 @@ ;;; Code: +(unless (treesit-available-p) + (error "Tree-Sitter support is required for `gsp-ts-mode'")) +(require 'treesit) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.gsp\\'" . gsp-ts-mode)) + (defcustom gsp-ts-mode-indent-offset 2 "Number of spaces for each indentation step in `gsp-ts-mode'." :version "1.0.0" @@ -112,11 +119,5 @@ See the documentation for `treesit-simple-indent-rules' and (treesit-parser-create 'gsp) (gsp-ts--setup)) -(unless (treesit-available-p) - (error "Tree-Sitter support is required for `gsp-ts-mode'")) -(require 'treesit) -(when (treesit-ready-p 'gsp) - (add-to-list 'auto-mode-alist '("\\.gsp\\'" . gsp-ts-mode))) - (provide 'gsp-ts-mode) ;;; gsp-ts-mode.el ends here |