diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index e52ea3b125a..508a53d9e32 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -517,6 +517,19 @@ rust-ts-mode (setq-local syntax-propertize-function #'rust-ts-mode--syntax-propertize) + ;; Injected languages + ;; TODO: add json? + (setq-local treesit-range-settings + (treesit-range-rules + :embed 'rust + :host 'rust + :local t + '((macro_invocation + (token_tree) @capture)))) + + ;; TODO: set this to a useful function + (setq-local treesit-language-at-point-function (lambda (_pos) 'rust)) + ;; Comments. (c-ts-common-comment-setup)